I am a newbie to programing but I seem to be getting the hang of things. I am trying to create an plain text encription program that inputs the cipher key and encription text to be accepted via either comma deliminated txt or excel file. I have my program but I cannot figure out how to load the files. Please help

8 Years
Discussion Span
Last Post by shea279

There is a website I remember which helped me when I ran into the same problem.
It is called Google.com
You just have to type "File Handling in C++" as the search query and you will get more than your thought.
Please try it


ok i am writing the same thing so i will point you in the right direction..
XOR encryption is the simplest it gets. for each bit of the data file, you xor it against each bit of the key, scambling the file. Be warned that this can be cracked in like 10 minutes by a determined, semi-intelligent person. if you want to decrypt the encrypted data, re XOR the encrypted data against the key.
the sample code for XOR

#include <iostream.h>
int main()
  char string[11]="A nice cat";
  char key[11]="ABCDEFGHIJ";
  for(int x=0; x<10; x++)
  return 0;

then just use fstream binary i/o functions for your file input and output. (http://www.cplusplus.com/reference/iostream/fstream/open.html)

if you want very secure encryption, use cryptolib's aes + sha256 (for key) functions, but this is a bit more complicated and hard to implement.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.