OBEKPA MARK ECHE
P13SCMT8013
COSC 808:DATASECURITY
AND ENCRYPTION
 The Rivest-Shamir-Adleman (RSA) algorithm is the
most widely acceptable and implemented public key
encryption.
 The RSA algorithm was developed in 1977 by Ron
Rivest, Adi Shamir and Len Adleman at
Massachusette Institute of Technology ( MIT).
 RSA is a block cipher in which plaintext and cipher
text are between 0 and n-1 for some n.
 Typically n is 1024bits≡309 decimal digits ≡ n < 2 1024
 If the block size is i, then 2i < n ≤ 2i+1
 Encryption and decryption follow these steps for a plaintext
M, and ciphertext block C.
Encryption c=me (mod n)
Decryption m= cd (mod n)
Public key {e, n}
Private key {d,n}
Requirement/ Problems
 Are there values of e, d, n such that med=m (mod n) for all m?
 Easy computation of me mod n and cd (mod n).
 Use exponation rule in modular arithmetics for example 2 50 =4 (mod 5)
 Infeasibility to determine d given e and n.
 Use factorisable large numbers that are difficult to factorise.
Let med=m (mod n)
Since bases are equal equate powers
ed=1 (mod n)
d= 1/e (mod n)
d=e-1 (mod n)
Inference
The identity med=m stands only if d is the multiplicative
inverse of e (mod n)
 The RSA algorithm involves three steps
• Key generation
• Encryption
• Decryption.
Key Generation
1. Choose two distinct prime numbers p and q.
2. Compute the modulo n=p*q.
3. Compute φ (pq) = (p-1)*(q-1)
4. Choose any integer e that is coprime with φ(n) such that
1<e≤φ(n).
5. Select d such that d=e-1 (mod φ(n) )
Encryption
Calculate the ciphertext c from the plain text msuch that c = me (mod n)
Decryption
m=cd (mod n)
 Choose p = 3 and q = 11
 Compute n = p * q = 3 * 11 = 33
 Compute φ(n) = (p -1)* (q-1)= 2 * 10 = 20
 Choose e such that 1 < e < φ(n) and e and n
are coprime. Let e = 7
 Compute a value for d such that (d * e) mod φ(n)
= 1. One solution is d = 3
 Public key is (e, n) => (7, 33)
 Private key is (d, n) => (3, 33)
 The encryption of m = 2 is c = 27 % 33 = 29
 The decryption of c = 29 is m = 293 % 33 = 2
Fermat Little theorem
 If p is prime and p does not divide an integer a then ap-1
=1 (mod p). --------------(1)
Aim
To show that med=m (mod pq) for every integer m when p
and q are distinct prime numbers and e and d are positive
integers satisfying
ed≡1 mod((p-1)(q-1)) -----------(2)
Proof
From (2)
ed -1≡ h(p-1)(q-1) for some non negative integer h
To show that med ≡ m (mod pq) it is sufficient and
equivalent to show that they are congruent mod p and
mod q separately.
 To show that med ≡ m (mod p) consider two cases
 Case1 (m ≡ 0)
med ≡0; therefore med is a multiple of p.
med ≡0 ≡ m (mod p)
 Case 2 (m≠ 0)
med ≡ m(ed-1+1) (mod p)
med ≡ m(ed-1)*m (mod p)
med ≡ m*mh(p-1)(q-1) (mod p)
med ≡ m*(m(p-1))h(q-1) apply Fermat Little theorem
med ≡ m*1h(q-1) (mod p)
med ≡ m (mod p)
Similarly using the same approach it can be shown that
med ≡ m (mod q)
This conclude the proof that for any integer m,
med ≡ m (mod pq)

RSA

  • 1.
    OBEKPA MARK ECHE P13SCMT8013 COSC808:DATASECURITY AND ENCRYPTION
  • 3.
     The Rivest-Shamir-Adleman(RSA) algorithm is the most widely acceptable and implemented public key encryption.  The RSA algorithm was developed in 1977 by Ron Rivest, Adi Shamir and Len Adleman at Massachusette Institute of Technology ( MIT).  RSA is a block cipher in which plaintext and cipher text are between 0 and n-1 for some n.  Typically n is 1024bits≡309 decimal digits ≡ n < 2 1024  If the block size is i, then 2i < n ≤ 2i+1
  • 4.
     Encryption anddecryption follow these steps for a plaintext M, and ciphertext block C. Encryption c=me (mod n) Decryption m= cd (mod n) Public key {e, n} Private key {d,n} Requirement/ Problems  Are there values of e, d, n such that med=m (mod n) for all m?  Easy computation of me mod n and cd (mod n).  Use exponation rule in modular arithmetics for example 2 50 =4 (mod 5)  Infeasibility to determine d given e and n.  Use factorisable large numbers that are difficult to factorise.
  • 5.
    Let med=m (modn) Since bases are equal equate powers ed=1 (mod n) d= 1/e (mod n) d=e-1 (mod n) Inference The identity med=m stands only if d is the multiplicative inverse of e (mod n)
  • 6.
     The RSAalgorithm involves three steps • Key generation • Encryption • Decryption. Key Generation 1. Choose two distinct prime numbers p and q. 2. Compute the modulo n=p*q. 3. Compute φ (pq) = (p-1)*(q-1) 4. Choose any integer e that is coprime with φ(n) such that 1<e≤φ(n). 5. Select d such that d=e-1 (mod φ(n) ) Encryption Calculate the ciphertext c from the plain text msuch that c = me (mod n) Decryption m=cd (mod n)
  • 7.
     Choose p= 3 and q = 11  Compute n = p * q = 3 * 11 = 33  Compute φ(n) = (p -1)* (q-1)= 2 * 10 = 20  Choose e such that 1 < e < φ(n) and e and n are coprime. Let e = 7  Compute a value for d such that (d * e) mod φ(n) = 1. One solution is d = 3  Public key is (e, n) => (7, 33)  Private key is (d, n) => (3, 33)  The encryption of m = 2 is c = 27 % 33 = 29  The decryption of c = 29 is m = 293 % 33 = 2
  • 8.
    Fermat Little theorem If p is prime and p does not divide an integer a then ap-1 =1 (mod p). --------------(1) Aim To show that med=m (mod pq) for every integer m when p and q are distinct prime numbers and e and d are positive integers satisfying ed≡1 mod((p-1)(q-1)) -----------(2) Proof From (2) ed -1≡ h(p-1)(q-1) for some non negative integer h To show that med ≡ m (mod pq) it is sufficient and equivalent to show that they are congruent mod p and mod q separately.
  • 9.
     To showthat med ≡ m (mod p) consider two cases  Case1 (m ≡ 0) med ≡0; therefore med is a multiple of p. med ≡0 ≡ m (mod p)  Case 2 (m≠ 0) med ≡ m(ed-1+1) (mod p) med ≡ m(ed-1)*m (mod p) med ≡ m*mh(p-1)(q-1) (mod p) med ≡ m*(m(p-1))h(q-1) apply Fermat Little theorem med ≡ m*1h(q-1) (mod p) med ≡ m (mod p) Similarly using the same approach it can be shown that med ≡ m (mod q) This conclude the proof that for any integer m, med ≡ m (mod pq)