This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
The_King_JAZ's profile picture

Easy 470-line bank code (Security level: very low)

Started by The_King_JAZ, 10 June 2014 - 03:49 AM
The_King_JAZ #1
Posted 10 June 2014 - 05:49 AM
This is a simple, yet very insecure way to handle electronic banking. The current program allows money transfer through accounts (like one would expect through a bank program). There are two types of banking accounts: internal and external accounts. Internal accounts are accounts that are already on the bank computers, and external accounts are the accounts on the disks that are used for banking.
All files MUST be a .txt file (with a name in the first line, a password in the second line, and an amount of money 0 and above in the third line) in order to be read, and must be located on either disk/acc/ or acc/ from the main directory on the computer.
A very big problem with this easy way of banking is that anyone can just make themselves money by creating an acc directory, and making a .txt file with the required lines filled in properly. Also, stealing accounts would be easy, because all someone would need to do is take someone else's banking disk, put it in any disk drive, and open their .txt file. I would not recommend using this on any server until a way to block someone's ability to edit these essential files is discovered (perhaps by making them read-only, but that could be difficult).
Anyway, I hope this is useful to anyone looking for a bank. Please feel free to play around with the code a little, and please do tell me if there is a way to make these files read-only. Thanks!

**Please note that because of some fancy color changing stuff (which I later gave up on), this requires an advanced computer.**
pastebin: http://pastebin.com/Nq0TuZVa
The_King_JAZ #2
Posted 15 July 2014 - 05:47 AM
I have expanded on this with a wireless money transfer program, which allows two computers (either advanced or normal, including wireless pocket computers) to connect to each other with rednet and transfer money between two .txt accounts in their /acc directories. Note that in order for this program to work, both computers MUST each have at least one .txt account in a directory titled "acc", and filled out with the following information: Line 1 - name ; Line 2 - password ; Line 3 - a number that is greater than 0 for the amount of money (no dollar sign).
Creator #3
Posted 05 February 2015 - 08:56 PM
Hey, nice idea.

But there are a lot of banking systems that are way more secure. In order to make anything secure, the end user shouldnt be able to change the data at his own will.

Just decided to reply because I know how frustrating it is when no one replies.
RoD #4
Posted 17 February 2015 - 10:42 PM
You dont have any function.. I even think you dont know what a function is XD Anyways if you use them i bet you can cut the number of lines by half or more.
The_King_JAZ #5
Posted 23 February 2015 - 05:15 AM
You dont have any function.. I even think you dont know what a function is XD Anyways if you use them i bet you can cut the number of lines by half or more.

Haha at the time, no I didn't use very many functions. It was really just a very successful experiment. I agree that having functions would greatly decrease the amount of lines (and perhaps the use of tables as well to store some of the variables). I will work on such details. Also, perhaps using rednet to broadcast information to a computer locked away somewhere nearby would help with security issues, but then again, anyone who knows how to use rednet would then be able to intercept the data after one look at the program. Thanks for your input
The_King_JAZ #6
Posted 23 February 2015 - 05:34 AM
Hey, nice idea.

But there are a lot of banking systems that are way more secure. In order to make anything secure, the end user shouldnt be able to change the data at his own will.

Just decided to reply because I know how frustrating it is when no one replies.

At the time, I didn't really know much about rednet, but now that I do I will attempt to make a better and more secure version of this. What I plan to do is have a single computer hold all data while banking cards simply hold account numbers and users will be prompted to enter a pin as in the real world. There will be a more manual way available (such as entering your acc. Number if you do not have your banking card) as well. This fixes the problem of the ability to create your own money, but a simple glance at the program by one who knows how to use rednet could lead to compromise of all accounts. Perhaps I could somehow encrypt messages between the computer (by having various passwords with set digits in between numbers in the pin) but I am not yet sure of exactly how I would want to do that.
Creator #7
Posted 23 February 2015 - 02:55 PM
What I suggest is that you use the Diffie Hellman key exchange algorithm. Currently I am plementing it in IPnet. You could use the IPnet api to tranmit data,which supports sending messages over longer distances. The api is still WIP but the local router system works flawlessly and is extremelly fast. Maybe this afternoon I'll be implementing encryption.

Do you want help for the program. I am pretty advanced in coding and I am sur that together we could develop something awesome. Check out my othe programs like FileX and FileNet.
The_King_JAZ #8
Posted 24 February 2015 - 03:37 AM
If you really do want to help, you can. I don't really know when I would be able to put forth a great effort toward the project, though, being that I'm still in school. I'll check out your other programs to see what you have to offer. I, myself am not a great programmer (as can be seen from this program, though at that time, I had only been programming for four months). Now it's been almost a year since I've started learning Lua and I guess I know a lot more than I did back then. I haven't been doing much with ComputerCraft, either, as I have recently made the switch to Open Computers (though there are many things that are alike between the two mods). Anyway, yeah, I would love to have help with it! Just let me know when you're ready to get started!
Creator #9
Posted 24 February 2015 - 04:42 PM
If you really do want to help, you can. I don't really know when I would be able to put forth a great effort toward the project, though, being that I'm still in school. I'll check out your other programs to see what you have to offer. I, myself am not a great programmer (as can be seen from this program, though at that time, I had only been programming for four months). Now it's been almost a year since I've started learning Lua and I guess I know a lot more than I did back then. I haven't been doing much with ComputerCraft, either, as I have recently made the switch to Open Computers (though there are many things that are alike between the two mods). Anyway, yeah, I would love to have help with it! Just let me know when you're ready to get started!

I'm in school too, so my time is not infinite. However I suggest that firstly I would like to finish IPnet. When it's fully working, I will notify you.