Cryptography Demystified: How to Hide Information Using Math

by Daniela Danilova

For many of us, paying with a credit card is second nature. You take out the thin, shiny rectangle and press it against the scanner, instinctively waiting for the robotic beep to inform you that all has gone well. We take the safety and security of credit card transactions for granted, and rightfully so. Can you imagine how unsettling it would be to worry about your bank account being drained every time you pay for your morning coffee? We can thank cryptography for this peace of mind in our daily digital dealings.

Cryptography is the study and application of encryption, or information-concealing techniques, as well as its counterpart, decryption, or the revealing of this information. It investigates how to keep data in the hands of those who are authorized to have it and away from the prying eyes of those who are not. When you think of cryptography, you probably imagine movie scenes of mysterious coders vigorously typing away until they triumphantly shout, “I’m in!” as data magically appears before them. Despite the media’s modern portrayals, the art of cryptography is nowhere near a recent invention. 

The history of cryptography dates back thousands of years. One of the earliest examples comes from Mesopotamia, around present-day Iraq, where clay tablets were found with encoded recipes for ceramic glaze, a possible trade secret. Later, around 650 BC, the Spartan army of ancient Greece used constructions called scytales in their military communication. A scytale is a type of transposition cipher, which scrambles the letters of a message in a pattern known to the encoder but not apparent to someone who did not witness the encryption process. It consists of a message written on a piece of leather and wrapped around a hexagonal piece of wood, the scythe itself. Although the text on the leather strip appears as a jumble of letters, when wound about a correctly-sized scythe, the letters transform into a readable report. The catch is that the right scythe size is known only by a select few. 

A pair of scytales. Image source

At its root, data in cryptography can be present in the form of encoded ciphertext or decoded plaintext, and a process called encryption uses keys to convert between the two. A key is a series of numbers or letters that, when passed through the encryption algorithm, can “unlock” the hidden coded message or hide it again. It is important for the keys to be generated randomly to prevent them from being guessed. Today, keys are incorporated in two main encryption systems. In symmetric encryption, a single shared key is used to both encrypt and decrypt messages; this method is employed in banking to prevent identity theft. In asymmetric encryption, a person uses a public key to encrypt their data, which can then be sent to its destination and decoded by a private key, held only by the intended recipient. This way, no one else can view, and possibly steal, the data along the way. One algorithm that uses asymmetric encryption is known as RSA, which keeps Internet users from being spied on as they input sensitive data into websites. While browsing, you can easily tell whether RSA is being used by looking at the beginning of the website line: “HTTPS” is encrypted, while “HTTP” is not. 

Symmetric and asymmetric encryption differ in the types of keys used to decipher information. Image source

From e-commerce to email, encryption is used in nearly every context where data is shared over the web, and its protection has allowed us to reliably carry out many daily tasks in a digital environment. With the need for online security steadily growing, cryptography is sure to continue to evolve towards even faster and more extensive models. 

Edited by Tiffany Ko