The caeser cipher, which shifts all letters by a certain amount, is easy to decipher. Try this, instead of numbers use letters. Consider this, the word is FEATHER. Remove duplicate letters, making FEATHR, and append the rest of the letters of the alphabet in reverse order.
Now encrypt the letters as follows:
Now, write a program that encrypts or decrypts a file using this cipher.
crypt -d -kFEATHER encrypt.txt output.txt
decrypts a file using the keyword FEATHER. You must always supply a keyword.
This is what I have so far:
using namespace std;
string rem_Duplicate(string str1)
for (int i = 0; i < str1.length(); i++)
if ((pos = str2.find(str1[i])) < 0)
str2 += str1[i];
cout << str2 << endl;
string key = FEATHER;
cout << "Enter the Key: ";
cin >> key;
key = rem_Duplicate(key);
Thank you for your time.© BrainMass Inc. brainmass.com October 25, 2018, 10:04 am ad1c9bdddf
Please find attached 597359.zip that contains following files:
Code was tested using g++ compiler version ...
Solution checks for validity of the arguments provided at the command line. It transforms only the alphabets in the input file while retaining their (upper/lower) case.