Question: Please help with the following C programs: Develop a program in C AES256_CBC_Enc.c and AES256_CBC_Dec.c that use the CBC mode 256-bit AES cipher in OpenSSL

Please help with the following C programs:

Develop a program in C AES256_CBC_Enc.c and AES256_CBC_Dec.c that use the CBC mode 256-bit AES cipher in OpenSSL to encrypt or decrypt a given file (of arbitrary length) into another encrypted or the decrypted file with any given encryption key and IV. Specifically, the programs need to support the following commands line arguments and usage: AES256_CBC_Enc k -v -i -o AES256_CBC_Dec k -v -i -o

where contains the 32-byte encryption key in hex format; contains the 16byte IV in hex format; is the name of the input file (e.g., plaintext); is the name of the output file (e.g., cipher text). Note: and are text files, could be either text or binary file; is a binary file

The programs need to do basic sanity check on , , and gracefully exit when any illegitimate file is found (e.g., the does not contain 32 bytes in hex).

The plaintext.txt file should content:

AAAAAAAAAAAAAAAABBBBBBBBBBBBBDDDDDDDDEEEEEEEEEEEEEECCCCCCCCCCCCCCCC

The aes256key.txt file should content the key:

0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20 

The aesIV.txt file should content the key:

d9000a0800ac3b75111d393ad246ff95 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!