Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This task is mainly designed for graduate students. Undergraduate students can do this task for extra credit. So far, we have learned how to
This task is mainly designed for graduate students. Undergraduate students can do this task for extra credit. So far, we have learned how to use the tools provided by openssl to encrypt and decrypt messages. In this task, we will learn how to use openssl's crypto library to encrypt/decrypt messages in programs. In this task, you are given a plaintext and a ciphertext, and your job is to find the key that is used for the encryption. You do know the following facts: The aes-128-cbc cipher is used for the encryption. The key used to encrypt this plaintext is an English word shorter than 16 characters; the word can be found from a typical English dictionary. Since the word has less than 16 characters (i.e. 128 bits), pound signs (#: hexadecimal value is 0x23) are appended to the end of the word to form a key of 128 bits. Your goal is to write a program to find out the encryption key. You can download an English word list from the Internet or you can download it form course Blackboard (words.txt). The plaintext, ciphertext, and IV are listed in the following: Plaintext (total 21 characters): This is not a secret. Ciphertext (in hex format): 32c956ba071e4fffbad37c2bb5b1a2e1 585fbfcf649d88a9777b9ecd44639898 010203040506070809000a0b0c0d0e0f IV (in hex format): You need to pay attention to the following issues: If you choose to store the plaintext message in a file, and feed the file to your program, you need to check whether the file length is 21. If you type the message in a text editor, you need to be aware that some editors may add a special character to the end of the file. The easiest way to store the message in a file is to use the following command (the -n flag tells echo not to add a trailing newline): $ echo -n "This is a top secret." > file In this task, you are supposed to write your own program to invoke the crypto library. No credit will be given if you simply use the openssl commands to do this task. Sample code can be found from the following URL: OpenSSL: EVP Encrypt Int When you compile your code using gcc, do not forget to include the -1crypto flag, because your code needs the crypto library. See the following example:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started