Hello to all programmers:
I have been working on the following program but I am encountering some difficulties any help whatsoever would be greatly appreciated.
My instructions are:
Write a c++ program,
1. Prompts the user for a choice of encrypt or decrypt, prompts for the input and output filenames
2. has a function for encryption
a. generates a random key
b. stores the key in the encrypted file
c. encrypts the data from the input file by performing xor of the key with every byte from the input file
3. has a function for decryption
a. reads the key from the encrypted file
b. decrypts the data from the input file by performing xor of the key wit every byte from the file
4. performs the encryption or decryption based on the user's choice.
so far I have ( Not quite sure what to do next):
#include<iostream>
#include<string>
#include<ctime>
#include<cstdlib>
#include<fstream>
usingnamespace std;
void encrypt();
void decrypt();
char option;
// char inFile;
char outFile;
int decryptencrypt;
void main()
{
srand((unsigned)time(NULL));
encrypt();
decrypt();
cout << "Enter 1 to decrypt" << endl;
cout << "Enter 2 to encrypt" << endl;
cin >> decryptencrypt;
cout << "Enter the input filename" << endl;
cin >> option;
// cin.get(inFile);
string inFile;
getline(cin, inFile);
cout << "Enter the output filename" << endl;
cin >> outFile;
}
void encrypt(){
char t
}
void decrypt(){
}