Here is the requirement for the lab :
Each there needs to be a method for
- obtaining the file name from the keyboard
- obtaining the mask
- writing a string to a file
- reading a string from a file
- encrypting a string
- decrypting a string
- printing a string
create and save a file (randomCharacters.txt) that is a one line string made up of at least 50 characters: blanks, numbers (1 – 9), upper and lower case letters, and special characters. Your program is then read to the file, print the string, and modify the file input string so that each letter is encrypted. The encryption method that you are to use is to exclusively-or ( ^ ) each of the characters from the original string that was read from file randomCharacters.txt with an integer value (mask) that your program reads. You are then to write the newly encrypted string to a file (encrypted.txt), close the file, reopen and read in the encrypted string. Your program will decrypt the encrypted string by again exclusively-or ( ^ ) each of the encrypted characters with the mask that was read in earlier. You are to print both the encrypted and decrypted version of the string that came off of file encrypted.txt. Your program should be modularized with methods having at least one for:
--- Update ---
I figured it out thanks for the help!