Solved–Cryptography Homework 2 –Solution

$30.00 $19.00

Notes: If you used Python codes for questions, compress them along with an answer sheet (a docx or pdf file). Name your winzip file as “SEC501_hw02_yourname.zip” Attached are “myntl.py”, “lfsr.py”, and “bonus_helper.py” that you can use for the homework questions. (20 pts) Consider the group 61∗. (10 pts) How many generators are there in 61∗?…

You’ll get a: . zip file solution

 

 

Description

5/5 – (2 votes)

Notes:

      • If you used Python codes for questions, compress them along with an answer sheet (a docx or pdf file).

      • Name your winzip file as “SEC501_hw02_yourname.zip”

      • Attached are “myntl.py”, “lfsr.py”, and “bonus_helper.py” that you can use for the homework questions.

  1. (20 pts) Consider the group 61.

    1. (10 pts) How many generators are there in 61? Find at least two generators in

61.

    1. (10 pts) Find a subgroup of 61, whose order is 5. Find also its generator.

  1. (20 pts) Consider the following numbers:

p = 55270647759499712767005464743937605691522560717814551125545722524770 78482817219303694924773296938028736900310336193124455858291501008953 781025760084204617

q = 10263715010889663011237581846368625560721472564413404816414563312121 71111120051206233813363043069801795366050977250374952685582134755611 4413740814256720609

n=p×q

c= c: 60164473275655195941140006810881190272518274261785252829234105393534 02986195693266732998286093991346837854685945523958512316911535914428 13159056076533141551359295712036116216716322335464389581855416945959 23609481530537586019781395043766886192299548065151138697610290375491 95053798048200751500102605855423415

e = 67

Compute m = cd mod n (where d = e-1 mod (n)).

Fall 2019

CS 411-507 Cryptography

  1. (30 pts) Solve the following equations of the form ax b mod n and find all solutions for x if a solution exists. In case there is no solution, your answer must be “NO SOLUTION”, and explain why there is no solution.

    1. n = 333837116253674643166082492900 a = 57063337401967433471889139534 b = 397555361861029295385484594412

    1. n = 333837116253674643166082492900 a = 176622984297114106732586191098 b = 84172329859897226978948124629

    1. n = 333837116253674643166082492900 a = 320736651991764172584335713727 b = 30472957776104045808802882504

  1. (15 pts) Consider the following binary connections polynomials for LFSR:

p1(x) = x5 + x2 + 1

p2(x) = x5 + x3 + x2 + 1

Do they generate maximum period sequences? (Hint: You can use the functions in lfsr.py)

  1. (15 pts) Consider a random number generator that generates the following sequences. Are they unpredictable? (Hint: You can use the functions in lfsr.py)

x1 = [1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0]

x2 = [0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

x3 = [1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1]

Bonus Question

Fall 2019

CS 411-507 Cryptography

  1. (20 pts) Consider the following ciphertext bit stream encrypted using a stream cipher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, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0]

Also, encrypted in the ciphertext you also know that there is a message to you from the instructor; and therefore the message starts with “Dear Student”. Find the plaintext. For this you need to find the connection polynomial of the LFSR first. Note that the ASCII encoding (seven bits for each ASCII character) is used.

(Hint: You can use the ASCII2bin(msg) and bin2ASCII(msg) functions (in bonus_helper.py) to make conversion between ASCII and binary)

Fall 2019