RSA – explained. Part 1.

RSA a milestone in cryptography, was first published by Ron Rivest, Adi Shamir and Leonard Adleman (MIT) in 1977. Their work based heavily on idea of asymmetric public-private key cryptosystem published in 1976 by Whitfield Diffie and Martin Hellman (Stanford).

Here I try to make simple explanation of that cipher (not to pretend I am an expert in subject more to remember myself):

Lets take primes and .

Then calculate modulus .

Calculate Euler’s totient function – it is equal to amount of positive integers relatively prime to . , as there 6 co-prime numbers to 9 : [1, 2, 4, 5, 7, 8]. is kept private. – as p and q prime and amount of co-primes is p-1 and q-1.

Take such as and gcd( ) = 1. Which means are co-prime. It will be our public key

As you can see RSA can be used only for encryption of small messages. To encrypt big chunks of data used hybrid schemes. RSA used for encryption of key which will be used by symmetric cipher like IDEA/AES.