So I am having trouble getting started with a program. The point of the assignment is to use a one time pad encryption algorithm.
So my assignment is to take a message such as " It is cold outside" and encrypt it with "Make me some hot chocolate". Use the ‘XOR’ operation to combine letters.
Some rules to the assignment are:
-I need to have,4 files, one for input (plain text), one for the key (key file), one for the encrypted text and the last for the decrypted text.
- Use the "+"operation to encrypt the text.
So I kind of understand the concept of a pointer, and string as we have touched up on it in lecture, but I have no idea where i should start.
The teacher mentioned that you can literally find the code on wiki, but copying and pasting without understanding what you are doing doesnt help in the long run. He also said it was an easy assignment, but I don't see it as that easy :P
First you said use xor (a ^ b) to "combine letters," then you said use plus (a + b) to "encrypt the text." Which is it? They do different things. Most relevant, (a + b) - b == a, where as (a ^ b) ^ b == a. So encryption an decryption use the same operation with xor.
Hmm after looking at it, he used both phrases. In the rules of the assignment he lists use '+' and in the instructions he says use 'XOR'. I would just go with '+'
Well adding two chars sounds like a Vigenère cipher. (Personally if you understand xor, it's easier, like I said the same program encrypts and decrypts.)
Either way, start by asking the user for the filenames (or use the standard cin and cout, with redirection at the command line.)