This program uses Command line arguments to get the path and the encryption key. I'm trying to make it ask the user for these two things, and remove the need to go to command prompt to execute it. But when I use an encryption key that the user has inputted (using cin, into a string) I get a different encryption then if I would have inputted the SAME key in a command line argument.
How could I get the user to input the key, and get the same encryption that would have happened in command prompt?
I mean that you should do this to discover what the problem is. Ask the user for the key. Then read the same key from the file. Then compare the two. There must be something different about them and discovering what it is should help you solve the problem.
This looks like a character encoding issue. I will hazard a guess that "ó" is being stored as a two byte UTF-8 character in the file. When you enter this from the keyboard it is possible that you may be only reading one of the two bytes or the terminal is performing some kind of code-page translation.
You could consider using more standard characters for your key. If its your terminal then I can't really help you with that. Its probably a Windows thing and it works fine on my Linux.
How are you reading the character? I presume you are inputting a std::string rather than a single char?
Someone else might have a better understanding or your setup. I don't see why you need to use these out of range characters for you key though. Why not just use the English alphabet?
Well that site does a conversion to ASCII before converting to binary. So it could be that your terminal it translating your character before feeding it to your program. I think you need to set the code page or the locale or something in the terminal before running the program.
Or install Linux which has an exceptionally sane shell.