Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 4 - Encryption Develop a program, called AESEncrypt, that performs AES encryption. The program should take three command-line arguments. The first argument is the

image text in transcribed

Question 4 - Encryption Develop a program, called AESEncrypt, that performs AES encryption. The program should take three command-line arguments. The first argument is the encryption key. The second argument is the data to be encrypted. The third argument, which is optional, is file name to store the encrypted result; if it is not specified, the filename is EncryptedData.dat. For the encryption, the program computes the MD5 message digest of the encryption key (i.e. the first command-line argument) and uses the digest as the key for AES operations. This is because AES keys must be 128, 192, or 256 bits in length, and MD5 digests are 128 bits in length. To perform encryption, the program encrypts the data using AES, and then save the encrypted data to the output file. (Hint: Create a SecretKeySpec object of the AES algorithm as the AES key.) These are sample outputs of running the program. > java AESEncrypt Usage: java AESEncrypt key data (outputFile] > java AESEncrypt pass COMPS311 Encrypted data has been saved to EncryptedData.dat > java AESEncrypt pass COMPS311 Output.dat Encrypted data has been saved to Output.dat

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

More Books

Students also viewed these Databases questions

Question

What are the different techniques used in decision making?

Answered: 1 week ago