Most people have come across cryptography in some way, shape or form. To most people, it's just a way of encrypting a message in such a way that only the intended receiver can decrypt it. In this article, I will be exploring the benefits of public-key cryptography, most notably RSA, as well as explaining the basic concept behind computer cryptography for the uninitiated.
Cryptography (intro)
So, if this is the first time you've heard of cryptography, this section is meant for you!
The basic concept of cryptography is relatively simple: You take a message and, combining it with some type of secret shared between sender and recipient, turn the message into something that cannot be understood without said secret.
If you've ever come up with some sort of secret code in your childhood (or early adult life, no judgement here), you've probably done cryptography, even if you didn't know it. The simplest form of symmetric-key cryptography is the Cesar Cipher. The way it works is by shifting the entire alphabet over by some amount. For example, A becomes B, B becomes C, etc.
Here is a simple message encoded with a Cesar Cipher.
cryptography -> dszquphsbqiz
This message was encrypted with an alphabet shift of one character, the same as the above example.
The Cesar Cipher is an example of what's called symmetric-key cryptography. That means that the secret (key) that is used to encrypt the message, is the same as the one used to decrypt the message. This makes for a very simple algorithm indeed. You just hand your friend a number—the alphabet shift—and they can encode and decode messages to their heart's content.
Some other examples of symmetric ciphers include Rijndael (AES) and Twofish.
You can find a video of Prof. Mike Pound explaining AES here.
Public-key (asymmetric) cryptography
Public key cryptography has mostly the same goals as symmetric-key cryptography, except that it uses two keys, commonly referred to as a key-pair, instead of one. The idea being that any message encrypted using one key, can only be decrypted using the other. This is a very useful concept for several reasons, the first of which is security.
Using traditional symmetric-key cryptography, you need to have a shared key. This key then needs to be given to the recipient of your message in advance, otherwise, they wouldn't be able to decode your message.
To illustrate how this is a problem, let's consider three people: Alice, Bob and Eve.
Alice and Bob would like to communicate and Eve wants to find out what they are saying. In the first scenario, Alice and Bob can very easily communicate using a symmetric cipher. Alice and Bob live next door to one another and Alice (the sender) can simply hand Bob an envelope containing the key and the message. Presumably, this key will be used in all future correspondence.
Now, you might be asking yourself, what happens if Alice and Bob are separated by a vast distance. How would they establish a shared key without Eve getting in on the action? After all, if they used any traditional means of communication such as mail, Eve could just open the letter in transit and snatch the key.
This is where public-key cryptography starts to make a whole lot of sense. Here is what Alice and Bob would need to do.
Alice and Bob both generate a key-pair and pick one of them to be their secret key, the other one then becomes their public key. Bob sends his public key to Alice through the post and Alice does the same. Now, Alice and Bob both have each other's public keys, which they can encrypt messages with, and they have their own secret keys, using which they can decrypt messages. And all the while, poor Eve only has two public keys, neither of which will be able to decrypt any of Alice and Bob's conversations.
This alone would make public-key cryptography a heaven-sent. The only problem is that there is one thing Eve can do to get in on Alice and Bob's conversation. A man-in-the-middle attack. This involves Eve generating her own key-pair and swapping Alice and Bob's public keys for her own when she intercepts their messages. This would enable her to decrypt a message in transit, read it, and re-encrypt it, sending it on to the intended recipient.
In the next article, I will discuss how this issue can be remedied.
Conclusion
I hope you enjoyed this article about public-key cryptography and that it has interested you to do some of your own research. It is no coincidence that I now publish an article on cryptography just as I start a new series of mystery-articles. I will be relying on several cryptographic techniques to make the following puzzles harder to solve. So subscribe if you would like to be notified of my next article!

Comments
Post a Comment