Data Encryption



Encryption is the process of using some sort of mathematical formula or algorithm to turn some sort of plaintext into an unreadable format called “cyphertext”. This cyphertext is unreadable to anyone, ensuring that the content of the plaintext is kept secret from all but authorized subjects. Authorized subjects are able to decrypt the cyphertext back into plain text by running the cyphertext through the decryption algorithm.

This wouldn’t really work very well if the only thing that is being used is some sort of algorithm because as soon as that is discovered, any subject would be able to decrypt private messages. This is where the idea of a key comes from. If I come up with some sort of randomized key that I also apply to an encryption function, I could secretly share the key to another subject, and now it doesn’t matter if the encryption algorithm is known by anyone because as long as nobody knows my secret key, they cannot decrypt my messages.

The best way to relate this idea to the real world is to think about pad locks. You can go to the store and hanging on the racks are padlocks that all look the same, and when you think about it, the logic that handles the locking and un-locking mechanism is the same for all of the padlocks from the same brand. You can openly examine the padlocks up and down and even break it open if you want. The problem is that without the key paired to any specific padlock you want to open, you are SOL.

Symmetric Key System
There are two types of keys. The first type is what is called a symmetric key system. This is where you and another subject both hold a secret key that you can apply to each other’s encrypted plain text to successfully decrypt it. The downside of this is as the people you are communicating with grow in number, you must keep track of all the single, separate keys you hold for communication between each person.

Public Key System
The solution to this problem is what is called a public key system. This is where there are two keys, one that you keep private to yourself and one that you give to the public. If somebody wants to send you an encrypted message, they simply encrypt it using your public key, and only your private key will be able to decrypt it.

This is awesome, but typically asymmetric key algorithms are relatively slow compared to their symmetric counterparts. This is where the idea to use an asymmetric system to produce symmetric keys for people who would like to send encrypted messages to each other come in. Now instead of having to use relatively long decryption and encryption times that comes with asymmetric keys, you can do that once to pass a secret shared key to someone you would like to talk to, and now the encryption and decryption times are much slower.