How do PGP encryption keys work?

941 views

The basic idea behind 2-key encryption and how you use it is pretty comprehensive. But what’s the math function that goes into generating 2 one way keys that are inverses of each other, but can’t reverse themselves?

In: Technology

2 Answers

Anonymous 0 Comments

What you are describing is the RSA problem. When you generate a key you generate two public numbers called e and n. The encrypter will calculate P^(e) mod n where P is the plaintext. Finding the plaintext given this number is very hard. That is, unless you know something secret about the number n. In modular arithmatic you often make sure the modulus is prime, but in this case n is the product of two primes p and q. Using the totient function and some knowledge about relative primes you can then find the inverse of e allowing you to reverse the encryption operation.

Anonymous 0 Comments

While the precise math is pretty complex, encryption is essentially multiplying two large prime numbers together, reversing that with the key is the equivalent of factoring that result back into the two primes.

Multiplying two numbers, even two 100 digit numbers, is an easy step by step process that directly produces the resulting 200 digit number. Getting those two numbers back boils down to a guessing a bunch of 100 digit numbers until you find the right one, and can take years on a supercomputer.