# Overview of Cryptography — PART 1

Every now and then we read about cyber crimes on news where an unauthorised person retrieves and misuses private information such as credit card information, emails and personal details. Many of these cases are directly related to cryptography. If you are someone who is interested in computers and technology it is good to know about these incidents and even better to have an idea about what cryptography is.

In simple words, cryptography is a way to protect your messages while they are being transmitted on a channel. These messages can be any data that you sent or receive over the internet. Cryptography can be classified into symmetric and asymmetric.

Symmetric cryptography works in a very simple way. Imagine you (Alice) want to send a message to your friend (Bob) over some unreliable channel. At the very beginning Alice can either meet Bob or can send a key to him using some reliable channel (there are ways to generate same keys without compromising the security, but that is a topic to be discussed later). You can think of this key as something that will lock and unlock a box which contains the message . So now every time Alice want to send a message to Bob, she will write the message , put it in a box and lock it with the shared key. Bob after receiving the box will be able to unlock it using the same shared key and read the message. As you might have already realised, anyone (Oscar) with bad intentions will not be able to read the message while the box is in transit as he will not have the key to unlock the box. So the main idea behind this type of cryptography is that both parties (sender and receiver) will share a key to encrypt(lock the box) and decrypt (unlock the box) the data (message) and hence the name SYMMETRIC CRYPTOGRAPHY.

Asymmetric cryptography works in rather a complex way. As discussed above, for the symmetric cryptography to work the parties still need to share the keys using some reliable channel. Well, this might not always be possible. In fact in most cases using symmetric cryptography is not feasible. To understand how asymmetric cryptography works we can use the same case discussed above where you (Alice) want to send a message to your friend (Bob) but this time without sharing a key. For asymmetric cryptography to work both Alice and Bob will have a pair of keys. These keys are called public (known to everyone) and private (known to owner only) keys. So Alice will have a private and public key and so will Bob. The box can be only locked and unlocked using the combination of these keys i.e. if the box is locked using A’s public key , it can only be unlocked using A’s private key or vice-versa(the way it works is due to mathematical properties of the keys which has not been explained to keep this simple). Alice will write her message and put it in a box. She will then lock this box using Bob’s public key as this key is known to everyone and then send it to Bob. Bob will receive the Box and will unlock it using his private key which is known only to him. Anyone (Oscar) who might be able to access the box will not able to open it as he does not have Bob’s private key. Well, the message is securely transmitted but there is one problem i.e. how will Bob know that the Box was really sent by Alice. What if Oscar wrote the message and put Alice’s name on it to trick Bob? He would be able to do so because even he knows Bob’s public key and will simply put the message into a box with Alice’s name on it. The solution is pretty simple and straightforward. Give it some thought or you can always google it :) . If and when I post my next blog, I will surely include the solution.

*More details on symmetric cryptography will be included in PART 2 !!*