Saturday, November 11, 2017

Cryptography

There are two things that we do all the time. Communicate and share information with each other. With the invention of the internet, we started doing those things online and this has risked our privacy. Also, we do tons of online transaction every day. All these things need to be secured or hidden so that no third person or party takes hold of our data. This gives rise to the invention of Cryptography. Well, Breaking down crypto means hidden and graphy means writing. So, cryptography is to make data secure, protected and make data accessible only to the sender and receiver.
What is Cryptography?
It is a process of converting Plain text into some encrypted text that can only be read by the authorized users. The sender writes the information in his/her language and this information is encrypted and sent over the transmission channel so that any third party intercepting the transmission couldn’t read the actual information and it gets decoded correctly at the receiver’s end.

There are two main terms in Cryptography – Cipher and Key.
Cipher – It is the set of rules deciding how the data or the information to be Encrypted. Basically, the algorithm used.
Key – the most important thing in cryptography is it’s key. In modern Cryptography, Ciphers are publicly available and it is the key that makes our data hidden from prying eyes. Keys are basically how to arrange the alphabets in the ciphertext. It varies because if you keep the rotation of alphabets same everytime its easy to decode after some time.

So, Now you know the two basic terms, we can take a brief look at how cryptography works:
When you write a message for your friend, your message is passed through the cipher encrypting function using a unique private key and the resulting text is called ciphertext, which is encrypted. It is passed over the transmission line to the receiver where the receiver uses decrypting cipher and decrypting key(It is same in private key cryptography and different in case of public key cryptography) to get back the original message.
Let's take an ex of Cipher and Key so that you can get the idea.  Let's take a basic algorithm is to add every digit of text with some unique key. Here in cryptography, everyone knows that each letter is added with some random digit. But Which digit is the key to hide the data. For us, let's take 1. So if our message is “rahul” cipher will add a key( 1 in our case) to every digit of rahul. Ciphertext will be “sbivm”. The receiver decrypts by subtracting 1 from the letter and get back “Rahul” again.
This was the most basic example of cipher just to make you understand how it works. There are many advanced modern cryptographic Ciphers available which is computationally tough to break. Cryptographists works day and night to make advance Algorithms and Hackers works to break them.

There are some basic categories in which algorithms fall:-
Private Key Encryption – It is also called as symmetric key encryption. In this technique, Only one key is available to encode and decode the messages.
Public Key Encryption – It is also called asymmetric key encryption. In this technique two keys are available. One is Public key and One is private. Sender encodes the data with the public key and the receiver decodes the data using the Private key.
Hash function – They had no key and they are also called as One-way encryption.

Any Modern Cryptographic Algorithm should follow these 4 rules to be a good Cipher:-
Confidentiality – Information should be hidden and secured.
Integrity – Information could not be altered.
Non-repudiation – Sender and Receiver Cannot say that they had not sent or received the data or information at a later stage.
Authentication – Sender and Receiver can confirm the data to each other.

While we make some good ciphers to help us with privacy, there is always a way to break the code. Most common one is Bruteforce. It is trying all possible combination by trial and error till the message is decoded.  It works with traditional Ciphers as they were easy but the Computational Complexity in modern ciphers doesn’t allow hackers to go for the Brute force as it can take years to decode a message. So, hackers go for frequency analysis. Some words in common English repeat a lot. Like “the” “is”, etc. and if each alphabet is represented by some character they can analyze the repetition of such keywords and can decode the message quite comfortably.
Well, we then used Vigenere cipher which is Polyalphabetic cipher i.e each alphabet can be represented by more than one alphabet in the same text and then it is quite difficult to decode. But still, this code is breakable again using the frequency analysis as the alphabet couldn’t resemble itself and can contain some repeatable words which make it breakable. Well, Enigma Machine was Polyalphabetic cipher machine which Germans used during wars. But Alan Turing made a machine which was able to decode messages. He wasn’t able to break until he got the keyword. Yes, you got it right it was some good things about Hitler. Watch out “The Imitation Game” movie to know about Enigma Machine.
We also have one-time pad Encryption System in which a private key is randomly generated to encode the message. Just the drawback here is Both sender and receiver should have the same key to decrypt the message. So first, we have to transfer the key safely and then the message.

I hope this information helps. Finally, Thank you.   

No comments:

Post a Comment