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

SteamPress. Packing & Unpacking, encrypt & decrypt

Started by Micheal Pearce, 27 November 2014 - 06:05 AM
Micheal Pearce #1
Posted 27 November 2014 - 07:05 AM
Hey, I wanna start off saying that if any of this post doesnt make sense or what not, its because It's because its late at night for me. Anyway I havent made anything for a very long time so I just wanted to refresh my lua skills and make something, Ive make SteamPress.

It's pretty simple it packs folders and sub folders into one file, then it can unpack those files. It can also pack and encrypt.

When it encrypts a file it makes a personal key that is needed to decrypt the file

heres the pastebin link G5t1CK8U

to test my code I packed NovaOS and made a custom installer for it (just for show not for general use)
heres that link T7kB2r52 (very large file)

usage

packing: steampress press [FolderName] [encryption boolean]

unpacking: steampress press [PressedFile] [keyFile]

the only problems I've come to find is that trying to press and encrypt a large folders *cough*NovaOS*cough* freezes the computer but is still terminable
I'll jazz up my post here soon, have fun.
Edited on 27 November 2014 - 05:48 PM
Exerro #2
Posted 27 November 2014 - 09:13 AM
This is a good idea (although I do have it in Nova :P/>), that's easy to use, and will definitely come in handy for people wanting simple installers. I like the way it works on folders, unlike most encryption programs on here. The ability to pack and unpack folders is also nice. I have a program to do that on all my computers, it is very useful, I'm sure people will have many uses for it.

Maybe a status bar saying how much it is done with the encryption would be nice? (heh, I'm getting ideas now) That could solve the problem of the computer appearing to freeze up.
Micheal Pearce #3
Posted 27 November 2014 - 03:08 PM
Wouldn't you need to load all the files in order to make a status bar? You see the encryption happens on the fly, once a file is being read it is converted aswell
Edited on 27 November 2014 - 02:09 PM
Exerro #4
Posted 27 November 2014 - 03:19 PM
You'd need to read all the files, yes, but that takes no time at all. I ran a little program that printed the delta time between opening Nova and closing it after being read and it took 0 seconds…
Spoiler
I don't think that doing that would cause any significant lag, unless you had thousands of files being read.

Anyway, it's a good tool on it's own. A status bar would only ever be used if the file it was encrypting or decrypting was huge, like Nova.
Micheal Pearce #5
Posted 27 November 2014 - 06:51 PM
I updated the code adding a percentage bar; just Nova/apps/Designer/main.lua takes like 15 minutes to encrypt xD
Edited on 27 November 2014 - 05:54 PM
Exerro #6
Posted 27 November 2014 - 06:54 PM
XD, I believe Designer was a 1000ish line program in total, so that's fair enough.

Now it has a UI, some screenshots would be good too.
Micheal Pearce #7
Posted 27 November 2014 - 06:57 PM
It doesn't really have a UI it's just text nothing special