Tuesday, November 15, 2016

End to end encryption

WhatsApp recently added end-to-end encryption to its app, for increased security. But, what exactly is it? Let's take a very simple example to see how it works. Consider two users, Alice and Bob.
Assume Alice wants to send Bob a message, which is 24.

Alice and Bob both generate a pair of "keys"; for simplicity and explanation in this example, we'll consider keys as arithmetic operations.

So the two keys that they generate are called public and private keys; public keys are visible to everyone, while only the user knows his private key.

These work in pairs, so something encrypted with a user's public key can be decrypted with his private key, and vice-versa.

So let's say Alice's "keys" (or arithmetic operations in this example) are as follows: her public "key" is "*2" or multiply by 2 operation. Therefore, her private "key" will be "/2" or the divide by 2 operation. In real life, deciphering the private key from the public one isn't easy.

For Bob, let's assume his private "key" to be "*3" and his public "key" to be "/3".
Now, Alice wants to send the message "24" to Bob. What she does is she encrypts it with her private key and his public key, so that Bob can decrypt it with her public key and his private key. The public keys are stored in a global directory, so anyone can access them.
So, Alice encrypts 24 with her private key; so, 24 becomes 12, and then she further encrypts this with his public key; so, 12 becomes 4.

Bob, on receiving the message, first decrypts it with her public key; so, becomes 8. Then, he decrypts that with his private key. So 8 becomes 24, which was the original message.

Hope that was a good explanation. Leave your thoughts in the comments!

No comments:

Post a Comment