Sunday, September 8, 2013

Basic key exchange (Week - 5) - Cryptography I

Score of 13.50 out of 15.00.

Question 1

Consider the toy key exchange protocol using an online trusted 3rd party (TTP). Suppose Alice, Bob, and Carol are three users of this system (among many others) and each have a secret key with the TTP denoted ka,kb,kc respectively. They wish to generate a group session key kABC that will be known to Alice, Bob, and Carol but unknown to an eavesdropper. How would you modify the protocol in the lecture to accomodate a group key exchange of this type? (note that all these protocols are insecure against active attacks)
Your Answer
Score Explanation
Alice contacts the TTP. TTP generates random kABC and sends to Alice
   E(ka,kABC),ticket1E(kb,kABC),ticket2E(kc,kABC).
Alice sends ticket1 to Bob and ticket2 to Carol.
Correct 1.00 The protocol works because it lets Alice, Bob, and Carol obtain kABC but an eaesdropper only sees encryptions of kABC under keys he does not have.
Alice contacts the TTP. TTP generates a random kABC and sends to Alice
   E(ka,kABC),ticket1kABC,ticket2kABC.
Alice sends ticket1 to Bob and ticket2 to Carol.



Alice contacts the TTP. TTP generates a random kAB and a random kAC. It sends to Alice
   E(ka,kAB),ticket1E(kb,kAB),ticket2E(kc,kAC).
Alice sends ticket1 to Bob and ticket2 to Carol.



Bob contacts the TTP. TTP generates a random kAB and a random kBC. It sends to Bob
   E(ka,kAB),ticket1E(ka,kAB),ticket2E(kc,kBC).
Bob sends ticket1 to Alice and ticket2 to Carol.



Total
1.00 / 1.00

Question 2

Let G be a finite cyclic group (e.g. G=Zp) with generator g. Suppose the Diffie-Hellman function DHg(gx,gy)=gxy is difficult to compute in G. Which of the following functions is also difficult to compute:

As usual, identify the f below for which the contra-positive holds: if f(,) is easy to compute then so is DHg(,). If you can show that then it will follow that if DHg is hard to compute in G then so must be f.

Your Answer
Score Explanation
f(gx,gy)=(g)x+y Correct 0.25 It is easy to compute f as f(gx,gy)=gxgy.
f(gx,gy)=gxy Inorrect 0.00 an algorithm for calculating f(gx,gy)=±gxy/2 can easily be converted into an algorithm for calculating DH(,). Therefore, if f were easy to compute then so would DH, contrading the assumption.
f(gx,gy)=gx+y Inorrect 0.00 It is easy to compute f as f(gx,gy)=gxgy.
f(gx,gy)=gxy+1 Correct 0.25 an algorithm for calculating f(gx,gy) can easily be converted into an algorithm for calculating DH(,). Therefore, if f were easy to compute then so would DH, contrading the assumption.
Total
0.50 / 1.00

Question 3

Suppose we modify the Diffie-Hellman protocol so that Alice operates as usual, namely chooses a random a in {1,,p1} and sends to Bob Aga. Bob, however, chooses a random b in {1,,p1} and sends to Alice Bg1/b. What shared secret can they generate and how would they do it?
Your Answer
Score Explanation
secret=ga/b. Alice computes the secret as Ba and Bob computes A1/b. Correct 1.00 This is correct since it is not difficult to see that both will obtain ga/b
secret=ga/b. Alice computes the secret as B1/a and Bob computes Ab.


secret=gab. Alice computes the secret as B1/a and Bob computes Ab.


secret=gb/a. Alice computes the secret as Ba and Bob computes A1/b.


Total
1.00 / 1.00

Question 4

Consider the toy key exchange protocol using public key encryption. Suppose that when sending his reply cE(pk,x) to Alice, Bob appends a MAC t:=S(x,c) to the ciphertext so that what is sent to Alice is the pair (c,t). Alice verifies the tag t and rejects the message from Bob if the tag does not verify. Will this additional step prevent the man in the middle attack described in the lecture?
Your Answer
Score Explanation
yes


no Correct 1.00 an active attacker can still decrypt E(pk,x) to recover x and then replace (c,t) by (c,t) where cE(pk,x) and tS(x,c).
it depends on what public key encryption system is used.


