# What Is Cryptography?

Cryptography puts the “crypto” in cryptocurrency. It has existed much longer than our digital age and has evolved like languages over the centuries.

Cryptography is the science of securing information by transforming it into a form that only intended recipients can process and read. Its first known use dates back to the year 1900 BC as hieroglyphics in an Egyptian tomb. The term itself comes from the Greek words kryptos and graphein, which mean hidden and to write, respectively.

One of the most famous uses was developed by Julius Caesar around 40 BC and was aptly named Caesar’s cipher. A cipher uses a secret piece of information that tells you how to scramble and therefore unscramble a message. Caesar used a substitution cipher, where each letter of the alphabet was replaced by a letter in a different fixed position further up or down in the alphabet. For example, the alphabet could be moved five places to the right meaning the letter “A” would now be “F”, “B” would now be “G” and so on. That meant he could pass along messages without fear of them being intercepted, because only his officers knew how to unscramble the message.

Giovan Battista Bellaso, a 16th-century cryptologist, designed the Vigenere cipher (falsely attributed to diplomat Blaise de Vigenere), believed to be the first cipher that used an encryption key. The alphabet was written across 26 rows, with each row shifting a letter to create a grid. The encryption key was written out to match the length of the message. Then, the grid was used to encrypt the message, letter by letter. Finally, the sender shared the encrypted message and the secret keyword to the recipient, who would possess the same grid.

Then along came computers, which enabled much more sophisticated cryptography. But the goal remains the same: to transfer a readable message (plain text) into something an unintended reader cannot understand (cipher text). The process is known as encryption and is how information can be shared across public internet connections. The knowledge about how to decrypt – or unscramble – the data is known as the key and only intended parties should have access to this information.

## How does cryptography work?

There are many ways in which to encrypt information, and the levels of complexity depend on the degree of protection the data may require. But we commonly see three types of cryptographic algorithms.

### Symmetric encryption

Symmetric encryption – or secret-key encryption – relies on a single key. This means that the sender and receiver of data both share the same key, which is then used both to encrypt and decrypt the information.

To do that, the secret key needs to be agreed upon ahead of time. While still a good source of encryption, the fact that there is only a single key protecting the information means there is some risk when sending it over insecure connections. Just imagine you want to share your front door key with a friend by hiding it under your doormat. Your friend now has access to your house. But there is also a chance a stranger could find the key and enter without your permission.

### Asymmetric encryption

Asymmetric encryption – or public-key encryption – uses a pair of keys. This added level of security instantly increases the protection of the data. In this case, each key serves a single purpose. There is a public key that can be exchanged with anybody, over any network. This key has the information on how to encrypt the data and anyone can use it. But there is also a private key. The private key is not shared and holds the information about how to decrypt the message. Both keys are generated by an algorithm that uses large prime numbers to create two unique, mathematically linked keys. Anyone with access to the public key can use it to encrypt a message, but only the private key holder can decipher the message.

It works almost like a mailbox. Anyone can put a message into the deposit slot. But only the owner of the mailbox has the key to open it and read the messages. This is the foundation for most cryptocurrency transactions.

### Hash functions

Hash functions are another way cryptography can secure information. But instead of using keys, it relies on algorithms to turn any data input into a fixed-length string of characters.

Hash functions also differ from other forms of encryption because they only work one way, meaning you cannot turn a hash back into its original data.

Hashes are essential to blockchain management because they can encrypt large quantities of information without compromising the original data. Having an organized way to structure data not only increases efficiency, but hashes can also act like digital fingerprints for any data that’s been encrypted. This can then be used to verify and secure against any unauthorized modifications during transport through networks. Any changes to the original data would result in a new hash, which would no longer match the original source and therefore would not be verifiable on the blockchain.

## Digital Signatures

A digital signature is another key aspect of ensuring the security, authenticity and integrity of data in a message, software or digital document. As their name suggests, they act similarly to physical signatures and are a unique way to bind your identity to data and therefore act as a way to verify the information. But rather than having a unique character to represent your identity like with physical signatures, digital signatures are based on public-key cryptography. The digital signature comes as code, which is then attached to the data thanks to the two mutually authenticating keys. The sender creates the digital signature by using a private key to encrypt the signature-related data, with the receiver getting the signer’s public key to decrypt the data. This code acts as proof that a message was created by the sender and that it has not been tampered with while being transferred, and it ensures that the sender cannot deny they sent the message.

If the recipient is unable to decrypt and read the signed document with the provided public key, it shows there was an issue with the document or signature, and so the document cannot be authenticated.

## Cryptography and Crypto

A large draw of cryptocurrencies is their security and transparency on the blockchain. All of that relies on cryptographic mechanisms. That is how most blockchain-based cryptocurrencies maintain security, and therefore it constitutes the very nature of cryptocurrencies.

It was on a cryptography message board back in 2009 that Bitcoin creator Satoshi Nakamoto suggested a way to solve the double-spend problem that had long been the Achilles heel of digital currencies. The double-spend problem occurs when the same unit of crypto has the potential to be spent twice, which would destroy trust in them as an online payment solution and make them essentially worthless.

Nakamoto proposed using a peer-to-peer distributed ledger that was timestamped and secured by cryptographic means. That led to the creation of the blockchain as we know it today. As with all technology, cryptography will evolve to keep up with the demands for a secure digital environment. This is especially true with the growing adoption of blockchains and cryptocurrencies across industries and borders.