JustAnswer
>
Programming
Ask A Question
|
Register
|
Login
|
Help
Programming
Ask a Programming Question, Get an Answer ASAP!
Have your own Programming question?
4 Programmers are Online Now
characters left:
Not a Programming Question?
Question
I need to write a simple program in C++ that encrypts and then decrypts a user provided file. I need to ask the user for input/output files, generate a random key, and then xor it with the user's file. I need to process the data in bytes, so all reading and writing of files must use the char type. I also have to use functions for the encrypt/decrypt portion and use a while loop for the xor. Please help!!!
Submitted: 148 days and 4 hours ago.
Category: Programming
Value: $22
Status: AWAITING EXPERT REPLY
+
Read More
Optional Information
Already Tried:
This is what I have so far (not sure if it is correct though):
#include <fstream>
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
void encrypt ();
void decrypt ();
void main ()
{
char choice;
cout << "Do you want to encrypt or decrypt?" << endl;
cout << "Enter E for encrypt or D for decrypt: ";
cin >> choice;
if (choice =='E')
encrypt ();
else
decrypt ();
} & nbsp; //good to this point
void encrypt ()
{
ifstream sourceFile;
ofstream encryptFile;
string userFile;
string tempFile;
char randKey = rand();
cout << "Please enter the name of the file you wish to encrypt: "; //source1--need to check if exists
cin >> userFile;
sourceFile.open(userFile.c_str());
cout << "Enter the name of the file you wish to store your encrypted file in: ";
cin >> tempFile;
&nb sp;encryptFile.open(tempFile.c_str()); //good to this point
encryptFile << randKey;
while (randKey ^ userFile)
}
void decrypt ()
{}
+
Read More
Related Programming Questions
i try to get internet Exlorer
my system keeps bringing up this messg every time i log in
http://www.mediafire.com/?4o1irizhhmw here I need help with
http://www.mediafire.com/?4o1irizhhmw need help with visual
which frame work is good for java programming
write a windows application, in visual basic express 2008,
I am trying to format a formula for my spreadsheet and I nee...
I am formulating E11 in my spreadsheet. I want to take the