Assignment 4
Due on 28/03/2023
Problem(s)
Part-1:
- Write a menu-driven program to encrypt/decrypt byte-string data with the following options:
- User should be able to choose any of the following six algorithms:
- Caesar Cipher
- Vegenare Cipher (for alphanumeric data)
- Vernam Cipher (using XOR)
- One Time Pad (OTP) (using LCG for appropriate case)
- XOR with ECB-mode (with appropriate padding)
- XOR with CBC-mode (with appropriate padding)
- Accept/generate the appropriate Key as per the selected algorithm
- Do proper error handling as well. (e.g., for incorrect key length)
- Main-Menu must include the following options:
- Encrypt Message
- Decrypt Message
- Quit
Part-2:
- Write a menu-driven program with the following additional features along with the features provided in previous questions:
- The program should also be able to encrypt/decrypt the data-files. (e.g., for a given
message.txt
, you could get the correspondingsecret.enc
as the encrypted file, and vice-versa)- The program must take the file name of the encrypted/decrypted file as input before saving
- Encrypted data-file must have the extension
.enc
(e.g.,encrypted.enc
)- Main-Menu must include the following options:
- Encrypt Message
- Encrypt File
- Decrypt Message
- Decrypt File
- Quit
- Program MUST offer all the utilities as given in Part-1 of this assignment
* Remember, the user may not input the byte string, so you must do proper encoding to get the byte-string from the input.