This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
Key Validation
Started by Bubbycolditz, 09 May 2017 - 06:37 PMPosted 09 May 2017 - 08:37 PM
Hello pros. Today I am wondering if I can make a key validation by using a random generated key, storing it in a database and connect It to the database and make sure that the key is correct.
Posted 09 May 2017 - 08:57 PM
If any of this is done over rednet or modems it would be insecure unless properly encrypted.
Posted 09 May 2017 - 09:37 PM
You may want to look into public key encryption.
Posted 10 May 2017 - 04:09 AM
Where can that be found? Link would be appreciatedYou may want to look into public key encryption.
Posted 10 May 2017 - 06:52 AM
If any of this is done over rednet or modems it would be insecure unless properly encrypted.
You may want to look into public key encryption.
Give him a break, let him learn how to do this bit first and then start learning how to make it more secure after he has it down pat. Learning is a step-by-step process, not an all-in-one tsunami.
Also, encrypting your modem/rednet message is very silly and insecure anyway, as a computer can easily spoof having the encrypted key by sending an exact copy of the key straight to the server, and bob's your uncle, you're in. Waste of time.
E.g.
User inputs password, client encrypts password and sends it to server which then matches it against it's own copy of the password.
Hacker sees the message (encrypted password), sends the string via a simple rednet.send message at the intended server which then matches it against it's own copy of the password.
Anyway, one way to set up a simple key database is like this:
Make a computer with a folder on it called 'keys'. In this folder you can make multiple files (key1, key2, key3 etc.) and have each file have a string in it (e.g. 'cars are cool' or '12312980509853535' or 'password').
That's your server/database.
Now what can happen is you make a simple script that constantly checks for rednet/modem messages (you decide which of those to use - if you want to keep it simple use rednet, but it isn't very secure). Once it gets a message it can store the actual message itself as a string. Then what you can do is you can make a for loop that goes through every file in the 'keys' directory, opening them up and seeing if any of them contain the same string as yours.
If it does find a match, you can send a reply message saying "SUCCESS" and away you go. If not you could say "FAILURE" or "ERROR" or something.
That's the simplest way to go, without doing any fancy, meaningless encryption :)/>
Posted 10 May 2017 - 08:48 AM
What is the goal of your program/api at the moment? being able to store encryption keys is a bit pointless on its own.
If your goal is to learn more code then make a wireless door lock, the example is pointless in minecraft (anyone got a pickaxe?) but it is a good place for teaching secure communication and data practices
If your goal is to learn more code then make a wireless door lock, the example is pointless in minecraft (anyone got a pickaxe?) but it is a good place for teaching secure communication and data practices
Edited on 10 May 2017 - 06:50 AM
Posted 10 May 2017 - 08:38 PM
What is the goal of your program/api at the moment? being able to store encryption keys is a bit pointless on its own.
If your goal is to learn more code then make a wireless door lock, the example is pointless in minecraft (anyone got a pickaxe?) but it is a good place for teaching secure communication and data practices
I plan on using this for my OS. You will need a key to use the OS.
If any of this is done over rednet or modems it would be insecure unless properly encrypted.Give him a break, let him learn how to do this bit first and then start learning how to make it more secure after he has it down pat. Learning is a step-by-step process, not an all-in-one tsunami.You may want to look into public key encryption.
Also, encrypting your modem/rednet message is very silly and insecure anyway, as a computer can easily spoof having the encrypted key by sending an exact copy of the key straight to the server, and bob's your uncle, you're in. Waste of time.
E.g.
User inputs password, client encrypts password and sends it to server which then matches it against it's own copy of the password.
Hacker sees the message (encrypted password), sends the string via a simple rednet.send message at the intended server which then matches it against it's own copy of the password.
Anyway, one way to set up a simple key database is like this:
Make a computer with a folder on it called 'keys'. In this folder you can make multiple files (key1, key2, key3 etc.) and have each file have a string in it (e.g. 'cars are cool' or '12312980509853535' or 'password').
That's your server/database.
Now what can happen is you make a simple script that constantly checks for rednet/modem messages (you decide which of those to use - if you want to keep it simple use rednet, but it isn't very secure). Once it gets a message it can store the actual message itself as a string. Then what you can do is you can make a for loop that goes through every file in the 'keys' directory, opening them up and seeing if any of them contain the same string as yours.
If it does find a match, you can send a reply message saying "SUCCESS" and away you go. If not you could say "FAILURE" or "ERROR" or something.
That's the simplest way to go, without doing any fancy, meaningless encryption :)/>/>
So how would I do a server database? Not local but like connecting to a website or IP Address to gather this info. Plus I would also like to know how I can generate a key and store it automatically.
Posted 10 May 2017 - 09:25 PM
What is the goal of your program/api at the moment? being able to store encryption keys is a bit pointless on its own.
If your goal is to learn more code then make a wireless door lock, the example is pointless in minecraft (anyone got a pickaxe?) but it is a good place for teaching secure communication and data practices
I plan on using this for my OS. You will need a key to use the OS.
Describe the process that your users need to do in order to unlock this OS. So they type in a password? or do they have a key on a disk which they use?
So how would I do a server database? Not local but like connecting to a website or IP Address to gather this info. Plus I would also like to know how I can generate a key and store it automatically.
You will need to make a website in order to do so. It's probably a good idea to learn that side of things first as it will be the more complex part and what you will learn there can be applied to the computercraft side of things.
Posted 11 May 2017 - 02:48 AM
Describe the process that your users need to do in order to unlock this OS. So they type in a password? or do they have a key on a disk which they use?I plan on using this for my OS. You will need a key to use the OS.What is the goal of your program/api at the moment? being able to store encryption keys is a bit pointless on its own.
If your goal is to learn more code then make a wireless door lock, the example is pointless in minecraft (anyone got a pickaxe?) but it is a good place for teaching secure communication and data practicesYou will need to make a website in order to do so. It's probably a good idea to learn that side of things first as it will be the more complex part and what you will learn there can be applied to the computercraft side of things.So how would I do a server database? Not local but like connecting to a website or IP Address to gather this info. Plus I would also like to know how I can generate a key and store it automatically.
Describe the process that your users need to do in order to unlock this OS. So they type in a password? or do they have a key on a disk which they use?I plan on using this for my OS. You will need a key to use the OS.What is the goal of your program/api at the moment? being able to store encryption keys is a bit pointless on its own.
If your goal is to learn more code then make a wireless door lock, the example is pointless in minecraft (anyone got a pickaxe?) but it is a good place for teaching secure communication and data practices
After they install the OS, they are asked to enter a key.You will need to make a website in order to do so. It's probably a good idea to learn that side of things first as it will be the more complex part and what you will learn there can be applied to the computercraft side of things.So how would I do a server database? Not local but like connecting to a website or IP Address to gather this info. Plus I would also like to know how I can generate a key and store it automatically.
After they install the OS, they are asked to enter a key.
Edited on 11 May 2017 - 12:50 AM
Posted 11 May 2017 - 08:55 AM
After they install the OS, they are asked to enter a key.
so product key like.
I wouldn't bother with is as people can change the source of your code to bypass it
but start with the server side of things. you will need a server host, and knowledge of php. You may want to message DannySMc as they have made a few projects with external servers.
Posted 13 May 2017 - 12:57 PM
so product key like.After they install the OS, they are asked to enter a key.
I wouldn't bother with is as people can change the source of your code to bypass it
but start with the server side of things. you will need a server host, and knowledge of php. You may want to message DannySMc as they have made a few projects with external servers.
Ok. Thank You very much.