Cryptography - Discrete Mathematics - Solved Homework, Exercises of Mathematics

This home work exercise is very helpful for the student of discrete mathematics. The major points in the exercises are: Cryptography, Encrypted Message, Number of Integers, Euclidean Algorithm, Inverse Number, Common Divisor, Original Message, Rsa Protocol, Two Variables, Even Number, Odd Numbers, Multiplication

Typology: Exercises

2012/2013

Uploaded on 04/23/2013

sarangapani
sarangapani 🇮🇳

4.5

(10)

62 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
SP12-CSE20 Discrete Mathematics
Homework 3 Solution
May 15, 2012
1 Cryptography
1.1 Problem 2.12
Suppose that Nis a prime in the RSA protocol of Example 17. How can
the spy Joe find the message Mif he has e,Nand the encrypted message
Memod N=C?
Joe needs to decode the encrypted message, C, with help of d, since
Cd= (Memod N)d=Med mod N=Mmod N(1)
However, to get the number d, Joe needs to calculate f(N) first, since
ed mod f(N)1 (2)
Therefore the first step is to find f(N). By definition, f(N) is the number
of integers within the range of [1, N 1] which are coprime with N. As a
result, when Nis a prime, all positive integers smaller than Nare coprime
with it, so we have f(N) = N1.
The next step is to find the value of d, which is the inverse of emod f(N).
He can use an extended Euclidean algorithm to calculate the inverse number
as follows. To find din order to satisfy ed 1 mod f(N), it is necessary to
have gcd(e, f (N)) = 1. Otherwise, assume gcd(e, f (N)) = x > 1, e=kex
and f(N) = kfx. Since ed 1 mod f(N), suppose ed =kedf(N) + 1, we
have ed =dkex=kedkfx+ 1, thus x(dkekedkf) = 1. This contradicts
1
Docsity.com
pf3

Partial preview of the text

Download Cryptography - Discrete Mathematics - Solved Homework and more Exercises Mathematics in PDF only on Docsity!

SP12-CSE20 Discrete Mathematics

Homework 3 Solution

May 15, 2012

1 Cryptography

1.1 Problem 2.

Suppose that N is a prime in the RSA protocol of Example 17. How can the spy Joe find the message M if he has e, N and the encrypted message M e^ mod N = C?

Joe needs to decode the encrypted message, C, with help of d, since

Cd^ = (M e^ mod N )d^ = M ed^ mod N = M mod N (1)

However, to get the number d, Joe needs to calculate f (N ) first, since

ed mod f (N ) ≡ 1 (2) Therefore the first step is to find f (N ). By definition, f (N ) is the number of integers within the range of [1, N − 1] which are coprime with N. As a result, when N is a prime, all positive integers smaller than N are coprime with it, so we have f (N ) = N − 1. The next step is to find the value of d, which is the inverse of e mod f (N ). He can use an extended Euclidean algorithm to calculate the inverse number as follows. To find d in order to satisfy ed ≡ 1 mod f (N ), it is necessary to have gcd(e, f (N )) = 1. Otherwise, assume gcd(e, f (N )) = x > 1, e = kex and f (N ) = kf x. Since ed ≡ 1 mod f (N ), suppose ed = kedf (N ) + 1, we have ed = dkex = kedkf x + 1, thus x(dke − kedkf ) = 1. This contradicts

with the assumption that x > 1. As a result, we have gcd(e, f (N )) = 1. Theorem 5 on page N T -16 states that every common divisor of e and f (N ) (certainly including gcd(e, f (N ))) can be expressed as af f (N ) + aee, where both af and ae are integers. How to find af and ae is illustrated in Example 13 on page N T -19, where Euclidean algorithm is used again. After we get the value of af and ae satisfying af f (N ) + aee = gcd(e, f (N )) = 1, we have aee ≡ 1 − af f (N ) ≡ 1 mod f (N ). As a result, ae is the inverse of e with modulo f (N ) and we have d = ae. With help of d we can decrypt the received message C into the original message M using Equation 1.

1.2 Problem 2.

Using the same numbers as in Example 17, decrypt the message 2.

As shown in Example 17, we have N = 77, e = 13 and d = 37. Now the received message M e^ mod N = 2, the original message is computed as

(M e)d^ mod N = 2^37 mod 77 = 137438953472 mod 77 = 51 (3)

As a result, the original message is 51.

1.3 Problem 2.

Consider the RSA protocol (Example 17). Suppose that N = 5 × 13 and e = 7. What is d?

We have N = p × q = 5 × 13, thus f (N ) = (p − 1)(q − 1) = 4 × 12 = 48. Since we have e = 7 and ed ≡ 1 mod (f (N ) = 48), following the solution to Problem 2.12 we can easily generate the value of d. Specifically, we have gcd(e, f (N )) = 1 = 7e − 1 × f (N ), while 7e ≡ 1 + f (N ) ≡ 1 mod f (N ). As a result, we have 7e ≡ 1 mod f (N ) and d = 7.

1.4 Problem 2.

Consider the RSA protocol (Example 17). Explain why d and e must both be chosen to be odd.