Ok this is somewhat of a second related post of my other one "C++ File". There is no need to read the other post just want to tell you.
I want to make a console app that does the XOR thing I heard about using the simple ifstream and ofstream ( well simple compared to win programing). This isn't the first time Ive heard about it; I just can't find any hard/good documentation on it.
Thanks in advance.
Edit: I want to actualy save a file with this.

Recommended Answers

All 2 Replies

I want to make a console app that does the XOR thing

What's the "XOR thing"? There are a whole bunch of encryption techniques which use XORing, but it's not the whole algorithm.

I heard about using the simple ifstream and ofstream

If you're looking for ifstream and ofstream documentation, here's some...


http://www.cplusplus.com/reference/iostream/ifstream/
http://www.cplusplus.com/reference/iostream/ofstream/


Here's a tutorial.

http://www.cplusplus.com/doc/tutorial/files/


I'm not sure precisely what you're looking for, so these are pretty generic links.

Real encryption algorithms (symmetric ones anyway) are mostly based on an extrememly strong random number generator that can be "seeded", which means made to generate the same sequence of random numbers, given a seed, often called the key.

You take those extremely random numbers and xor them with the data, giving you seemingly completely random output. When decrypting, you use the key again, seed the random number generator with the same seed (key), and do the xor operation again on the encrypted data. Doing an xor again on the encrypted data with the same number will undo the original xor (that you did when encrypting) into the original data.

Is this what you mean?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.