Xor encryption

Hello there,

I made a simple xor encryption algorithm. Now i hve this small question: can i use xor encryption to encrypt ANY file i want, or only plaintext?
xor encryption works for any data
How do i read in the bytes from a file? And i suppose i store them in chars?
Now im using getline and std::strings.
You should read the file in binary mode. Don't use getline because that will ignore all the newline characters. If you use std::ifstream to read the file you can use the get() function to read one byte at a time.
Last edited on
Topic archived. No new replies allowed.