To explain what cryptography is, I’m going to start out with a little example. Let’s pretend like you and your friend are on different sides of the world, and you have an important message to send his friend. But because you are on the other side of the world, you can’t hand your friend this message.
You write your letter in English, Spanish, Chinese, German, French or any of the known language; we would consider that this message is in plaintext. If the letter is in plaintext, that means it’s very easy for anybody who speaks that language to understand its contents.
So what if this message contains some secret information that you only want your friend to know?
If you send it in a letter, there’s going to be a whole bunch of people that will be handling this letter, so there’s a risk that somewhere along the way, this letter could fall into the hands of the wrong person, and that person may read the secret message. Sometimes that person will keep the message, or he could take note of that information and then continue to pass the letter on to your friend.
So how can you be sure that nobody in the middle can uncover the secret message?
One thing you could do is he could use cryptography to encrypt the message, that way if somebody in the middle gets the message, they will be unable to understand its contents.
So what does it mean to encrypt a message?
Let’s say the secret message is the word fun; You doesn’t want anybody other than your friend to read this secret message. Well, anybody that speaks English can read the letters FUN, and understand that you are trying to send the message FUN to your friend.
So, to encrypt the plaintext, you can convert the letters FUN into numbers, you can use a key to change the letters into numbers. We can think of the key as mathematical operations that we can perform on the letters of your message. After applying the key to the letters FUN, we end up with a new numerical value which is known as ciphertext.
Now, if you put this ciphertext in an envelope and send it to your friend, you won’t have to worry about somebody in the middle discovering the secret message. If somebody in the middle sees the message, they won’t be able to decrypt the message without a proper decryption key.
Your friend will need the decryption key to convert ciphertext into the original message. Now that it’s back to the English language, your friend has retrieved the original plaintext in your message.
In a nutshell, that’s how cryptography works.
We start with plaintext, which is in a language recognized by a multitude of people. We convert that plaintext into ciphertext. The ciphertext is unreadable to anyone who does not have the decryption key. The ciphertext can go across the world to your friend, who then uses the decryption key to convert the ciphertext back to the language that both you and your friend understand.