+ All Categories
Home > Documents > Assignment 3n4

Assignment 3n4

Date post: 16-Dec-2015
Category:
Upload: nishitgarg
View: 4 times
Download: 0 times
Share this document with a friend
Description:
Data security assignment
Popular Tags:
21
Data Security and Cryptography 06-88-566 ASSIGNMENT 3 and 4 By - Name: Nishit Garg Student Id:
Transcript

Data Security and Cryptography06-88-566

ASSIGNMENT 3 and 4

By - Name: Nishit Garg Student Id:

Problem 1

Consider the following hash function that takes an input x of arbitrary size and produces a 128-bit output h(x): Let x be a binary number. Then h(x) = 2127+ (x mod 2127). Check whether or not h(x) satisfies the three properties for a good hash function

Solution:

Easy to compute:- Given message m, hash function h(m) is easy to compute.-Hash function h(x) is easy to compute and is done quickly, so the first property is satisfied One-way function y=h(x): - Here if input x would be having less than 128 bits than h(x)=2127 + x or x=h(x)-2127 so here the input can be easily recovered. -Therefore one way function is not satisfied

Collision-free: - Strong version - It is very hard to find messages m1 and m2 with h(m1)=h(m2).-Weak version - Given m1 and h(m1), it is very hard find m2 m1 with h(m2)= h(m1).-For the collision free property to be satisfied the output should be different but here x+2127 have the same output, so the last property is also not satisfied.

Problem2 There are 39 students registered in the class of 0688566: Data Security and Cryptography, Fall 2014. Suppose Student A is registered in this class. (i) What is the probability that at least one other student in the class shares the same birthday with Student A? (ii) What is the probability that at least two students in the class share the same birthday? Show the formulae and give the result.

Solution:

Problem3

Bob setup an RSA system by choosing p=31, q=37, and n=1147. Bob selects the public key as e=7. (i) Solve Bobs private key d (10 marks) (ii) Bob wants to put digital signature on the document m=1000 with message digest h(m)=495. Give the steps for signing phase and solve y

Solution:

Problem4

In the Diffie-Hellman key exchange protocol, Alice and Bob choose a finite field GF(p), where p=1571, and an element that is the smallest primitive element in the field. (i). Find the smallest primitive element in GF(1571); (ii). Suppose that Alice selected random number x=17 and Bob selected y=26. What is their shared key?

Solution:

-With the help of computer program the Primitive element in GF(1571) is 2. -Following are few intermediated results, I have not shown all as they were long enough to show

2 ^ 1 mod 1571 = 22 ^ 2 mod 1571 = 42 ^ 3 mod 1571 = 82 ^ 4 mod 1571 = 162 ^ 5 mod 1571 = 32.2 ^ 100 mod 1571 = 9452 ^ 200 mod 1571 = 6972 ^ 300 mod 1571 = 4162 ^ 400 mod 1571 = 3702 ^ 500 mod 1571 = 8882 ^ 600 mod 1571 = 2462 ^ 700 mod 1571 = 15332 ^ 800 mod 1571 = 2232 ^ 900 mod 1571 = 2212 ^ 1000 mod 1571 = 14732 ^ 1100 mod 1571 = 792 ^ 1200 mod 1571 = 8182 ^ 1300 mod 1571 = 782 ^ 1400 mod 1571 = 14442 ^ 1500 mod 1571 = 952..2 ^ 1567 mod 1571 = 9822 ^ 1568 mod 1571 = 3932 ^ 1569 mod 1571 = 7862 is primitivei) = 2Alice x=17 x mod p = 217 mod 1571 = 131072 mod 1571 =679 Alice sends this x i.e. 679 to bob. Upon receiving y i.e. 457 from bob, Alice calculates xy xy mod p = 45717 mod 1571 = 144Bob y=26y mod p = 226 mod 1571 = 67102264 mod 1571 = 457 Bob sends y i.e. 457 to Alice. Upon receiving x i.e. 679 from Alice, bob calculates xyxy mod p = 67926 mod 1571= 144

Therefore, Alice and Bob have their shared key 144.

Problem5

In the Diffie-Hellman key exchange protocol, Alice and Bob choose a finite field GF(211), where the irreducible polynomial is f(x) = x11 + x2 +1. Alice and Bob also choose a field element = x. (i). What is the order of ? (ii). Suppose that Alice selected random number x=15 and Bob selected y=17. What is their shared key?

Solution

It is observed that there doesnt exist a number i between 1 to 10000 such that xi mod f(x) be 1. This was observed from a computer program So has an infinite order.

i) The values are calculated from computer program in JavaAlice Random number x=15 x mod p = X15 mod f(x) = X6 + X4 Alice sends this x i.e. X6 + X4 to bob. Upon receiving y i.e. X8 + X6 from bob, Alice calculates xy xy mod p = (X8 + X6 )15mod f(x) = 3277642 x10 -1537734 x9+ 4459522 x8 + 4459522 x8-1393271 x7 + 5203478 x6-1908379 x5+ 5217873 x4-3259147 x3+ 4538131 x2-2076625 x1 + 2027036Bob Random number y=17 y mod p = X17 mod f(x) = X8 + X6 Bob sends y i.e. X8 + X6 to Alice. Upon receiving x i.e. X6 + X4 from Alice, bob calculates xy xy mod p = (X6 + X4 )17 mod f(x)= 3277642 x10 -1537734 x9+ 4459522 x8 + 4459522 x8-1393271 x7 + 5203478 x6-1908379 x5+ 5217873 x4-3259147 x3+ 4538131 x2-2076625 x1 + 2027036

So, Alice and Bob have their shared key 3277642 x10 -1537734 x9+ 4459522 x8 + 4459522 x8-1393271 x7 + 5203478 x6-1908379 x5+ 5217873 x4-3259147 x3+ 4538131 x2-2076625 x1 + 2027036

Problem6

As shown in Fig (b), Page 12, Lecture notes on Chapter 9, assume that User B has an RSA system with (e,n) as public key and (p,q,d) as private key. Following the style at Page 13, Lecture notes on Chapter 9, list the computation steps of Fig.(b). for Confidentiality only.

Solution:

Problem7

In ECDH (Elliptic Curve Diffie-Hellman) Key Exchange scheme, an elliptic curve E over GF(23) is given as follows: 2=3+9x+17 Let P = (1, 2) be a point on E. Suppose that Alice selected random number a = 3 and Bob selected b = 5. List the computation steps by Alice and Bob. What is their shared key (another point on the curve)?

Solution:


Recommended