Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Develop a program in C DES_ECB_Enc.c and DES_ECB_Dec.c that use the ECB mode DES cipher in OpenSSL to encrypt or decrypt a given file (of

Develop a program in C DES_ECB_Enc.c and DES_ECB_Dec.c that use the ECB mode DES 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 with support of the following Command:

DES_ECB_Enc k -i -o DES_ECB_Dec k -i -o

where contains the 32-byte encryption key in hex format; contains the 8-byte IV in hex format; is the name of the input file (e.g., plaintext or cipertext); is the name of the output file (e.g., cipher text or plaintext). 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 8 bytes in hex).

The initial plaintext file "plain.txt" should content:

AAAAAAAAAAAAAABBBBBBBBBBBBBBBDDDDDDDDDDDDDDCCCCCCCCCCCCCFFFFFFFFFFFFF

keyfile.txt should content:

0f1571c947d9e859 

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

More Books

Students also viewed these Databases questions