Question: 4 . [ 5 points ] Implementation of Known - Plaintext Cryptanalysis of LFSR Cipher Implement the following function: RecoverKey ( m , c ,
points Implementation of KnownPlaintext Cryptanalysis of LFSR Cipher
Implement the following function:
RecoverKeym c t which recovers the key k d from a known plaintextciphertext pair m c where the underlying keystream is generated by a recurrence of degree t
I have implemented the LFSR cipher and chosen a secret key. Using your implementation of RecoverKey, use the plaintext and ciphertext provided on Canvas to launch a knownplaintext attack to recover my secret key. The underlying keystream is generated by a recurrence of degree t
Hint: The method that I showed in class involves solving a system of linear equations mod If you are using Python, I have provided a short script that will construct the inverse of a matrix mod which you can use as a subroutine in your solution. My code requires the Numpy package points Implementation and Analysis of LFSR Keystream Generation.
Implement these functions:
a KeystreamGenk d n which generates the first
n characters
z
z
z
n
of the LFSR keystream defined by the key
kd
b FindPeriodk d which determines the period of the LFSR keystream defined by the key
kd
c ComputeProbt which computes the probability that a randomlychosen LFSR keystream defined by a recurrence of degree
t has order as large as possible.
Hint:
i I don't care if your implementation is efficient. ii A recurrence of degree
t is defined by two parameters: the initial conditions
in
k in Z
t
and the coefficient vector
in
d in Z
t
which satisfies
d
Using these tools:
a Determine the period of LFSR keystream arising from the following keys
kd:
i
k
d
ii
k
d
iii.
k
d
b Compute the probability that a randomlychosen key
kd which defines a recurrence of degree
t so
in
kd in Z
t
and
d
yields a keystream of maximal order, for
t
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
