Basically, I take a key (which is a md5 sum of a plaintext key input by the user), iterate byte by byte of the key over each byte read from a file, XOR them together, and write the 'ciphered' result to a file.
What I am looking for is some advice on how a better key generation scheme would work. I know that pseudorandom numbers (ideally truly random numbers) are used in key generation in many schemes, but if it is random, how is the message deciphered on the other end?
Thanks for any advice on this, and any criticisms of the code in general.
It's been a few days and still no responses, so I think I'll narrow my question a little...
My biggest conceptual hangup here is, how, if the encryption key is generated partially by using pseudo random or truly random values, can the decryption process take place?
Desh,
The following may be of interest (all chapters are available for free download from the link). Handbook of Applied Cryptography
http://www.cacr.math.uwaterloo.ca/hac/
Sorry for not replying earlier. But if you look at my tiny article involving encryption you'll see that someone can simply xor the end data with the original data in your file and the result will be your key... over and over and over and over.
A really simple thing you can do is increment your key by a number each time you use it, and use the modulus operator to make sure you don't overflow.