Justin Moore – October 14, 2024
In our increasingly interconnected world, safeguarding our data is first. Cryptography is the secret art of communicating privately in a public environment. Two components that often confuse people are encryption and hashing — two processes that serve different yet essential purposes.
Encryption
What you may hear more often is the term encryption, which is a process that turns plaintext (human readable text) into ciphertext (non-readable text). Human readable text is exactly what it sounds like, the very words you are reading now are plaintext! At a very high-level encryption is just a mathematical algorithm (set of instructions) that generates something called encryption keys. Think of this as a digital key that can lock, unlock, or a combination of both. Encryption can be broken down into two categories, symmetric and asymmetric.
Symmetric encryption generates a single key, that encrypts and decrypts (turns ciphertext into plaintext). Of the two it is the fastest, but key management is more difficult. For example, let us say we have a Microsoft word document we want to send to our boss. We use our symmetric encryption key to encrypt the document. To decrypt the document our boss would also need the same key, presenting the downside of symmetric encryption. Symmetric encryption is much faster than asymmetric encryption but lacks secure key management.
Asymmetric encryption is much slower than symmetric encryption, but in terms of being secure it excels! Asymmetric encryption generates a pair of keys, a public key, and a private key. If you encrypt with one key, you can only decrypt with the other. The public key can be shared, but your private key must be kept by you in a secure location.
Hashing
Hashing is a one-way (non-reversible) conversion of plaintext into an unreadable format often called hexadecimal notation. Hexadecimal or hex for short, is a base-16 numbering system (multiples of 16) combination of numbers (0-9) and letters (A-F) that represent bigger numbers. The main objective of hashing is to verify the integrity of data (that it hasn’t changed). This process happens by data, inputting that into a hashing function (mathematical formula) that outputs a fixed-length string of hex characters.
How does this check the integrity of data? Well, imagine you’ve downloaded a large file from a website. To ensure that the file hasn’t been tampered with or corrupted during the download, the website provides the hash value (output of hashing function). You can hash the file yourself and compare it to the hash value provided by the website. If there are any differences between the two hash values, the files do not match. That’s what makes hashing so powerful, even if the data is missing a period, the hash value will be completely different.
There are so many types of encryption algorithms, encryption methods, and hashing functions, so much so it could take days to cover them all. Some even combine symmetric and asymmetric encryption, such as hybrid cryptography, and others blend cryptography, hashing, and digital signatures, like signcryption. However, that is beyond our scope for today. While encryption ensures that data stays private, hashing guarantees the integrity of that data. Both processes are essential pillars safeguarding our information as we navigate the ever-changing digital world