0% found this document useful (0 votes)
81 views

Assignment 11 - RSA

The document explains the RSA encryption algorithm in 5 steps: 1) Select two prime numbers p and q, 2) Calculate n as p * q, 3) Calculate φ(n) as (p-1) * (q-1), 4) Select e such that 1 < e < φ(n) and e and φ(n) are co-prime, 5) Find d which is the inverse of e modulo φ(n). It then gives an example of encrypting a plaintext M of 7 using a public key of e and n, and decrypting the ciphertext C using the private key of d and n to retrieve the original plaintext M.

Uploaded by

Basic204
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views

Assignment 11 - RSA

The document explains the RSA encryption algorithm in 5 steps: 1) Select two prime numbers p and q, 2) Calculate n as p * q, 3) Calculate φ(n) as (p-1) * (q-1), 4) Select e such that 1 < e < φ(n) and e and φ(n) are co-prime, 5) Find d which is the inverse of e modulo φ(n). It then gives an example of encrypting a plaintext M of 7 using a public key of e and n, and decrypting the ciphertext C using the private key of d and n to retrieve the original plaintext M.

Uploaded by

Basic204
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

Please read the RSA algorithm and the example given below, do the

exercise by yourself

RSA algorithm
1)
2)
3)
4)

Select two primes p and q


Calculate n = p x q
Calculate (n) = (p-1) x (q-1)
Select e such that 1 < e < (n) and gcd((n),e) = 1 (e and (n) have no
common factor, except the 1)
5) Find d which is the inverse of e modulo f(n):
d=e-1 (mod (n) )

or

d x e/ (n) = k(the quotient) with 1 remaining


(here we do not care about the quotient k, but the remainder has to be

1)

How does the cipher work?


Public key pair KU = {e,n}
Private key pair KR = {d,n}
M the original text (Plaintext).
1) Use public key KU to encrypt the plain text M into cipher text
C= Me (mod n)
2) Use private key KR to decrypt cipher text (C), then you get the plaintext (M)
Cd (mod n) M

Exercise:
1)
2)
3)
4)

Choose p = 7 and q = 11
Compute n = p * q = _________________
Compute (n) = (p - 1) * (q - 1) = __________________
Choose e such that 1 < e < (n) and e and (n) are co-prime. Let e =
___________
5) Compute a value for d such that (d * e) % (n) = 1. One solution is d =
_______
You choose the value of d, such (d * e) % (n) = 1. (Note, in the formal the
% means mod, you can find it on the calculator. )
The plaintext M = 7
The process of encryption:
The cipher text C = Me (mod n) = _____________________
The process of decryption:
Cd (mod n) = ___________________ ====M

You might also like