Part 2:
Secret Key Exchange (Diffie-Hellman)
When you submit a password or credit card number online, your computer has to send that data to another computer over the internet.
Any data sent over the internet can be seen by anyone else, so computers are instructed to scramble (encrypt) sensitive data with a secret key before sending it out.
The receiving computer needs to know that secret key in order to unscramble (decrypt) the data.
The modulo operation acts as a one-way function. There's no pattern to reverse engineer it.
When you multiply big numbers and mod them by other big numbers, it’s really hard to figure out what the original numbers were; the technique is essentially reduced to random guessing, which would take an unreasonable amount of time.
In 2015, computer scientists discovered the Logjam attack, a security vulnerability against Diffie–Hellman key exchanges that use 512-bit to 1024-bit keys. This is avoided by using prime numbers that are 2048-bit or larger.