8/26/2014 Homework Feedback | Coursera
https://class.coursera.org/crypto-009/quiz/feedback?submission_id=497649 1/9
HelpFeedback — Week 5 - Problem Set
You submitted this homework on Thu 20 Feb 2014 3:00 AM PST. You got a score of
11.00 out of 15.00. You can attempt again in 10 minutes.
Question 1
Consider the toy key exchange protocol using an online trusted 3rd party (TTP) discussed in
Lecture 9.1. Suppose Alice, Bob, and Carol are three users of this system (among many others)
and each have a secret key with the TTP denoted respectively. They wish to generate
a group session key 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 a random and a random
. It sends to Alice
.
Alice sends to Bob and to Carol.
Alice contacts the TTP. TTP generates a random and sends to
Alice
.
Alice sends to Bob and to Carol.
Bob contacts the TTP. TTP generates random and sends to Bob
.
Bob sends to Alice and to Carol.
1.00 The protocol
works
because it
lets Alice,
Bob, and
Carol obtain
but
an
eaesdropper
, ,ka kb kc
kABC
kAB
kAC
E( , ), ← E( , ), ← E( , )ka kAB ticket1 kb kAB ticket2 kc kAC
ticket1 ticket2
kABC
E( , ), ← E( , ), ← E( , )ka kABC ticket1 kb kABC ticket2 kc kABC
kABC kABC
kABC
E( , ), ← E( , ), ← E( , )kb kABC ticket1 ka kABC ticket2 kc kABC
ticket1 ticket2
kABC
8/26/2014 Homework Feedback | Coursera
https://class.coursera.org/crypto-009/quiz/feedback?submission_id=497649 2/9
only sees
encryptions
of
under keys
he does not
have.
Alice contacts the TTP. TTP generates a random and sends to
Alice
.
Alice sends to Bob and to Carol.
Total 1.00 /
1.00
Question 2
Let be a finite cyclic group (e.g. ) with generator . Suppose the Diffie-Hellman
function is difficult to compute in . Which of the following functions is
also difficult to compute:
As usual, identify the below for which the contra-positive holds: if is easy to compute
then so is . If you can show that then it will follow that if is hard to compute in
then so must be .
Your Answer Score Explanation
0.25 It is easy to compute as .
0.25 an algorithm for calculating can easily be
converted into an algorithm for calculating .
Therefore, if were easy to compute then so would
, contrading the assumption.
0.25 It is easy to compute as .
0.25 an algorithm for calculating can easily be
converted into an algorithm for calculating .
Therefore, if were easy to compute then so would
, contrading the assumption.
kABC
kABC
E( , ), ← , ←ka kABC ticket1 kABC ticket2 kABC
ticket1 ticket2
G G = Z∗p g
( , ) =DHg g x g y g xy G
f f(⋅, ⋅)
(⋅, ⋅)DHg DHg G
f
f( , ) = (g x g y g√ )x+yf f( , ) =g x g y ⋅g x g y− −−−−√
f( , ) =g x g y g x(y+1)f( , )g x g y
DH(⋅, ⋅)f
DH
f( , ) =g x g y g x+y f f( , ) = ⋅g x g y g x g y
f( , ) =g x g y g 2xy f(⋅, ⋅)DH(⋅, ⋅)
fDH
8/26/2014 Homework Feedback | Coursera
https://class.coursera.org/crypto-009/quiz/feedback?submission_id=497649 3/9
Total 1.00 /
1.00
Question 3
Suppose we modify the Diffie-Hellman protocol so that Alice operates as usual, namely chooses a
random in and sends to Bob . Bob, however, chooses a random in
and sends to Alice . What shared secret can they generate and how
would they do it?
Your Answer Score Explanation
. Alice computes the
secret as and Bob computes .
. Alice computes the
secret as and Bob computes .
. Alice computes the
secret as and Bob computes .
. Alice computes the
secret as and Bob computes .
1.00 This is correct since it is not difficult
to see that both will obtain
Total 1.00 /
1.00
Question 4
Consider the toy key exchange protocol using public key encryption described in Lecture 9.4.
Suppose that when sending his reply to Alice, Bob appends a MAC
to the ciphertext so that what is sent to Alice is the pair . Alice verifies the tag 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
a {1, … , p − 1} A ← g a b
{1, … , p − 1} B ← g 1/b
secret = g a/b
B1/a Ab
secret = g ab
Ba Ab
secret = g b/a
Ba A1/b
secret = g a/b
Ba A1/b g a/b
c ← E(pk, x) t := S(x, c)
(c, t) t
8/26/2014 Homework Feedback | Coursera
https://class.coursera.org/crypto-009/quiz/feedback?submission_id=497649 4/9
it depends on what
public key encryption
system is used.
no 1.00 an active attacker can still decrypt to
recover and then replace by where
and .
yes
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 and such
that . Find such a pair of integers with the smallest possible . Given
this pair, can you determine the inverse of 7 in ?
Enter below comma separated values for , and for in .
You entered:
10
Your Answer Score Explanation
10 0.00
Total 0.00 / 1.00
Question Explanation
. Therefore in implying that in .
Question 6
E(p , x)k′
x (c, t) ( , )c′ t′
← E(pk, x)c′ t ← S(x, )c′
a b
7a + 23b = 1 (a, b) a > 0
Z23
a, b 7−1 Z23
7 × 10 + 23 × (−3) = 1 7 × 10 = 1 Z23 = 107−1 Z23
8/26/2014 Homework Feedback | Coursera
https://class.coursera.org/crypto-009/quiz/feedback?submission_id=497649 5/9
Solve the equation in .
You entered:
14
Your Answer Score Explanation
14 0.00
Total 0.00 / 1.00
Question Explanation
Question 7
How many elements are there in ?
You entered:
24
Your Answer Score Explanation
24 1.00
Total 1.00 / 1.00
Question Explanation
.
Question 8
How much is ? (please do not use a calculator for this)
Hint: use Fermat's theorem.
You entered:
3x + 2 = 7 Z19
x = (7 − 2) × ∈3−1 Z19
Z∗35
| | = φ(7 × 5) = (7 − 1) × (5 − 1)Z∗35
mod 11210001
8/26/2014 Homework Feedback | Coursera
https://class.coursera.org/crypto-009/quiz/feedback?submission_id=497649 6/9
2
Your Answer Score Explanation
2 1.00
Total 1.00 / 1.00
Question Explanation
By Fermat in and therefore in . Then
in .
Question 9
While we are at it, how much is ?
Hint: use Euler's theorem (you should not need a calculator)
You entered:
32
Your Answer Score Explanation
32 1.00
Total 1.00 / 1.00
Question Explanation
By Euler in and therefore in . Then
in .
Question 10
What is the order of in ?
You entered:
1
= 1210 Z11 1 = = = =210 220 230 240 Z11= = = 2210001 210001mod10 21 Z11
mod 352245
= 1224 Z35 1 = = =224 248 272 Z35= = = 322245 2245mod24 25 Z35
2 Z∗35
8/26/2014 Homework Feedback | Coursera
https://class.coursera.org/crypto-009/quiz/feedback?submission_id=497649 7/9
Your Answer Score Explanation
1 0.00
Total 0.00 / 1.00
Question Explanation
in and 12 is the smallest such positive integer.
Question 11
Which of the following numbers is a generator of ?
Your Answer Score Explanation
0.20 correct, 2 generates the
entire group
0.20 No, 3 only generates
three elements in .
0.20 correct, 6 generates the
entire group
0.20 No, 4 only generates six
elements in .
0.20 No, 5 only generates
four elements in .
Total 1.00 /
1.00
Question 12
Solve the equation in . Use the method described in lecture 9.3 using the
quadratic formula.
You entered:
= 4096 = 1212 Z35
Z∗13
2, ⟨2⟩ = {1, 2, 4, 8, 3, 6, 12, 11, 9, 5, 10, 7} Z∗13
3, ⟨3⟩ = {1, 3, 9}Z∗
13
6, ⟨6⟩ = {1, 6, 10, 8, 9, 2, 12, 7, 3, 5, 4, 11} Z∗13
4, ⟨4⟩ = {1, 4, 3, 12, 9, 10}Z∗
13
5, ⟨5⟩ = {1, 5, 12, 8}Z∗
13
+ 4x + 1 = 0x2 Z23
8/26/2014 Homework Feedback | Coursera
https://class.coursera.org/crypto-009/quiz/feedback?submission_id=497649 8/9
6, 10
Your Answer Score Explanation
6, 10 0.00
Total 0.00 / 1.00
Question Explanation
The quadratic formula gives the two roots in .
Question 13
What is the 11th root of 2 in ? (i.e. what is in )
Hint: observe that in .
You entered:
13
Your Answer Score Explanation
13 1.00
Total 1.00 / 1.00
Question Explanation
in .
Question 14
What is the discete log of 5 base 2 in ? (i.e. what is )
Recall that the powers of 2 in are
You entered:
9
Z23
Z19 21/11 Z19
= 511−1 Z18
= = 32 = 1321/11 25 Z19
Z13 (5)Dlog2
Z13 ⟨2⟩ = {1, 2, 4, 8, 3, 6, 12, 11, 9, 5, 10, 7}
8/26/2014 Homework Feedback | Coursera
https://class.coursera.org/crypto-009/quiz/feedback?submission_id=497649 9/9
Your Answer Score Explanation
9 1.00
Total 1.00 / 1.00
Question Explanation
in .
Question 15
If is a prime, how many generators are there in ?
Your
Answer
Score Explanation
1.00 The answer is . Here is why. Let be some generator of
and let for some . It is not difficult to see that is a
generator exactly when we can write as for some integer
( is a generator because if then any power of can
also be written as a power of ). Since this
exists exactly when is relatively prime to . The number of
such is the size of which is precisely .
Total 1.00 /
1.00
= 529 Z13
p Z∗p
φ(p − 1)φ(p − 1) g
Z∗p h = g x x h
g g = hy
y h g = hy g
h y = mod p − 1x−1
y x p − 1x Zp−1 φ(p − 1)
φ(p)
p√
(p + 1)/2