#1
Posted 05 July 2014 - 02:42 PM
#2
Posted 05 July 2014 - 04:45 PM
First, you'll want to have some encryption system. I recommend using my Encryption Api for the key exchange and StrUtils for the actual encryption.
Next, you want to set up a packet protocol, this involves parsing rednet messages and doing the corresponding action.
Finally, you want to make sure you hash your passwords when sending them to the server for extra security.
That's all there is to it, kinda complicated, but kinda simple with the right apis. If you need anymore help, I check the forums twice a day and am often on the irc, just shout my name!
PS: I don't recommend using disks for credit cards as they can easily be cloned.
#4
#5
#6
Posted 06 July 2014 - 01:19 AM
#7
Posted 06 July 2014 - 01:52 AM
TheOddByte, on 06 July 2014 - 12:18 AM, said:
Bomb Bloke, on 06 July 2014 - 01:19 AM, said:
#9
Posted 07 July 2014 - 03:30 PM
#10
Posted 07 July 2014 - 08:50 PM
Edited by pauliuskas05, 07 July 2014 - 08:53 PM.
#11
Posted 08 July 2014 - 09:07 AM
pauliuskas05, on 07 July 2014 - 08:50 PM, said:
I worked on something aswell but it also didn't seem to work. Well...I will check it out today after all I wrote the program in 2am yesterday so I couldn't make out any mistakes in the code
#12
Posted 08 July 2014 - 09:25 AM
#13
Posted 09 July 2014 - 09:55 AM
local modem_side = "back"
local server = 6
local d_side = "bottom"
local pin_check = nil
local exists = nil
function cls()
term.clear()
term.setCursorPos(1,1)
print("BANK")
term.setCursorPos(1,2)
end
function dej()
disk.eject(d_side)
end
rednet.open(modem_side)
cls()
print(" Please insert your Credit Card")
local event, isDisk = os.pullEvent("disk")
if fs.exists("disk/bank") then
local ccid = disk.getID(d_side)
rednet.send(server, ccid)
senderId, exists, distance= rednet.receive()
if exists == "yes" then
cls()
write(" PIN: ")
local pin = read("*")
rednet.send(server, pin)
senderId, pin_check, distance = rednet.receive()
if pin_check == "good" then
pin = nil
pin_check = nil
senderId, money, distance = rednet.receive()
print("You have: "..money)
elseif pin_check == "bad" then
cls()
print("Wrong PIN !")
end
elseif exists == "no" then
cls()
print(" Account doesn't exists")
end
else
cls()
print(" This is not a credit card")
dej()
sleep(1.5)
os.shutdown()
end
Server Code:
term.clear()
term.setCursorPos(1,1)
local modem_side = "top"
local srv_id = os.getComputerID()
print("Running BANK server on "..srv_id)
rednet.open(modem_side)
while true do
senderId, id, distance = rednet.receive()
if fs.exists("acc/"..id) then
rednet.send(senderId, "yes")
config.load("acc",id)
local real_pass = config.readVal("pass")
senderId, pass, distance = rednet.receive()
if pass == real_pass then
rednet.send(senderId, "good")
local money = config.readVal("money")
rednet.send(senderId, money)
break
elseif pass ~= real_pass then
rednet.send(senderId, "bad")
break
end
else
rednet.send(senderId, "no")
break
end
end
On ATM I get Error
Quote
Help me !
EDIT:
BTW I am using "Config API' by ben657
Edited by pauliuskas05, 09 July 2014 - 09:56 PM.
#14
Posted 09 July 2014 - 12:12 PM
pauliuskas05, on 09 July 2014 - 09:55 AM, said:
local modem_side = "back"
local server = 6
local d_side = "bottom"
local pin_check = nil
local exists = nil
function cls()
term.clear()
term.setCursorPos(1,1)
print("BANK")
term.setCursorPos(1,2)
end
function dej()
disk.eject(d_side)
end
rednet.open(modem_side)
cls()
print(" Please insert your Credit Card")
local event, isDisk = os.pullEvent("disk")
if fs.exists("disk/bank") then
local ccid = disk.getID(d_side)
rednet.send(server, ccid)
senderId, exists, distance= rednet.receive()
if exists == "yes" then
cls()
write(" PIN: ")
local pin = read("*")
rednet.send(server, pin)
senderId, pin_check, distance = rednet.receive()
if pin_check == "good" then
pin = nil
pin_check = nil
senderId, money, distance = rednet.receive()
print("You have: "..money)
elseif pin_check == "bad" then
cls()
print("Wrong PIN !")
end
elseif exists == "no" then
cls()
print(" Account doesn't exists")
end
else
cls()
print(" This is not a credit card")
dej()
sleep(1.5)
os.shutdown()
end
Server Code:
term.clear()
term.setCursorPos(1,1)
local modem_side = "top"
local srv_id = os.getComputerID()
print("Running BANK server on "..srv_id)
rednet.open(modem_side)
while true do
senderId, id, distance = rednet.receive()
if fs.exists("acc/"..id) then
rednet.send(senderId, "yes")
config.load("acc",id)
local real_pass = config.readVal("pass")
senderId, pass, distance = rednet.receive()
if pass == real_pass then
rednet.send(senderId, "good")
local money = config.readVal("money")
rednet.send(senderId, money)
break
elseif pass ~= real_pass then
rednet.send(senderId, "bad")
break
end
else
rednet.send(senderId, "no")
break
end
end
On ATM I get Error
Quote
Help me !
Your code is...HUGE (no offence). Btw I am really close to completing it and it reaquires a lot less code(well I did it slightly differently but I also get nearly the same erroe
#15
Posted 11 July 2014 - 07:34 PM
#16
Posted 11 July 2014 - 07:46 PM
Edited by flaghacker, 11 July 2014 - 07:48 PM.
#17
Posted 11 July 2014 - 09:55 PM
Bank Server Code:
rednet.open("right")
cards = {{1, 1000}, {2, 550}}
while true do
senderId, ID = rednet.receive("id")
for i = 1, #cards do
if cards[i][1] == ID then
rednet.send(22, "yes", "answer")
senderId, amount = rednet.receive("pay")
if cards[i][2] >= amount then
rednet.send(22, "done", "transaction")
cards[i][2] = cards[i][2] - amount
else
rednet.send(22, "nope", "transaction")
end
else
rednet.send(22, "noCustomer", "transaction")
end
end
end
And here is the code for the counter of the store:
diskID = disk.getID("bottom")
amount = 100
rednet.open("right")
rednet.send(23, diskID, "id")
repeat
senderId, message = rednet.receive("answer")
until senderId == 23
if message == "yes" then
rednet.send(23, amount, "pay")
senderId, message = rednet.receive("transaction")
if senderId == 23 and message == "done" then
print("Transaction Complete!")
elseif senderId == 23 and message == "nope" then
print("Transaction Failed: Not enough money")
else
print("No such customer")
end
end
This is how it works:
1)The computer in the store sends a mesage to the bank server containing the cards ID.
2)The server checks in its table to see if the first number of the tables inside the table match the ID
3)If they do the server sends a message to the computer telling it to send it the amount
4)The computer checks the amount and sees if the second number inside the table the ID was found is bigger or equal to the amount
5)If it is it subtracts the amount from the money in the bank and sends a message to the computer saying that the transaction has been completed.
I will do ATMs tommorow (its already 1am
#18
Posted 11 July 2014 - 10:03 PM
AlkamlBan, on 11 July 2014 - 09:55 PM, said:
Actually I won't because ATMs dispence virtual currency as real-life money. I don't see the point in making such a thing (I mean its more about redstone thatn computers). Plus why use solid money when you can access your bank account from anywhere? Not that a hacker can't steal your money this way but if you carry real money the thief that will kill you can steal it and you can't retreave it but with this you can go to the bank and report you stolen card and they will stop all transactions happening using that specific card. Plus while an ATM dispences money a guy sitting close can easily pick up some. Both ways have an enemy. So its your call which you will use. If you want I will make an ATM just ask.
#19
Posted 15 July 2014 - 08:40 AM
AlkamlBan, on 11 July 2014 - 10:03 PM, said:
AlkamlBan, on 11 July 2014 - 09:55 PM, said:
Actually I won't because ATMs dispence virtual currency as real-life money. I don't see the point in making such a thing (I mean its more about redstone thatn computers). Plus why use solid money when you can access your bank account from anywhere? Not that a hacker can't steal your money this way but if you carry real money the thief that will kill you can steal it and you can't retreave it but with this you can go to the bank and report you stolen card and they will stop all transactions happening using that specific card. Plus while an ATM dispences money a guy sitting close can easily pick up some. Both ways have an enemy. So its your call which you will use. If you want I will make an ATM just ask.
It's only VIRTAUL, so there is no cash to give out.
EDIT:
BTW I am on vacation. So I won't always be online.
Edited by pauliuskas05, 15 July 2014 - 08:44 AM.
#20
Posted 15 July 2014 - 10:09 AM
pauliuskas05, on 15 July 2014 - 08:40 AM, said:
AlkamlBan, on 11 July 2014 - 10:03 PM, said:
AlkamlBan, on 11 July 2014 - 09:55 PM, said:
Actually I won't because ATMs dispence virtual currency as real-life money. I don't see the point in making such a thing (I mean its more about redstone thatn computers). Plus why use solid money when you can access your bank account from anywhere? Not that a hacker can't steal your money this way but if you carry real money the thief that will kill you can steal it and you can't retreave it but with this you can go to the bank and report you stolen card and they will stop all transactions happening using that specific card. Plus while an ATM dispences money a guy sitting close can easily pick up some. Both ways have an enemy. So its your call which you will use. If you want I will make an ATM just ask.
It's only VIRTAUL, so there is no cash to give out.
EDIT:
BTW I am on vacation. So I won't always be online.
Yes but it would be nice wouldn't it? and btw hackers can do some cool tricks to steal you money from the bank. As I said you are not safe in any of the two ways so its your call. I guess having both would be the best option
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











