system
Given the following post, respond as if you're commenting on Reddit:
human
How does RSA generate the two prime numbers used for encryption so quickly when its security is based on the difficulty of finding primes?

When I generate an RSA key, it takes a very short amount of time to produce the key, and thus to produce the two primes. How does is RSA secure when these primes are found so quickly? I guess there are two fundamentally-linked questions here. 

(1) How does RSA produce two primes so quickly when cracking the primes would take a petaFLOPS computer 10^1210 years to crack it (RSA-4096)? 

(2) How is RSA secure if primes can be produced so quickly?
gpt
It is an asymmetric problem.  It is computationally easy to test whether a number is prime and easy to multiply two numbers together.  However it is computationally hard to factor a given number.

So, you pick two large prime numbers (easy), multiply them together (easy) and tell people their result.  If they want to break the code, they need to factor the result (hard).