I'm using Borland C++. I want to create a basic encryption program. I checked out the XOR thing in the tutorials but I don't fully grasp the consept. How would I create a basic key and compare a key to the input... Unless there's a better way than XOR can you explain it?
And also if you know any good tutorials or websites on the topic.
The concept of XOR encryption is the following. Let P be the plain text, K be the key and E the encrypted text, then:
P xor K = E
E xor K = P
So you need to create a key, which is a bitstring. This key can be generated by using random value generation or let the user input a string.
Then you'll need to xor each byte of P with K to get E. And when decoding, you need to xor each byte of E with K to get P.