Name:______________________________ Alpha:________________________________
|
|
enc_ecb to encrypt any message you want (under the
same unknown key that was used for getting C).
Sample runs:
>>> from hw10 import *
>>> enc_ecb(b"Hello")
'cdb8bb812f68fcd94e106ea62a08af8b'
>>> enc_ecb(b"Zello")
'edc504c067e3a5492c63a268ddf24c11'
Note: Don't care about how enc_ecb is implemented. Just do the function
calls. Moreover, the code works only when you are on the yard.
Question: Which message does C encrypt? Describe how figured out the answer.

M1: 556e6465727374616e64696e6720686f M2: 772074686520434243206d6f64652077 M3: 6f726b730c0c0c0c0c0c0c0c0c0c0c0cIV is given as follows:
IV: 90c371a51f8357554e60fdcf6c4cf621You are given the block cipher Fk (with unknown key). Use the function as follows:
>>> from hw10 import *
>>> Fk("abcde71a51f8357554e60fdcf6c4cf62")
'b06dbee2fcee567914c3435e501b4e53'
That is, the input the function Fk should be a single block (i.e., 16 bytes = 32 hex letters).
Follow each step of the CBC mode given the message, IV, Fk as above. Fill in the black; for each object, just give the first 6 hex letters instead of the full 32 letters.
M1 xor C0: C1: M2 xor C1: acaae22c258813dbcc492a5ead368da0 C2: M3 xor C2: C3: 93225ab8a838fe8db64b780dae3712ef