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

CCLock File Encryption

Started by minecraftwarlock, 15 December 2016 - 08:51 AM
minecraftwarlock #1
Posted 15 December 2016 - 09:51 AM
CCLock is a Utility that will password protect your computer and encrypt all of your files.
The files are never stored decrypted so even with a startup disk your files are still safe

The password is stored using SHA-256 and a random salt (http://www.computerc...56-in-pure-lua/)
The files are encrypted using AES encryption using one of the password hashes as the key (http://www.computerc...aes-encryption/)

Download
http://pastebin.com/raw/VnxRa75D

wget http://pastebin.com/raw/VnxRa75D startup
(pastebin get wasn't working at the time of posting this)

Warning: You will no longer be able to edit the .pwd.pwd file (also if you delete it the salt is gone and your files can no longer be decrypted)
Warning: If you forget the password the files are essentially gone forever
Edited on 15 December 2016 - 09:13 PM
Lyqyd #2
Posted 15 December 2016 - 01:46 PM
You've accidentally included the space and the word "startup" in the pastebin URL. You'll also need to provide a non-minified version of the program as the main download.
apemanzilla #3
Posted 15 December 2016 - 02:04 PM
You've accidentally included the space and the word "startup" in the pastebin URL. You'll also need to provide a non-minified version of the program as the main download.

His code isn't minified, it's just that the AES API he's using is minified and included directly in the main file. If you scroll down past that you can see his code.
Pyuu #4
Posted 19 December 2016 - 03:54 AM
AES-256 encrypting all files is neat (maybe not practical, but neat), but how fast does it run on computercraft? From my experience with hashing on it, it doesn't particularly run at a fast pace. Is there a slow-down to using this?
Anavrins #5
Posted 19 December 2016 - 05:09 PM
AES-256 encrypting all files is neat (maybe not practical, but neat), but how fast does it run on computercraft? From my experience with hashing on it, it doesn't particularly run at a fast pace. Is there a slow-down to using this?
I did this same type of program a while back using my Chacha20 encryption algorithm on a fast setting, it is fast enough to be unnoticeable on small-medium files, as long as you use the correct optimizations, my largest file (40kb) barely takes a quarter of a second.
As for this program, it can be faster in two ways:
Using AES-128 instead, as it runs much faster than AES-256 while still being completely safe.
The sha256 implementation he's using is kind of slow compared to mine (shameless plug), by quite a large amount.
Edited on 19 December 2016 - 04:10 PM
Pyuu #6
Posted 19 December 2016 - 11:53 PM
Quarter of a second? That's not too terrible for a CC program.