Cryptography is the science of secure communication or sharing of information. Let’s explain it using two people: Bob and Alice.
If Bob wants to share a secret message with Alice, he could scramble that information in such a way that only Alice can understand it. The process of scrambling messages is called encryption, and unscrambling them is called decryption.
Here’s a simple example of encryption in action. Bob wants to send his email password to Alice, but he doesn’t want it to fall into the wrong hands. He could encrypt that password with a key, then send the key to Alice so she could decrypt the message. To make a simple key, Bob could replace every letter in the alphabet with the corresponding number: A is 1, B is 2, C is 3, and so on. Z is of course 26. If his password is ”hello,“ he will send the following message to Alice: ”8 5 12 12 15.“ No one should be able to understand what those numbers represent without the key. Alice receives the message, decrypts it with the key, and reads the information.
Of course, this is just a basic example to show the idea behind public-key cryptography. Encryptions for Bitcoin transactions are much more complex, which is what makes them secure.