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.urandom
hashlib.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

Taught in

References