written 8.8 years ago by | • modified 6.5 years ago |
1.Most widely accepted and implemented general purpose approach to public key encryption developed by Rivest-Shamir and Adleman (RSA) at MIT university.
2.RSA scheme is block cipher in which the plaintext and ciphertext are integers between 0 and n-1 for same n.
3.Typical size of n is 1024 bits. i.e n<2.
4.Description of Algorithm:
- The scheme developed by Rivest, Shamir and Adleman makes use of an expression with exponentials.
- Plaintext is encrypted in block having a binary value than same number n.
Block Size ≤log2(n)
If block size=1 bits then, 21≤n≤2i+1
Encryption and decryption are of following form for same plaintext M and ciphertext C.
C=Memodn
M=Cdmodn
M=(Me)dmodn
M=Medmodn
Both sender and receiver must know the value of n.
- The sender knows the value of e, and only the receiver knows the value of d.
- Thus this is a public key encryption algorithm with a public key of PU= {c, n} and private key of PR= {d, n}.
5.RSA algorithm as shown below:
a) Key Genration :
- Select p,q…….. p and q both are the prime numbers, p≠q.
- Calculate n=p×q
- Calculate q(n) = (p-1) (q-1)
- Select integer….g(d ( (n), e)) =1 & 1< e < (n)
- Calculate d; d= e-1 mod (n)
- Public Key, PU= {e, n}
Private Key, PR ={d,n}
b) Encryption :
Plaintext : m<n< p="">
Ciphertext: C
c) Decryption:
Ciphertext: C
- Plaintext : M= Cd mod n
- Note 1 : (n) -> Euler’s totient function
Note 2: Relationship between C and d is expressed as:
ed (mod (n))=1
ed = 1 mod (n)
d = e−1 mod (n)
6.Example:
Key Generation :
- Select 2 prime numbers -> p=17 and q=11
- Calculate n = p×q =17 ×11=187
- Calculate = 16 × 10= 160 Select ‘e’ such that e is relatively prime to (n)=160 and e <
Determine d such that :
de =1 mod (n)
d × 7 = 1 mod 160
↓
161
d=e−1 mod (n)[161/7=
div.(d)23 and remainder (mod) =1d=23
Then the resulting keys are public key :
PU = {7, 187 }
PR = {23, 187 }
Let M=88 for encryption
C=887mod(187)88mod187=88882mod187=7744mod187=77884mod187=59969536mod187=132
887mod187 =(884mod187)×(882mod187)×(88mod187)mod187=(132×77×88)mod187=894432mod187=11
For Decryption :
M=Cdmod187=1123mod187111mod187=11112mod187=121114mod187=14641/187=55118mod187=214358881mod187=331123mod187 =(118mod187×118mod187×114mod187×112mod187×111mod187)mod187=(33×33×55×81×11)mod187=79720245mod187=88

Figure 5.4 Solution of Above example