Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I attached two txt files contains pairs of plaintext and corresponding ciphertext. For instance, each row in the txt file has four numbers, separated by

I attached two txt files contains pairs of plaintext and corresponding ciphertext. For instance, each row in the txt file has four numbers, separated by \tab:

29891 13620 13620 2653495094

where the first two ints (total 32+32 = 64 bits) represent plaintext and the last two ints are corresponding ciphertext. The run1 txt file is generated with one key and the run2 txt file is with a different key. This assignment tells us that if an attacker collects a few pairs of plaintext and corresponding ciphertext, attacker can quickly find the key used by doing cryptoanalysis.

Have fun cracking the code.

29891 13620 13620 2653495094 786 23958 23958 2653905670 27809 25326 25326 2653924248 22573 26797 26797 2653951041 15464 28601 28601 2653717360 20398 29127 29127 2653714071 30341 21598 21598 2653899607 12039 22812 22812 2653864241 10402 7409 7409 2653634460 29395 1646 1646 2654350374 17098 17246 17246 2653526564 3863 14396 14396 2653484298 31182 6213 6213 2653634905 1224 21305 21305 2653827252 10472 11784 11784 2653437374 28814 17916 17916 2653551803 30367 31266 31266 2653747756 30408 21753 21753 2653897834 16618 8378 8378 2653652859 12496 25264 25264 2653901547 5272 7799 7799 2653631820 32640 2084 2084 2654360923 13295 17559 17559 2653543314 26357 4495 4495 2653595544 28820 15163 15163 2653504414 22418 13140 13140 2653463346 23723 32261 32261 2653789636 2120 2869 2869 2654333496 5950 1765 1765 2654320572 17941 16838 16838 2653535675 14307 6960 6960 2653628586 23755 24609 24609 2653907831 7577 28403 28403 2653710341 32019 11740 11740 2653464287 9460 4742 4742 2653592416 17329 11064 11064 2653684880 2426 24164 24164 2653908163 17930 31643 31643 2653741241 30284 20793 20793 2653848648 18403 21569 21569 2653888850 2569 5181 5181 2653594921 32363 17198 17198 2653542932 20975 6593 6593 2653629986 1148 25191 25191 2653891648 67 2567 2567 2654335530 25630 19297 19297 2653557732 25075 29271 29271 2653715048 22861 24250 24250 2653929422 22395 27215 27215 2653939752 12796 13351 13351 2653481618 21765 9083 9083 2653670029 28505 18094 18094 2653580910 11732 5926 5926 2653610629 3155 12565 12565 2653451476 12002 18031 18031 2653563470 3417 3738 3738 2653569145 19656 16543 16543 2653532435 15717 21476 21476 2653887642 26847 25529 25529 2653920455 15418 13370 13370 2653484591 29093 2899 2899 2654360726 16874 26355 26355 2653947030 25186 8613 8613 2653665526 15258 24877 24877 2653902914 26123 18144 18144 2653571284 9609 22466 22466 2653889371 8550 705 705 2654315489 17999 7544 7544 2653644284 26735 13413 13413 2653495225 12131 12664 12664 2653459120 25339 13407 13407 2653493992 9952 4610 4610 2653593612 25755 23816 23816 2653928441 24201 10078 10078 2653677315 31683 27926 27926 2653741747 7178 23318 23318 2653868106 31787 30832 30832 2653758744 13953 12130 12130 2653435768 2166 23361 23361 2653862429 3388 27364 27364 2653918377 24338 25419 25419 2653919179 23492 11413 11413 2653460513 28255 9087 9087 2653676707 3867 31744 31744 2653778617 29715 9674 9674 2653684813 67 10670 10670 2653679680 11229 28465 28465 2653714929 14335 5089 5089 2653607169 20808 2592 2592 2654357687 8158 9093 9093 2653656771 30947 2815 2815 2654363387 17524 5475 5475 2653604868 1183 17159 17159 2653511902 3307 25496 25496 2653897381 14200 5460 5460 2653601800 3003 25413 25413 2653897950 11351 8763 8763 2653658025 19637 27273 27273 2653940150 13367 15581 15581 2653513918 17478 4780 4780 2653598877
this is test.run1
 
 
30316 1889 1889 2661672034 29368 6461 6461 2661617504 25215 11513 11513 2661566473 1208 6699 6699 2661590778 32050 15784 15784 2661514501 1170 2085 2085 2661651738 24810 9933 9933 2661525271 13436 15772 15772 2661495476 23333 10624 10624 2661549017 5244 12429 12429 2661434575 26554 30920 30920 2663342532 22479 8790 8790 2661513479 29025 2062 2062 2661680007 18824 456 456 2661684826 31605 7634 7634 2661637133 25721 13181 13181 2661444275 6393 32413 32413 2663295020 8790 13419 13419 2661455174 21722 17463 17463 2661401280 17944 19130 19130 2661429857 28531 13593 13593 2661473950 9632 14547 14547 2661472855 5462 12325 12325 2661437086 13981 9914 9914 2661514694 29514 149 149 2661701029 25263 13725 13725 2661468442 19344 11826 11826 2661557005 26317 29101 29101 2663306289 28779 7622 7622 2661634327 16868 5676 5676 2661597367 18399 5587 5587 2661597358 30400 22471 22471 2661367603 15544 31621 31621 2663321259 9520 10535 10535 2661533646 16590 23526 23526 2661338925 15973 11715 11715 2661551972 17544 5457 5457 2661582077 22684 20216 20216 2661416229 18335 13609 13609 2661463483 26109 10075 10075 2661528152 26404 24010 24010 2661356852 21186 14414 14414 2661482274 3269 18624 18624 2661406647 20123 7633 7633 2661625668 9036 14648 14648 2661474507 17745 13467 13467 2661465298 29800 29363 29363 2663304814 19114 26218 26218 2663341345 5040 2050 2050 2661656266 32142 4247 4247 2661585011 31461 5742 5742 2661607448 9831 14573 14573 2661473637 15223 16695 16695 2661381701 5326 1211 1211 2661666044 26955 320 320 2661703041 99 9768 9768 2661511162 8892 7432 7432 2661611556 28924 13255 13255 2661477391 23008 23772 23772 2661349086 29187 7787 7787 2661636003 17164 20299 20299 2661411607 5401 14653 14653 2661470913 3226 12763 12763 2661427985 2047 2059 2059 2661653236 17385 20986 20986 2661333804 16823 18403 18403 2661424355 2982 31287 31287 2663304636 2790 26081 26081 2663329632 1866 16306 16306 2661475795 25981 22597 22597 2661361062 8164 17361 17361 2661385309 6040 3528 3528 2661681226 1561 15925 15925 2661469729 23975 26417 26417 2663345067 5481 25325 25325 2663353239 1995 28451 28451 2663354141 31924 30953 30953 2663347438 1667 17465 17465 2661381127 20476 13489 13489 2661467660 10887 26965 26965 2663385816 26476 11095 11095 2661543915 7156 28724 28724 2663289951 12185 29097 29097 2663292217 19626 12870 12870 2661442034 20233 15276 15276 2661477392 27122 3005 3005 2661694838 17650 4166 4166 2661571402 4453 19684 19684 2661392218 25923 25915 25915 2663351533 19721 21939 21939 2661307703 21992 14171 14171 2661462723 6844 4000 4000 2661678039 29002 29433 29433 2663297732 726 14775 14775 2661451624 12822 16542 16542 2661375752 522 15085 15085 2661454584 3136 2559 2559 2661662104 19085 28338 28338 2663377278 22343 19245 19245 2661433967 8314 8133 8133 2661494759
this is test2.run
image text in transcribed
image text in transcribed
image text in transcribed
tell me what is unclear on that
it is all complete questions sir i have posted everything is there in it
1. Purpose This homework builds an understanding of block ciphers and cryptanalytic attacks. 2. Description 2.1. TEA The Tiny Encryption Algorithm (TEA) block cipher operates on 64-bit blocks of plaintext using a 128-bit key. Each block of plaintext represented by two 32-bit integers (L. Ro), and the key is divided into four 32-bit subkeys, K., K. Ky, and K. Encryption involves repeated application of two Feistel rounds (making up one cycle of TEA), defined as follows for i-th round and (i+1)-th round: F function L RA L =R1 R = LBFR-. Ko, K. 8): LI =R R.1 = F(R., K , K , 8.1); where denotes modulus +. & is a sequence of predetermined constants, the F function is given by: L R F(X. K., K. 8) = {(X>5) K (X + 8). the logical left shift of x by y bits is denoted by sy, the logical right shift of x by y bits is denoted by * >> y, and denotes exclusive OR. While the figure above shows 2 rounds of TEA, the complete encryption has 64 rounds. 2.2. Attack Method In this project, we will develop a program that performs an attack on 1 round of TEA. In 1 round of TEA the key size is reduced to 64 bits, because only a 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 2" possible keys, since given a subkey Ko, we can calculate a value for the other subkey K, by deriving an equation for K in terms of K. and a pair of plaintext and corresponding ciphertext. We only need to search through 2 possible keys since given a subkey Ks we can calculate a value for the other subkey K, by deriving an equation for K; in terms of Ke and a pair of plaintext and corresponding ciphertext. There are two text files at isidore, cach containing a list of plaintext and corresponding ciphertext pairs. For instance, the first line in test_runl_messages.ext has: 29893 13620 13620 2653495094 where the first two integers, 29891 and 11630, denote plaintext and the other two integers, 130 and 2054495094, denote the corresponding ciphertent. As you can see for round of TEAL, 130) is simply the same as R. (1 830). As another example, the second line in this text file shows another pair of plaintext (736, 29958) and corresponding cipertext (23958 245906201 L 786 2395 239562053905670 All pairs in test_runluessages.txt are generated using one key. All pairs in test_run_essage.txt are created using another key The following steppseudocode outline the general procedure of the attack program 1. Read in the file with the plaintext/ciphertext pairs into your program. These values are then converted to be signed integers 2. Guess a value for subkey K. starting at 0. 3. Calculate the value for K using our guess Ko and the first plaintextcipertext pait. 4. Calculate the value for Ky using our guess Ke and the second plaintexulciphertest pait. 5. Do those two values of K1 match? 6. If not, this is the incorrect guess for K Increment our guess for Ka 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/cipertext pairs 8. If the values of K, did not match every time, inctement our guess for Ko and go back to Step 3. 9. If the values of K, matched every time, this is the comect goess for Kand we've found the key!! Print the key and the run time of your project. In steps 3 and 4, you must calculate K, using an equation in terms of K. and a pair of plaintext and corresponding ciphertext. This is so called cryptoanalysis For reference, the one round TEA encryption in C/C++ is given next: One round of TEN Input: V is a dynamic array of two unsigned ints: v[0] is our lo and v[1] is RO k is a dynamic array of two unsigned ints: k10 is our Ko and kill is our ki Output: after this method is called, V[0is our L1 and v[1] is our R1 void encrypt (unsigned int. v, unsigned int k) unsigned int y - V[0), 2 -v111; // vio) is our Lo and v11) is RO 30% deita, hasa wa TA al Porn y + ((: > 5) = k111) v101 - 2 [1] // vol is our L1 and v[1] is our R1 Note that it's critical that we use type "unsigned int" in the code above because TEA requires modulus addition, Recall that the modulus addition of two 32-bit integers, x and y, is given by: (x+y) mod N. where Nis 22 in TEA. By declaring integer variables as unsigned int, we naturally implement modulus addition of x and y: unsigned int *-- unsigned int y -- unsigned int sum * + y; // modulus addition of * and y Even if the sum of x and y is greater than or equal to 22 (i.c., integer overflow occurs), it is just fine because modulus addition wants the remainder anyway. 2.3. Submission Print two sample runs of the program

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

Students also viewed these Databases questions