Glossary

Hashing

Hashing feeds data of any size through a function that returns a fixed-size value, called a hash or digest. The same input always gives the same output, and the process cannot be run backward.

What properties make a hash function useful?

Every hash function is deterministic and produces output of a fixed size. Cryptographic hash functions add three harder guarantees. Preimage resistance: given a hash, you cannot find an input that produces it. Second preimage resistance: given one input, you cannot find another with the same hash. Collision resistance: you cannot find any two inputs that share a hash. On top of that, a tiny change in the input, even one bit, flips about half the output bits, which is called the avalanche effect. Non-cryptographic hashes keep the determinism and speed but drop the security guarantees.

How is hashing different from encryption?

Encryption is reversible by design: with the key, ciphertext turns back into plaintext. Hashing has no key and no way back; a hash is a fingerprint, not a container. You encrypt data you need to read again later, and you hash data you only need to compare or verify. Confusing the two leads to the classic mistake of encrypting passwords, which means anyone who steals the key can read every one. Encryption covers the reversible side.

Where does hashing show up on a server?

UseTypical functionWhat the hash does
File integrity and downloadsSHA-256, BLAKE2Proves content is unchanged; see File Hash
Password storageArgon2id, yescrypt, bcryptStores a slow, salted fingerprint instead of the password
Message authenticationHMAC-SHA256Proves a webhook or API request came from someone with the shared secret
Digital signaturesSHA-256 or SHA-384 inside RSA or ECDSASigns the short digest rather than the full document
Hash tables and cachesSipHash, xxHash, MurmurHashFinds a bucket in memory in constant time
Sharding and load balancingConsistent hashingMaps keys to nodes so few keys move when a node changes
Version controlSHA-1 hardened, moving to SHA-256 in GitNames every commit and file version

Why are passwords hashed with slow functions?

General hashes like SHA-256 are built for speed, and fast is bad here: a graphics card can try billions of SHA-256 guesses per second against a stolen list. Password hashing functions are deliberately slow and memory hungry, so each guess costs real time and RAM. A random salt stored with each hash makes identical passwords produce different hashes and defeats precomputed tables. Current Debian, Ubuntu, AlmaLinux and Rocky Linux releases store system passwords in /etc/shadow with yescrypt or SHA-512 crypt; the prefix of each entry tells you which:

awk -F: '$2 ~ /^\$/ {split($2,a,"$"); print $1, "scheme=" a[2]}' /etc/shadow
grep -E '^ENCRYPT_METHOD|^YESCRYPT_COST_FACTOR' /etc/login.defs
python3 -c "import hashlib,os; s=os.urandom(16); print(hashlib.scrypt(b'demo-only', salt=s, n=2**14, r=8, p=1).hex())"

A y scheme means yescrypt, 6 means SHA-512 crypt. Web applications should use their framework's Argon2id or bcrypt helpers rather than a raw hash call; PHP's password_hash() handles salt and cost for you.

What is an HMAC and why do webhooks use it?

An HMAC mixes a secret key into the hash in a way that resists the length-extension tricks plain hashes allow. The sender computes an HMAC of the request body with the shared secret and sends it in a header; the receiver recomputes it and compares. A match proves the body came from someone with the key and was not changed. Compare the values with a constant-time function such as hash_equals() in PHP or hmac.compare_digest() in Python, so response timing does not leak how many characters matched.

What is consistent hashing?

When a cache or database spreads keys over several servers, the naive approach, hash modulo node count, reshuffles almost every key when a node is added. Consistent hashing places nodes and keys on a ring and assigns each key to the next node clockwise, so adding one node moves only the keys in its slice. Memcached clients, many distributed databases and some load balancers rely on it. In-memory caches and stores covers cache clusters on our machines.

Which algorithms should I avoid?

  • MD5 and SHA-1 for anything security related, since collisions can be produced on purpose.
  • Any fast general hash for passwords, even with a salt.
  • Homemade constructions such as hashing a secret concatenated with data instead of using HMAC.

Hashing is cheap on modern CPUs with SHA extensions; even the S1 computes SHA-256 at well over a gigabyte per second per core.

Machines for Hash-Heavy Services

ServerProcessorCores / threadsMemoryStorageNetworkPer monthSmallest order
S1Intel Xeon E-2276G6 / 1264 GB DDR41x 1 TB NVMe2x 10 Gbps$53.32$53.32 (1 month)
S4Intel Xeon E-2388G8 / 1664 GB DDR41x 1 TB NVMe2x 10 Gbps$87.52$87.52 (1 month)
S11Intel Core i9-14900K24 / 32128 GB DDR52x 2 TB NVMe2x 10 Gbps$149.39$149.39 (1 month)

Keep Reading

File Hash

A short fingerprint computed from a file, how it proves downloads and backups are intact, and the commands to create and verify one.

Open

Encryption

How encryption turns readable data into ciphertext, symmetric versus public key methods, and where to encrypt data on a server.

Open

In-memory caches and stores

Redis, Valkey or Memcached on machines with 128 GB to 1 TB of RAM, sized with snapshot headroom and NUMA in mind.

Open

Linux user management

The full life of an account on a server: create, group, change, expire, lock, audit and delete, with the files behind each step.

Open

FAQ

Quick Answers

No. A cryptographic hash is one-way. Attackers can only guess inputs and compare the results, which is why weak passwords remain at risk.

A random value stored with each password hash so that identical passwords produce different hashes and precomputed tables do not work.

Argon2id, yescrypt or bcrypt. These are deliberately slow and resist large-scale guessing.

A hash has no key. An HMAC combines a secret key with the data, so only key holders can create a valid value.

Yes. It is the standard choice for integrity checks and signatures, with no practical attacks known.