salt
An extra value mixed into data before hashing so that otherwise identical inputs produce different hashes.
In more detail
In password storage a random salt per user stops attackers from using precomputed tables. Salts are not secret; they only make each hash unique.
Examples
salts = {"amara": bytes(16), "ben": bytes(15) + b"\x01"} # demo; use os.urandomhashlib.scrypt(password.encode(), salt=salt, n=N, r=R, p=1)computeTaskFingerprint(buildTask, "prod")Build fingerprints use the deployment stage as a salt so staging and production cache keys never collide.salt = os.urandom(16)Related terms
- password hashing — Storing a password as the output of a deliberately slow, salted hash function, so a stolen database does not reveal the passwords.
- rainbow table — A huge precomputed lookup table that maps password hashes back to the passwords that produced them, so cracking becomes a quick lookup.
- scrypt — A memory-hard password hashing function that is slow and needs lots of memory, so guessing passwords in bulk is expensive.
- Argon2 — A modern password hashing function that is deliberately slow and needs a lot of memory for every guess, which makes stolen password hashes very expensive to crack.
- hash — A short fixed-length fingerprint calculated from data, which changes completely if even one byte of the data changes.
- cache — A store of earlier answers kept close to where they are needed so they can be reused instead of fetched or computed again.
Taught in
- Cryptographic Hashing: SHA-256, SHA-3 & Passwords — Cybersecurity Fundamentals, GRC & Cryptography
- Data States: Security at Rest, in Transit, and in Use — Cybersecurity Fundamentals, GRC & Cryptography
- Data Loss Prevention & Egress Monitoring — Cybersecurity Fundamentals, GRC & Cryptography
- Unified Build Pipelines: Caching & Dependency Graphs — Production Full-Stack Engineering
- Authentication Versus Authorisation — Application Security & Threat Modeling for Engineers