« A trick for using DIP at NetScreen firewall | Main | MAC and HMAC »

## March 06, 2005

### RSA Encryption and Digital Signature

It offers encryption and authentication (digital signature), developed in 1977 by Ron **R**ivest, Adi **S**hamir and **A**dleman and it works asymetric and generate public and private key by itself.thus encryption and authentication take place without any sharing of private keys: each person uses only another’s public key or their own private key.

For generate public and private keys it takes two larg prime numbers p and q , they should not equal and with a size of at least 1024 bits.

Let's take a look to its algorithm :

n define as follow :

n = p · q

phi define as follow :

φ = (p – 1) · (q – 1)

e is a number greater than 1 and less than φ as follow :

1< e < φ

d define as follow :

(d.e)/φ=1

d is private key and n,e are public key so it's difficult to obtain the private key d from the public key (n, e).

for example when our plaintext = 707

The encrypted data is c = m^e (mod n) :

ciphertext = 707^425(mod 3431) = 2142

then the plaintext is easily retrieved using m = c^d(mod n)

plaintext = 2142^1769(mod 3431) = 707

Posted by Mehrdad at March 6, 2005 10:20 AM