Showing posts with label inverse. Show all posts
Showing posts with label inverse. Show all posts

Saturday, 18 May 2013

RSA Two-Key Encryption

So everything in the last seven posts has lead up to this.
The RSA Encryption Algorithm is a mathematical method of generating two encryption keys. You then encrypt a message with one key, and decrypt it using the other key.
This allows you to keep one key private, and publish the other key to the entire world.

Then there are two ways you can use these keys:
  1. You look up the public key of your friend, and encrypt a message using their public key. You have guaranteed that no-one can read the message except your friend.
  2. You encrypt a message using your private key. Everyone can read it, but no-one else but you could have sent it.
So the same technology can be used to keep secrets, and prove identity. Cool.

The Euclidean Algorithm and the Extended Euclidean Algorithm

This is the last trick needed to understand the RSA method. The first algorithm is a quick(-ish) method to find the greatest common divisor between two numbers (a and b). The second algorithm also calculates values of x and y that satisfies the following equation:
$ax + by = gcd(a,b)$