Cryptography Basics

 




Cryptography. Sounds like something out of the Matrix, doesn't it? Whilst this is a cool train of thought, it isn't all that enigmatic. Cryptography is a process utilised by almost every computer system and authority to safeguard our good friend - data. In this post, we'll be exploring how this works along with some real life situations you may find yourself in that is aided by cryptography. 

To begin with, we need to establish what cryptography actually is. Let's have a look at a real-life scenario:   

                                                       


Here are John and Janet having an online conversation. During this conversation, they exchange several messages with each other. 

Now let's add someone else to the picture. 



Hackers. Hackers are everywhere at the moment. If a hacker, much like in this situation, manages to break into an online conversation, they can gain easy access to the messages exchanged. Now if these messages are very crucial, such as vital company or government secrets, the knock-on effects of having this data revealed to someone with an ulterior motive may be disastrous. 

But it's not only stealing data which is the big dilemma. Once hackers gain access to data, they can easily modify it as well. For example, if John in the diagram is trying to send Janet a message, say "Hi there!", this can be changed to a more problematic message such as "Give me 50 Bitcoins or I will permanently delete all your files on this desktop". 

So how do we stop or even reduce the chances of falling victim to such cyberattacks? Introducing cryptography. This is, to put it simply, the way in which information or networks are protected from external threats and potential damage. 

So how does this work? 

You may have come across the terms encryption and decryption. Encryption is the process by which plaintext information and data is converted into a cryptic code, called a cipher or ciphertext. Once transferred across a server or network, this cryptic code is translated through decryption back into its original plaintext form which is received by the person on the other end of a conversation. 

This conversion can only happen if there is a key. A key is an alphanumeric code which dictates how the encryption-decryption algorithm works and how the plaintext is converted. Now there are many different types of cryptography out there, with numerous types of cipher codes. However, we'll be focussing on the most common technique called RSA. 




RSA works through the use of two types of key: the public key and the private key. Each user of a device has their own set of these keys. As suggested by the name, the public key is the key which is made available to every system to see, whilst the private key is known only to the owner. 

There are two ways this can operate. One way is when the public key is used as the encryption key to turn the plaintext into cipher and the private key used for decrypting it. Going back to our scenario, if John sent Janet a message, it would be turned into cipher through the use of his public key. Once the cipher is sent over the network to the woman, it can be decrypted back into its original form using the woman's private key. If Janet were now to reply and send a message to John, a similar thing would happen. 

Now what significance does this have? Well, encrypting with a public key means that anyone can encrypt the plaintext message into the cipher. However, since the recipient uses their private key to decrypt it, this means that only the recipient can view the message and nobody else. So even if a hacker was able to access the data being exchanged, they would only have the cipher equivalent - since they do not know the private key of the intended recipient, they would have a hard time trying to crack the code. 

By now, you would have worked out what the second way is. Simply, the same as the previous method except this time, it's the other way round! John uses his private key to encrypt the message, which can only be accessed as plaintext format using Janet's public key. That means only John can send the message for anyone to see. But why on earth would anyone want to do that? 

If John wanted to send Janet £150, the system in charge of recording these transactions would say something like this: 
"John gave Janet £150"

In this scenario, you can see that only John can perform such a task. It is very unlikely for a hacker to be able to tamper with this as they would need to gain access to John's private key in order to send something as valuable as money. 

This creates some sort of proof that John sent Janet £150, as this transaction was made using John's private key, not anyone else's. This is called a digital signature. Signatures are a way of verifying who did what, so that it is clear that John sent money. 






In conclusion, we have had a look at what cryptography is, how it works, a specific type of cryptography, and where it can be used in real life. But cryptography is so much more that just that, and for me to fit all the wonders of it into this one blogpost would be impossible. What you need to take away is that cryptography is one of the key elements of cyber security and is used by all companies and authorities to secure their precious secrets. Not so much like the Matrix now, I reckon...



Comments

Popular posts from this blog

World Autism Awareness Month

My Journey As A Young Carer

The Political Crusades: Independent India