PUBLIC KEY CRYPTOGRAPHY(snippet)

The basic idea of cryptography is you convert some meaningful information into essentially garbage(random noise) and send across to somebody else and they try to decrypt or make sense out of it.

MOTIVE:The main motivation behind doing this is to not let anyone who would eavesdrop on your communication get the data.

The OLD Approach:
Lets go back to the good old perilous days of having a vulnerable communication network.

HELLO —-key—->IKEHL—-key—->HELLO

Here,essentially the sender will encrypt the data ‘HELLO’ using a key and that encrypted data is converted back to original data by the receiver using the same key.
So now you would want the ‘key’ to be sent securely from sender to receiver, which is highly inconvenient because a secure connection itself requires a key.If anyone finds out your key the security of whole system is compromised.

To combat this inconvenience we use,
PUBLIC KEY CRYPTOGRAPHY.

Public key cryptography essentially contains two keys, let’s say key A and key B.
You CANNOT guess one key from other but they are LINKED in such a way that anything encrypted with key A can only be decrypted by key B.
Both key A and key B form a key pair. You assign one of the key as public key,which you announce it to the world, and another key as private key,which you keep secret.

There are three perspectives associated with it:
CASE 1:(Simple)
You have the public key ,you encrypt the message and send it to me, You know that i have the secret private key and i can decrypt the message and acquire it.
CASE2: (Very Interesting)
I have a private key and i encrypt the information using private key and send it you, you would think that this doesn’t make much sense because why would i encrypt something for which everyone has a public key and everyone can read it.
Wait a minute!!
The fact that it can be decrypted with a public key must mean that it has to encrypted by my private key and, i am infact the real sender of the message and not anyone else.
CASE 3:
Now you encrypt the message using both Key A and Key B i.e private and public key. In such case, when message is decrypted at the receiver end, when you decrypt the message using public key you know that it is infact the right sender, also when you decrypt the message using private key you get the right information.

NEXT UP, Diffie Hellman Key Exchange.

Leave a comment