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
- can somenone explain the three main ways that eating is influenced by learning .. give at least 2 examples how these princeples hold true in ur own life
- n your reading this week, you looked at reliability, safety, security, and resilience engineering. Review your reading on SQUARE before posting this week. Read
- Please explain why advertisers use different types of fallacies.