File encryptor/decryptor

This is a rather simple file encryptor/decryptor which uses a byte mapped table for encryption. It just needs a byte array of length 256, first we have to put in numbers from 0 to 255 in to that array(no duplicates). And then jumble this up according to anyway you want(on this application, it’s done by swapping two places of the array). Because we know that all the bytes are there in the array we are sure that doing stuff like swapping it wont make the array fill up with duplicates or any alien number which was not in that array when we started. This array can be used to map a certain byte to another byte, this will be the encryption table. For decryption it’s good and fast to make a reverse mapped array based on the first array.

So what’s special on this? This one has all that and a fairly good way to jumble the numbers up(this will improve along the way, I just came up with this in two days!). The best thing about this little app is that it’s output and input both are buffered, meaning that it doesn’t need the whole file loaded to RAM. By default the buffer is 8 kB, you can change it if you want.

It should be noted that this is not entirely _that_ cross platform at the moment due to it using the ‘no echo’ feature of Unix terminals through termios.h. If this is removed, someone watching you type on Windows can see the password other than that, there’s no risk in removing that feature.

Since you read all that, or I think that you did you can now download the app(it includes compiled version for Linux x86 and the source, may be I’d compile a Windows version, may be I won’t.)

UPDATE 06-02-2011!
The previous versions may give out a mostly human readable output if you encrypt some text file with a key like “abcd” and use “abc” as decryption key — NOT good! I changed everything from the ground up, now it changes the table as it encrypts and decrypts.

Source and Linux x86 binary

PS: Oh and one last thing, DO NOT think that I made this by referring to documentation or books on encryption(hell no!). I just thought of it and coded it, so it may contain not so good approaches, and there might be vulnerabilities. Do comment on those! And I must say that I DO NOT ENSURE SAFETY OF YOUR DATA that is encrypted by this application, you are provided the source! It’s your responsibility not mine, :). On the other hand I can’t think of a way to reverse engineer it yet, so I use it for my stuff.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s