I am now in a position to be able to demonstrate one of the most widely used encryption methods on the web, RSA. The RSA cryptosystem was first described by Ron Rivest, Adi Shamir and Leonard Adleman in 1978. The complexity of decrypting, i.e. reading an encrypted message using RSA relies heavily on the difficulty of finding the prime factors of very large numbers. For example, if p1 and p2 are prime numbers 567451 and 368957 then it is relatively easy to calculate their product p1p2=209365018607 but it would be relatively difficult to find their original factors if only the product was known. In the actual implementation of this system prime numbers of typically hundreds of decimal digits are used.
Here is a prescription for using RSA.
- Choose two prime numbers p1 and p2
- Calculate n=p1p2 and φ(n)=(p1-1)(p2-1)
- Choose a positive integer encryption exponent e such that e is less than φ(n) and the gcd(e,φ(n))=1
- Calculate the decryption exponent d which is the inverse of e modulo φ(n), that is ed≡1 (mod φ(n))
- To encrypt a positive integer message m calculate m' where m'≡me (mod n)
- To decrypt message m' calculate m≡(m')d (mod n)
This is a public key encryption system. The receiver of encrypted messages makes n and e public but keeps p1 and p2 (and hence φ(n) and d) private. By doing so anyone can send an encrypted message to the receiver but only the receiver (hopefully) can decrypt the messages.
No comments:
Post a Comment