ComputerCraft Forums

ComputerCraft => Ask a Pro => Topic started by: Tauro101 on Jun 27, 2022, 03:29 PM

Title: Making an account system
Post by: Tauro101 on Jun 27, 2022, 03:29 PM
could anybody explain how i could make a client that can login and register
and a server that checks and saves it?
Title: Making an account system
Post by: Erb3 on Jun 27, 2022, 07:00 PM
This is not a very easy task, especially when you want it to be safe.
My suggestion is that you could use something like cc-rednet-encrypt (https://forums.computercraft.cc/index.php?topic=441.msg1523#msg1523) to make it encrypt the traffic. This program also discards replay attacks.

I suppose a workflow for registering could look like this:
(https://camo.tmpim.com/1735baabf2ea777f653cc3cc86ed6a5c960c3e1a/68747470733a2f2f6763646e622e706272642e636f2f696d616765732f4d38534f33464c7a6442386a2e706e673f6f3d31)

To hash the password you could use something like sha256 (http://www.computercraft.info/forums2/index.php?/topic/8169-sha-256-in-pure-lua/).
Even tho the hashing part isent required, it is recommended.
Edit: The workflow above is not really safe. You should instead hash the password client side. Sorry for the confusion.

If you successfully execute this, I have some ideas that you could implement if you want:
- GUI (Example Library: Basalt (https://github.com/Pyroxenium/Basalt))
- Salting (Very good video about salting (https://youtu.be/cjdiIKFYeXQ?t=64))
- Cross-server (Example Library: Soqet (https://soqet.alexdevs.me/))
But don't worry about these until you are done! 😀