There are two types of cryptography :
What is symmetric cryptography?
Let's say Alice wants to send message to Bob, but she doesn't want to send the message in plain text because anyone can read it.
She has a recipe how to mess up the letters in a way that no one can understand what it means(that is called encryption). Bob has the same recipe but he uses it to order them so it will become readable again(that is called decryption), and he will understand what Alice wrote. The recipe in cryptography is called a key. In symmetric cryptography both users have the same key to encrypt and decrypt the messages.
What is asymmetric cryptography?
In asymmetric cryptography the encryption and decryption keys are different. The encryption key can be used only for encryption, not for decryption and vice versa. The encryption key is called Public key and the decryption key is called Private key.
Why is asymmetric cryptography used?
Well..because it's more secure! If you are using symmetric cryptography and someone takes your key he can encrypt and decrypt messages that you send. While in asymmetric cryptography he can't decrypt the messages you encrypted with the public key. Only the holder of the Private key can decrypt them. Let's give an example :
Alice wants to talk to Google
Google gives Alice the Public key.
Alice encrypts her message with the public key and sends it to Google.
Google decrypts the message with his private key and sends back what Alice wanted.
And that's how the conversation goes...
Note : Symmetric cryptography is faster than asymmetric, but asymmetric is more secure.
Now let's see what you've learned!