question_3-corrections1

advertisement
Question 3.
Pin =173 this is the message we want to encrypt
We want need to get the public and private key for Alice
We also need to get M and C using p=7 and q=13
Compute n = pq. n is used as the modulus for both the public and private keys.
n= 7 * 13 = 91
Compute the totient of the product as φ(n) = (p − 1)(q − 1) giving
φ =(7-1)(13-1)= 72
Choose an integer e such that 1 < e < φ(n) and gcd(e, φ(n)) = 1; i.e., e and φ(n) are coprime. Let e
=59 ,
e is a public key.
Determine d as the multiplicative inverse of e (modulo φ(n)).
e * d mod 72 = 1
1=
𝑑𝑒 − 1
𝛗
𝑑=
𝑘𝛗 + 𝟏
𝑒
e * d mod 72 = 1
𝑑=
72𝑘 + 𝟏
59
Through trial and error we get d = 9
59 *11 mod 72 = 1
I.
Encrypt the message
The public key is (n = 91, e =59).
The private key is (d = 11)
For a padded plaintext message M, the encryption function is
C (M) = Me mod n
C (M) = M59 mod 91
Now M which is the message to be encrypted must less than 91 else it cannot be decrypted to give the
original message. So 173 can changed to be less than 91 or we can choose to larger prime numbers to
give an n which is greater than 173.
1<M<91
Suppose M which is the pin is 73 then we can encrypt it as
C =7359 mod 91
C=5
To decrypt C,
M = Cd mod n
M=511mod 91
M=73
Download