Skip to content
uencoder

Key Derivation

Key derivation is the process of generating encryption keys from low-entropy passwords or high-entropy master keys, using KDFs (e.g., PBKDF2, scrypt, Argon2) to raise the cost of brute force.

Purpose

It turns human passwords (low entropy) into sufficiently long encryption keys while resisting dictionary and rainbow-table attacks.

Mechanism

A KDF takes a password, salt, iteration/cost parameters, and output length, and produces a pseudorandom key. Iterations multiply the per-attempt cost; salt prevents precomputed tables; memory-hard KDFs (scrypt/Argon2) additionally resist GPU/ASIC parallelism.

Use cases

  • Encrypted storage of user passwords
  • Disk-encryption master key derivation
  • TLS session key derivation (HKDF)
  • API token generation

Examples

  • Input
    password + salt + 100000 iters
    Output
    256-bit key

    Iterations multiply the cost

Common errors

Hashing passwords with a raw SHA (no salt, no iterations)
Use PBKDF2, scrypt, or Argon2

Related terms

Related tools

References