In the last part we discussed cryptocurrency. There was some discussion of cryptography then too. Today, though, the discussion will be about cryptography in detail. For those who did not read the last part, let me go over the basics once more.
What is cryptography?
The idea of cryptography comes from the word crypto, and the word crypto means secret or hidden. So cryptography, put into Bengali, comes out as ‘তথ্যগুপ্তিবিদ্যা' — the science of hiding information. The mystery is right there in the name. That is, cryptography is a kind of science used to conceal or hide information.
Let me give the same example as last time. Mr Rafiq is going to build a website where all the officers of his office will log in and do all their work. For that he created a database, in which usernames and passwords would be kept. The problem is that anyone who can get into the database will get the passwords. So he did one thing: he hid the passwords using an md5 hash. As a result the passwords became unintelligible, and security was preserved.
The question is, what was the need to hide the information? Suppose a man named Shafiq works in the IT department of that same office, and all the database work passes through his hands. Shafiq could learn a password whenever he liked, get into someone's account, do something wrong and land that person in trouble. Let me put it more simply. Suppose your enemy learns your Facebook password. Now he gets into your account, deletes everything, and sends absurd messages to various people and makes posts. Is that not dangerous? So making passwords safe really is essential. I hope you can see the need.
The uses of cryptography
Cryptography is used both in the virtual world and in the real one. At present, though, its use in the real world is next to nothing, because computing has reduced the field of application in the real world.
The famous detective Imran is sitting in his office. The police intelligence department is going to arrest an accused man. He cannot be found by any means. But they have got one clue: at the accused's house they had found a small scrap of paper — dropped by mistake, perhaps. On the paper was written,
“Bhorer Lash” (ভোরের লাশ)
But nobody could work out whose corpse it meant, or what it meant at all. Imran finally managed it. There are two words here. Taking the first syllable from each gives,
“Bhola” (ভোলা)
which is the name of a district. That is how they found the accused's present location. Those of you who read detective stories as children will know about such things. This arrangement for hiding information is exactly what cryptography is.
In computing, or data science, its use is of another kind. A computer essentially has no intelligence of its own, and the artificial intelligence of computers has not advanced far enough to pull information out of any arbitrary code — that is something only a human can do. In computing, various encryption systems are used. And beyond those there are of course the various hashing systems.
Terminology
To understand cryptography you have to understand some terms; otherwise you will not follow the discussion ahead. Let me shed a little light on them:
1. Plain text: the original writing, without encryption, is called plain text. Anyone can read it. Everything I have written in this article is plain text. You needed no special arrangement to read it.
2. Ciphertext: the strange-looking writing you get after encryption, which cannot be read directly, is called ciphertext.
3. Encryption: the method of turning plain text into ciphertext is called encryption.
4. Decryption: the method of converting ciphertext back into plain text is called decryption.
Now let's move on to the important part of the discussion.
How cryptography works
Cryptography essentially creates ciphertext on the basis of a kind of algorithm. This is essentially a mathematical function. The algorithm is built depending on a public and a private key. This key can be any number or word. Generally a key is made from random numbers or words, or a mixture of numbers and words.
What is a key?
We all know that a key is what opens a lock. If you lock a house and leave, you need a key to get in. In the same way, if you lock data, how will you open it without a key? That is why an algorithmic key is needed.
Suppose you make ciphertext by turning A into D, B into E, C into F and so on. This is called a Caesar cipher. But there are only 26 letters in English in all, so your route to encryption is a short one. Now think: would it be any trouble at all for a computer to break this small algorithm of yours? Certainly not. In a moment the thief will break your lock and take all the data 😰
That is exactly why something stronger is needed, and that is why such useful things as the public key and the private key have appeared. Two keys are used in this case. Suppose America and Russia are at war. The Americans are going to send some ciphertext to their soldier. The problem now is this: if there is one key for it and the Americans send that along with the ciphertext, the Russians will easily get that key, break the ciphertext and have the plain text! So what is the way out?
That is why two keys are kept. First the soldiers will create two keys, public and private. They will keep the private key with themselves and send the public key to the American headquarters. From the American headquarters the plain text will be converted into cipher code using the public key and sent to the soldiers. The soldiers cannot decrypt it with the public key, though. Decryption will happen only with the private key.
Now the real fun. Let's assume the Russians got hold of the American soldiers' public key when the soldiers sent it to headquarters. But there is no gain in it. The public key will only encrypt; it will not decrypt 😉. So the power to decrypt is in the hands of the American soldier alone, and nobody else's. Therefore the data stays fully protected by this method 🔥
Anyway, I did not go any deeper. Cryptography is a huge subject — telling it properly would take a book. Even so, I have presented the important points simply. I have not gone into the mathematical analysis. In fact the world of computing is a gift of mathematics: such beautiful solutions are being built with maths. And one man must be thanked for all of this — Muhammad ibn Musa al-Khwarizmi, for the algorithm. Through his invention of algebra and the algorithm he took mathematics to an extraordinary height, and so much has come to the world of computing as a result!
For those of you who want to know more, let me say this. You will notice that in every piece I write I put the English terms in brackets. Search Google with those and you will find everything. That is all for today.



