Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need help with how to program a weak encryption in c++... I have no idea where

ID: 3620963 • Letter: I

Question

I need help with how to program a weak encryption in c++... I have no idea where to even start. Someone that has done encryption in c++ may be able to help me with this... Below is the assignment description. I have completed everything except the encryption part of it which is in the very bottom paragraph. I inserted the whole assignment description just in case you needed more information. Remember, I will give credit to anyone that can explain a little to me and get me on the correct path. Thanks in advance for any help given here...

A file filter is a program that reads an input file, transforms it, and writes
the results to an output file.
Write an abstract base class called FileFilter. It should contain:
the member function: void filter(ifstream&,ofstream&);
the pure virtual function: char transform(char)
Derive a class from FileFilter that transforms an input text file to all caps.


//This is where I need HELP
Derive a class from FileFilter to performs character by character encryption
of a file. The Constructor for this class should accept a small integer to use as
the encryption key.
//What does all this stuff mean below
Weak encryption can be easily performed using the exclusive-or operator (^).
c' = key ^ c
c = key ^ c'
This is a symmetric operator, meaning the encryption and decryption is done
in the same way. In other words, encrypting the encrypted file produces the
original unencrypted file.

Explanation / Answer

Nevermind, I figured it out. It is basically set up like this... //member function of a class EncryptFilter //memberKey is a member variable of class EncryptFilter char Encrypt (char ch) { memberKey = ch ^ memberKey; return memberKey; }

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote