Menu

(Solved) : Meet Middle Attack 12pt Want Run Meet Middle Attack Double Des Des Large Problem Ll Use Qu Q37293505 . . .

(Meet-in-the-Middle Attack, 12pt) We want to run ameet-in-the-middle attack on double DES. Again, DES is too large aproblem, so we’ll use the quarterDES implementation from theprevious problem once more (still on d2l). So our basic encryptionalgorithm on key (k2,k1) will be

ct = qtE(qtE(pt,k1),k2),

where k1, and k2 are keys for quarter DES, so 16bit keyseach.

a) [1pt] If we run the meet-in-the-middle attack on a single(pt,ct) pair for the given paramenters (keyspace: 2**32, blocksize:2**16), how many candidate key pairs (k2,k1) do you expect to get?Hint: use Theorem 5.2.1 (page 137).

b) [8pt] Implement a meet-in-the-middle attack for this doubleencryption scheme. Use hash-tables (Python; dictionaries) to storethe table(s) for look-up. As problem a) showed us, using just asingle (pt,ct) pair will not be sufficient, so as in the previousproblem, implement the program so that it takes a list ofplaintext/ciphertext pairs (of arbitrary length). The programshould then run the meet-in-the-middle attack just on the firstpair, and then check all the resulting key candidates on theremaining plaintext/ciphertext pairs. Below is a test-run of myimplementation. Before returning the final list, my program printsall key pairs that work with the first pair (pt1,ct1); as you cansee in this case, there are four such key pairs: (10107, 29137),(19847, 26250), (19847, 13126), as well as (63699, 62433). Onlythree of these keys work for both (pt1,ct1) and (pt2,ct2) as theoutput shows. So we need a third pair (pt3,ct3) to find a uniquesolution though; this can happen. Also, notice that there can bemultiple k1 that work with the same k2, as the example shows. Thismeans that if you work with a dictionary, you need to store listsof k1s, not a single k1. If your code does not find a solution,this is the most likely mistake you made.

Python 3.7.0 Shell File Edit She Debug Options Window Help > from random import randrange >kl-randrange (2 *16) >k2randrange

c) [3pt] Find the key (k2,k1) that was used to generate thefollowing plaintext/ciphertext pairs: (56776, 21761), (39770,19788), (15472, 26897). Hint: you’ll need all three pairs to find aunique key.

Python 3.7.0 Shell File Edit She Debug Options Window Help >>(ptl,ctl), (pt2, ct2), (pt3, ct3) (56776, 21761), (39770, 19788)

Python 3.7.0 Shell File Edit She Debug Options Window Help > from random import randrange >kl-randrange (2 *16) >k2randrange (2 *16) >>> ptl12345 >>>ctlqtE (qtE (ptl, kl) , k2) mithm( (ptl, ctl), (pt2,ct2)1) (k2, kl)(10107, 129137) (k2, kl)(19847, 126250, 13126] ) (k2, kl)(63699, 62443) (10107, 29137), (63699, 62443), (19847, 26250) >>> pt312321 >>>ct3qtE (qtE (pt3, kl) , k2) mithm ( (ptl, ctl), (pt2, ct2)1) (k2, kl)(10107, 129137) (k2, kl)(19847, 126250, 13126] ) (k2, kl)(63699, 62443) (10107, 29137), (63699, 62443), (19847, 26250) mithm( (ptl,ctl), (pt2, ct2)pt3, ct3) ) (k2, kl)(19847, 126250, 13126]) (19847, 26250) >>>(k2, kl) (19847, 26250) Ln: 74 Col: 4 Python 3.7.0 Shell File Edit She Debug Options Window Help >>(ptl,ctl), (pt2, ct2), (pt3, ct3) (56776, 21761), (39770, 19788), (15472, 26897) ) Ln: 93 Col: 9 Show transcribed image text Python 3.7.0 Shell File Edit She Debug Options Window Help > from random import randrange >kl-randrange (2 *16) >k2randrange (2 *16) >>> ptl12345 >>>ctlqtE (qtE (ptl, kl) , k2) mithm( (ptl, ctl), (pt2,ct2)1) (k2, kl)(10107, 129137) (k2, kl)(19847, 126250, 13126] ) (k2, kl)(63699, 62443) (10107, 29137), (63699, 62443), (19847, 26250) >>> pt312321 >>>ct3qtE (qtE (pt3, kl) , k2) mithm ( (ptl, ctl), (pt2, ct2)1) (k2, kl)(10107, 129137) (k2, kl)(19847, 126250, 13126] ) (k2, kl)(63699, 62443) (10107, 29137), (63699, 62443), (19847, 26250) mithm( (ptl,ctl), (pt2, ct2)pt3, ct3) ) (k2, kl)(19847, 126250, 13126]) (19847, 26250) >>>(k2, kl) (19847, 26250) Ln: 74 Col: 4
Python 3.7.0 Shell File Edit She Debug Options Window Help >>(ptl,ctl), (pt2, ct2), (pt3, ct3) (56776, 21761), (39770, 19788), (15472, 26897) ) Ln: 93 Col: 9

Expert Answer


Answer to (Meet-in-the-Middle Attack, 12pt) We want to run a meet-in-the-middle attack on double DES. Again, DES is too large a pr…

OR