CSSE/MA479: Cryptography

Homework 4, due on the date listed on the schedule page


Sample run for debugging purposes, courtesy of Dr. Rickert

Message: 0101010101010101010101010101010101010101010101010101010101010101
IP Message: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
L0: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
R0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
expanded R: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
E(R)+K: 1 1 0 0 1 1 0 1 1 0 0 0 1 0 0 1 0 1 1 0 1 0 1 0 0 0 0 1 1 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 1 0 0 1
pref: 1 0 1 1 1 1 0 0 1 1 0 1 1 0 1 1 1 1 0 0 1 0 0 0 1 1 0 0 0 1 0 0
f(R,K) = 1 0 0 1 0 1 0 1 1 1 0 1 1 1 0 1 0 0 0 0 0 0 1 1 0 1 1 1 0 0 1 1
L[1]=0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
R[1]: 0 1 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 1 1 1 1 1 0 0 1 0 0 0 1 1 0 0
expanded R: 0 0 1 1 0 1 0 1 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 1 1 1 1 1 1 1 1 0 0 1 0 1 0 0 0 1 0 1 1 0 0 0
E(R)+K: 1 0 1 0 0 1 1 0 1 1 0 0 0 0 1 0 1 1 1 1 1 1 1 1 0 1 0 0 1 1 1 1 1 1 0 1 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