Skip to main content
Definition Website Computer and Technology

Cryptographic Salt

Subject: Computer and Technology noun /ˌkrɪp.təˈɡræf.ɪk ˈsɔːlt/ 1 definition

  1. Definition (noun)

    Entry #342 · Updated

    A Cryptographic Salt is a unique, non-secret sequence of random bytes combined with an input—most commonly a user password or secret passphrase—before passing it into a one-way cryptographic hash function or key derivation function (KDF). During credential registration or key derivation, the system generates fresh salt bytes from a cryptographically secure pseudorandom number generator (CSPRNG), combines them with the plaintext input (by concatenation or as an explicit algorithm parameter), and stores the unencrypted salt alongside the resulting digest for later verification. Because a distinct salt changes the effective input for every record, identical plaintexts produce completely different output digests, neutralizing precomputed rainbow tables, concealing duplicate passwords across accounts, and preventing parallelized multi-target brute-force attacks. Unlike a secret key or cryptographic pepper, a salt does not require confidentiality and does not slow down individual guesses on its own; instead, its security relies on uniqueness and sufficient entropy paired with slow, memory-hard hashing algorithms.

    Common Forms

    • Per-Record Random Salts: Generated uniquely for each credential or stored secret using a CSPRNG (typically 16 bytes or more) and persisted alongside the hash—often inline within standardized encodings such as Modular Crypt Format—so identical passwords yield unrelated digests.

    • Key Derivation Function (KDF) Salts: Non-secret inputs supplied to key-derivation primitives such as PBKDF2, scrypt, and HKDF to separate derived keys across independent domains and extract uniform randomness from non-uniform shared secrets.

    • Protocol-Transmitted User Salts: Stored per-account salts sent by an authentication server to a client during password-authenticated handshakes—such as SCRAM-SHA-256 or SRP-6a—so the client can compute the salted verifier locally without sending the plaintext password over the wire.

    • Static or Deterministic Salts: Fixed application-wide constants or salts derived deterministically from identifiers like usernames; because these allow attackers to reuse precomputed tables across password changes or target an entire database uniformly, per-record random salts are strongly preferred.

    Example

    When a user registers on a web application with a password, the authentication service calls crypto.randomBytes(16) to generate a unique 128-bit salt (b02a54a71d84100e5329bc4a8765b9ba) and passes both inputs to Argon2id, saving the resulting PHC string $argon2id$v=19$m=19456,t=2,p=1$sCpUpx2EEA5TKbxKh2W5ug$<digest> in the users table. If another user picks the exact same password, the service generates a different salt and stores a completely unrelated digest, preventing an attacker who dumps the database from identifying matching passwords or using a single precomputed lookup table across accounts.