The objective of this lab is to explore the different modes of operation of block ciphers by implementing 5 of the modes.
Write a program that encrypts a given plaintext file with the given key. The program gets the name of the file that contains the key, name of the file that contains the plaintext, and a prefix for the names of the file containing the ciphertexts from the command line. The program will encrypt the plaintext file in the 5 modes below using 128-bit AES and produce a file for each mode below.
4. CFB (128-bit)
5. CTR (counter starts with 0)
After producing the 5 ciphertext files, the program will decrypt these files and store the decrypted texts in 5 separate files. NoteCBC,OFB, and CFB modes require an initialization vector (IV). Use the SecureRandom class in Java to generate the IVs. Note that you need to keep these IVs for decryptions in modes CBC, CFB, and OFB.
So, if the program is run by
encrypt key.txt plain.txt cipher
then the program will produce 10 files :
Note that at the end of a successful run, the files cipherECBdec.txt, cipherCBCdec.txt, cipherOFBdec.txt, cipherCFBdec.txt, cipherCTRdec.txt will all contain the same data which will be the pliantext that you started with. The plaintext will be given in hexadecimal one block per line. You can assume that each line will have 32 hex digits (hence you will NOT need to do any padding.)
Plain text file:
Recently Asked Questions
- What would you do if an employer asked you an interview question that you knew was illegal? Why? What would you do if your employer asked you to ask job
- Please refer to the attachment to answer this question. This question was created from BSBMGT502_Assessment Task 1_V 2.0.docx.
- How would the routing protocols discussed help in the monitoring of passing traffic over the corporate network and the Internet under safe and secure