Question
In this project, we will develop a C++ program that performs an attack on 1 round of TEA. In 1 round of TEA the key
In this project, we will develop a C++ program that performs an attack on 1 round of TEA. In 1 round of TEA the key size is effectively reduced to 64 bits, because only half of the 128 bit key is used in 1 round of TEA.
Using known plaintexts and their resulting ciphertexts, we will perform a brute force attack on the 64-bit key by repeatedly guessing 32 bits of the key, which will eventually lead us to deduce the other 32 bits.
We only need to search through 232 possible keys, since given a subkey K0, we can calculate a value for the other subkey K1 by using known plaintext/ciphertex pairs (i.e., derive an equation for K1 in terms of K0 and a pair of plaintext/ciphertext).
In this project, first implement the TEA encryption method and then generate 100 random plaintexts and their corresponding ciphertexts using 1 round of TEA encryption (see Figure below). That is, each plaintext is and its corresponding ciphertext is simply . Output the plaintext/ciphertext pairs to a file.
The following steps/pseudocode outline the general procedure of the attack program. 1. Read in the file with the plaintext/ciphertext pairs into lists. These values are then converted from strings in the file to 32 bit unsigned integers. 2. Guess a value for subkey K0, starting at 0. 3. Calculate the value for K1 using our guess K0 and the first plaintext/ciphertext pair. 4. Calculate the value for K1 using our guess K0 and the second plaintext/ciphertext pair. 5. Do those two values of K1 match? 6. If not, this is the incorrect guess for K0. Increment our guess and go back to Step 3. 6. If yes, we need to verify that this guess for subkey K0 is correct 7. Repeat steps 3 and 4 ten times with different plaintext/ciphertext pairs 8. If the values of K1 did not match every time, increment our guess for K0 and go back to Step 3. 9. If the values of K1 matched every time, this is the correct guess for K0 and weve found the key!! Print the key and the run time of your project.
Read the file with the plaintext/ciphertext pairs into lists. These values are then converted Konn Strings in the file to 32 bit unsigned integers. 2 Guess a value for subkey Ko, starting at 0. B Calentate the value for K, using our guess Ko and the first plaintext/ciphertext pair. Collate the value for K, using our guess Ko and the second plaintext/ciphertext pair. 5. Do those two values of K, match? 6. not. this is the incorrect guess for Ko Increment our guess and go back to Step 3. 6. If yes, we need to verify that this guess for subkey Ko is correct 7. Repeat steps 3 and 4 ten times with different plaintext/ciphertext pairs 8. If the values of K, did not match every time, increment our guess for Ko and go back to Step 3. 9. If the values of Ki matched every time, this is the correct guess for Ko and we've found the key!! Print the key and the run time of your project. Read the file with the plaintext/ciphertext pairs into lists. These values are then converted Konn Strings in the file to 32 bit unsigned integers. 2 Guess a value for subkey Ko, starting at 0. B Calentate the value for K, using our guess Ko and the first plaintext/ciphertext pair. Collate the value for K, using our guess Ko and the second plaintext/ciphertext pair. 5. Do those two values of K, match? 6. not. this is the incorrect guess for Ko Increment our guess and go back to Step 3. 6. If yes, we need to verify that this guess for subkey Ko is correct 7. Repeat steps 3 and 4 ten times with different plaintext/ciphertext pairs 8. If the values of K, did not match every time, increment our guess for Ko and go back to Step 3. 9. If the values of Ki matched every time, this is the correct guess for Ko and we've found the key!! Print the key and the run time of your projectStep 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