Download presentation
Presentation is loading. Please wait.
1
Practical Aspects of Modern Cryptography
Assignment 2 Solutions
2
Problem 1 October 18, 2016 Practical Aspects of Modern Cryptography
3
Problem 1a π mod π=π mod π βπ β‘ π π (by HW1#2a) βπβπ=π’π for some π’ββ€ (def. of β‘ π from HW1#2a) Similarly, π mod π=π mod π β(πβπ)=π£π for some π£ββ€. Since (πβπ) is a multiple of prime π and also a multiple of (distinct) prime π, (πβπ) is a multiple of ππ. Hence, π β‘ ππ π, and thus π mod ππ =π mod (ππ) (by HW1#2b). October 18, 2016 Practical Aspects of Modern Cryptography
4
Problem 1b Find a counterexample for the case when π and π are not both primes. We want (πβπ) is a multiple of π and πβπ is a multiple of π, but (πβπ) is not a multiple of (ππ). E.g. π=6=2Γ3, π=10=2Γ5; 30 is a multiple of both 6 and 10, but not a multiple of 60. So, for example, 73 mod 6=1=43 mod 6 and 73 mod 10=3=43 mod 10. But 73 mod 60=13β 43=43 mod 60. October 18, 2016 Practical Aspects of Modern Cryptography
5
Problem 2 October 18, 2016 Practical Aspects of Modern Cryptography
6
Problem 2 We know that π π mod π=π mod π for all πββ€, prime π. Show that π π πβ1 +1 mod π=π mod π for all πβ₯0. π=0: π π πβ1 +1 mod π=π mod π. οΌ π=1: π π mod π=π mod π (from Fermat). οΌ Assume π π πβ1 +1 mod π=π mod π. Show that π π+1 πβ1 +1 mod π=π mod π. π π+1 πβ1 +1 mod π= π π πβ1 π πβ1 +1 mod π October 18, 2016 Practical Aspects of Modern Cryptography
7
Problem 2 π π+1 πβ1 +1 mod π = π π πβ1 + πβ1 +1 mod π = π π πβ1 π πβ1 +1 mod π = π π πβ1 π π mod π mod π = π π πβ1 π mod π mod π (by Fermat) = π π πβ1 +1 mod π =π mod π (by inductive hypothesis) October 18, 2016 Practical Aspects of Modern Cryptography
8
Problem 3 October 18, 2016 Practical Aspects of Modern Cryptography
9
Problem 3 We now know that π π 1 πβ1 +1 mod π=π mod π π π 2 πβ1 +1 mod π=π mod π for π 1 , π 2 β₯0, πββ€, and primes π and π. Let π 1 =πΎ(πβ1) and π 2 =πΎ(πβ1) for πΎβ₯0. π πΎ πβ1 πβ1 +1 mod π=π mod π π πΎ πβ1 πβ1 +1 mod π=π mod π By problem 1, if π and π are distinct primes, then π πΎ πβ1 πβ1 +1 mod ππ =π mod πQ . October 18, 2016 Practical Aspects of Modern Cryptography
10
Problem 4 October 18, 2016 Practical Aspects of Modern Cryptography
11
Problem 4a π 1 = π 1 π mod π and π 2 = π 2 π mod π π 1 π 2 mod N = π 1 π mod π π 2 π mod π mod π = π 1 π π 2 π mod π = π 1 π 2 π mod π = π 1 π 2 mod π π mod π October 18, 2016 Practical Aspects of Modern Cryptography
12
Problem 4b π π 1 βπ π 2 =π( π 1 + π 2 mod π) Let π π = π π mod π and let β be multiplication mod π. Then π π 1 βπ π 2 = (π π 1 mod π) (π π 2 mod π) mod π = π π 1 + π 2 mod π. Now Fermat (and prob. 2) tell us that if (π 1 + π 2 )β₯π, we can subtract multiples of (πβ1) from the exponent without changing the result. So, π π 1 βπ π 2 = π π 1 + π 2 mod π = π π 1 + π 2 mod πβ1 mod π October 18, 2016 Practical Aspects of Modern Cryptography
13
Problem 5 October 18, 2016 Practical Aspects of Modern Cryptography
14
Problem 5 π and π are the long-term private keys of Alice and Bob. π΄ and π΅ are the long-term public keys of Alice and Bob. π and π are the ephemeral private keys of Alice and Bob. π΄ and π΅ are the ephemeral public keys of Alice and Bob. π΄ = π π mod π π΅ = π π mod π π΄= π π mod π π΅= π π mod π πΎ= π΄ π π΄ π mod π= π΅ π π΅ π mod π πΎ= π΄ π π΅ π mod π This protocol does not achieve forward secrecy! October 18, 2016 Practical Aspects of Modern Cryptography
15
Problem 5a πΎ= π΄ π π΄ π mod π= π΅ π π΅ π mod π= π π π +ππ mod π instead of πΎ= π΄ π π΄ π mod π= π΅ π π΅ π mod π= π π π + π π mod π New protocol: πΎ= π π π +ππ mod π= π π π π ππ mod π This is (long-term shared key)Γ(ephemeral shared key). Knowledge of long-term keys does not reveal ephemeral keys. This protocol does achieve forward secrecy. October 18, 2016 Practical Aspects of Modern Cryptography
16
Problem 5b Alice has certified π΄ = π π mod π, but Bob has no certified public key. If Bob generates ephemeral π΅= π π mod π, πΎ= π π π mod π produces a (one-sided) authenticated secret key exchange, but not forward secrecy. Alice can also generate an ephemeral key π΄= π π mod π. πΎ= π΄ π΄ π mod π= π π +π π mod π= π΅ π +π mod π seems to produce a (one-sided) authenticated secret key exchange that achieves forward secrecy. Or does it? October 18, 2016 Practical Aspects of Modern Cryptography
17
Problem 5b An attack by Eve on πΎ= π΄ π΄ π mod π= π π +π π mod π= π΅ π +π mod π Eve selects random π and produces πΈ= π π mod π. Eve then sends to Bob: Aliceβs certified π΄ and her ephemeral public key πΈ = πΈΓ· π΄ mod π. [ πΈ = π πβ π mod π β even though Eve doesnβt know π .] Bob computes πΎ= π΄ πΈ π mod π= π ππ mod π. Eve computes πΎ= π΅ π mod π= π ππ mod π. October 18, 2016 Practical Aspects of Modern Cryptography
18
Problem 5b Instead of πΎ= (π π π Γ π ππ ) mod π, one option is πΎ= π π π + π ππ mod π. Bob computes πΎ= π΄ π + π΄ π mod π. Alice computes πΎ= π΅ π + π΅ π mod π. This does (we believe) provide a secret key exchange with (one-sided) authentication and forward secrecy. October 18, 2016 Practical Aspects of Modern Cryptography
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.