Question: generatePad ( seed , k , l ) returns a pseudo - random list of 1 s and 0 s , generated by an [
generatePadseed k l
returns a pseudorandom list of s and s generated by an LFSR where length of seed
parameters:
seed : list of s and s
k: int tap position
I : int, length of the sequence to be generated
return type: list of s and s
encrypt message seed, k
takes a string message and returns it as an encrypted string using an N k LFSR
parameters:
message : string of characters from Base set
seed : list of s and s
k : int, tap position
return type: string
heres hwo they should be tested: THE EXPECTED RESULT MUST MATCH THE RESULT
# test : generatePad
print
Testing generatePad with:"
printseed
printk
printlength
pad encryption.generatePad
printExpected:
printActual: pad
# test : encrypt
print
Testing encrypt
plain "IdLoveToStayHereAndBeNormalButItsJustSoOverrated"
encrypted encryption.encryptplain
decrypted encryption.encryptencrypted
printInput: decrypted
printExpected: FnbUBlBPGNMmsypLMADHzuvTjGkYDhGlMmAqX
printActual: encrypted
printDecrypted: decrypted,
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