it depends on what MAC system is used.


Total
1.00 / 1.00

Question 5

The numbers 7 and 23 are relatively prime and therefore there must exist integers a and b such that 7a+23b=1. Find such a pair of integers (a,b) with the smallest possible a>0. Given this pair, can you determine the inverse of 7 in Z23?

Enter below comma separated values for a, b, and for 71 in Z23.

You entered:

Your Answer
Score Explanation

Incorrect 0.00
Total
0.00 / 1.00
Question Explanation 7×10+23×(3)=1. Therefore 7×10=1 in Z23 implying that 71=10 in Z23.

Question 6

Solve the equation 3x+2=7 in Z19.

You entered:

Your Answer
Score Explanation
x = 8 Correct 1.00
Total
1.00 / 1.00
Question Explanation x=(72)×31Z19

Question 7

How many elements are there in Z35?

You entered:

Your Answer
Score Explanation
24 Correct 1.00
Total
1.00 / 1.00
Question Explanation |Z35|=φ(7×5)=(71)×(51).

Question 8

How much is 210001mod11?    (please do not use a calculator for this)
Hint: use Fermat's theorem.

You entered:

Your Answer
Score Explanation
2 Correct 1.00
Total
1.00 / 1.00
Question ExplanationBy Fermat 210=1 in Z11 and therefore 1=210=220=230=240 in Z11. Then 210001=210001mod10=21=2 in Z11.

Question 9

While we are at it, how much is 2245mod35?
Hint: use Euler's theorem (you should not need a calculator)

You entered:

Your Answer
Score Explanation
32 Correct 1.00
Total
1.00 / 1.00
Question Explanation By Euler 224=1 in Z35 and therefore 1=224=248=272 in Z35. Then 2245=2245mod24=25=32 in Z35.

Question 10

What is the order of 2 in Z35?

You entered:

Your Answer
Score Explanation
2,12,20,32 Correct 1.00
Total
1.00 / 1.00
Question Explanation 212=4096=1 in Z35 and 12 is the smallest such positive integer.

Question 11

Which of the following numbers is a generator of Z13?
Your Answer
Score Explanation
9,9={1,9,3} Correct 0.20 No, 9 only generates three elements in Z13.
5,5={1,5,12,8} Correct 0.20 No, 5 only generates four elements in Z13.
2,2={1,2,4,8,3,6,12,11,9,5,10,7} Correct 0.20 correct, 2 generates the entire group Z13
8,8={1,8,12,5} Correct 0.20 No, 8 only generates four elements in Z13.
6,6={1,6,10,8,9,2,12,7,3,5,4,11} Correct 0.20 correct, 6 generates the entire group Z13
Total
1.00 / 1.00

Question 12

Solve the equation x2+4x+1=0 in Z23. Use the method described in lecture 9.3 using the quadratic formula.

You entered:

Your Answer
Score Explanation
x = -9, 5 Correct 1.00
Total
1.00 / 1.00
Question ExplanationThe quadratic formula gives the two roots in Z23.

Question 13

What is the 11th root of 2 in Z19? (i.e. what is 21/11 in Z19)
Hint: observe that 111=5 in Z18.

You entered:

Your Answer
Score Explanation
13 Correct 1.00
Total
1.00 / 1.00
Question Explanation 21/11=25=32=13 in Z19.

Question 14

What is the discete log of 5 base 2 in Z13? (i.e. what is Dlog2(5))
Recall that the powers of 2 in Z13 are 2={1,2,4,8,3,6,12,11,9,5,10,7}

You entered:

Your Answer
Score Explanation
9 Correct 1.00
Total
1.00 / 1.00
Question Explanation 29=5 in Z13.

Question 15

If p is a prime, how many generators are there in Zp?
Your Answer
Score Explanation
φ(p1) Correct 1.00 The answer is φ(p1). Here is why. Let g be some generator of Zp and let h=gx for some x. It is not difficult to see that h is a generator exactly when we can write g as g=hy for some integer y   (h is a generator because if g=hy then any power of g can also be written as a power of h). Since y=x1modp1 this y exists exactly when x is relatively prime to p1. The number of such x is the size of Zp1 which is precisely φ(p1).
(p+1)/2


(p1)/2


p


Total
1.00 / 1.00