cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Xor encryption
Xor encryption
Jan 12, 2012 at 10:09pm UTC
xander333
(641)
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?
Jan 12, 2012 at 10:13pm UTC
Peter87
(11254)
xor encryption works for any data
Jan 12, 2012 at 10:23pm UTC
xander333
(641)
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.
Jan 12, 2012 at 10:46pm UTC
Peter87
(11254)
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
Jan 12, 2012 at 10:47pm UTC
Topic archived. No new replies allowed.