Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBP] Powerful easy-to-use encryption system

Author
Message
calcyman
16
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 28th Sep 2008 22:02
This sample application will read a file called "test1.txt", encrypt it into a file called "test2.txt", and finally decrypt it back into a file called "test3.txt".

The commands can only encrypt and decrypt strings, so make sure you don't stick any null bytes in there.



The optomist's right, The pessimist's right.
calcyman
16
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 29th Sep 2008 22:11
I forgot about XOR's bitwise capabilities - I've only ever used it as a boolean operator.

So your function is symmetrical (ie works both ways)? That way you've nicely avoided having to create two similar functions.

Yours is probably better for encrypting raw data, but mine preserves the strings. On the other hand, mine won't work for a bitmap, since anything outside the range 32..127 will be lost.

The optomist's right, The pessimist's right.

Login to post a reply

Server time is: 2024-05-19 02:44:59
Your offset time is: 2024-05-19 02:44:59