How does encryption work?


We all rely on it – and virtually every form of digital technology uses some variant of data encryption. But just how exactly does data encryption work?

In its basic form, data encryption uses an algorithm called a cipher in order to turn normalized data (plain text) into a series of random characters (cipher text) that is then unreadable by those without a special key to decrypt it. It's usually done one via one of two methods: Public key (asymmetric) encryption and Private key (symmetric) encryption.

Both methods allow a user to encrypt data to hide it from others, and then decrypt it in order to access it. Bu there are some difference, primarily in how they handle the steps between encryption and decryption. did a great job summarizing the difference using a real work example: 

"Public Key – or asymmetric – encryption uses the recipient’s public key as well as a (mathematically) matching private key.

For example, if Joe and Karen both had keys to a box, with Joe having the public key and Karen having a matching private key, Joe could use his key to unlock the box and put things into it, but he wouldn’t be able to view items already in there, nor would he be able to retrieve anything. Karen, on the other hand, could open the box and view all items inside as well as removing them as she saw fit by using her matching private key. She could not, however, add things to the box without having an additional public key.

In a digital sense, Joe can encrypt plaintext (with his public key), and send it to Karen, but only Karen (and her matching private key) could decrypt the ciphertext back into plaintext. The public key (in this scenario) is used for encrypting ciphertext, while the private key is used to decrypt it back into plaintext. Karen would only need the private key to decrypt Joe’s message, but she’d need access to an additional public key in order to encrypt a message and send it back to Joe. Joe on the other hand couldn’t decrypt the data with his public key, but he could use it to send Karen an encrypted message.

Where Private Key – or symmetric – encryption differs from Public Key encryption is in the purpose of the keys themselves. There are still two keys needed to communicate, but each of these keys is now essentially the same.

For example, Joe and Karen both possess keys to the aforementioned box, but in this scenario the keys do the same thing. Both of them are now able to add or remove things from the box. Speaking digitally, Joe can now encrypt a message as well as decrypting it with his key. Karen can do the same with hers." 

Mashable did a great video on the subject as well:  


Back to Blog