[Help Me]Very Simply Encrypt/Decrypt
Code:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int Menu(void);
void Encrypt(void);
void Decrypt(void);
string EncryptLine(string,int);
string DecryptLine(string,int);
int main(void)
{
int c = Menu();
while( c != 3 )
{
switch(c)
{
case 1:
Encrypt();
case 2:
Decrypt();
}
}
}
int Menu(void)
{
int c = 0;
cout << "Press [1] to Encrypt" << endl'
cout << "Press [2] to Decrypt" << endl;
cin << c;
}
void Encrypt(void)
{
string encryptedLine;
string line;
//Stuff to get a line and the key
EncryptLine(line,key);
//stuff to write out lines
}
void Decrypt(void)
{
string decryptedLine;
string line;
// Stuff to get a line
DecryptLine(line,key);
// stuff to write out lines
}
this is the example i was given to go of off and i have no idea where to even start, we are also given 2 files, Number.dat, the only thing in that file is the number 3, and then we are given Unencrypted.txt, which contains 3 lines of text.
I am not asking for this to be done for me i am merely asking if anyone can give me any tips or hints on where to start, i am extreamly confused :(
Edit: We have to pull in the information from Unencrypted.txt, use the Number.dat as the key, and output it to a new file names Encrypted.txt