This site explains how digital privacy tools work — encryption, tracking, and identity protection. It is not legal or cybersecurity advice. What this is.

How a Master Password Derives an Encryption Key

A password manager does not store a master password. Instead, it feeds that password through a mathematical process called key derivation, producing a cryptographic key that is then used to encrypt and decrypt the vault. The master password itself is discarded after this transformation; only the derived key — or the encrypted vault it protects — persists on disk or in memory during an active session.

This piece covers the specific chain of operations between a user typing a master password and the vault becoming readable: the hashing and stretching steps, the role of a salt, and the way the resulting key material is applied to symmetric encryption. Understanding this chain also clarifies why a password manager is more than a secure notepad — it is a layered cryptographic system in which the master password is the sole input to a one-way function.

Manage All Your AI API Keys in One Place

Securely manage keys for 60+ AI providers in one encrypted vault instead of juggling them across apps.

Learn more

From Typed Characters to Cryptographic Key: The Derivation Chain

When a master password is entered, the password manager passes it through a key derivation function (KDF). A KDF is specifically designed to be computationally expensive — deliberately slow — so that an attacker who obtains the encrypted vault cannot rapidly test millions of candidate passwords against it. Common KDFs used in this context include PBKDF2, bcrypt, scrypt, and Argon2; each applies a different strategy for consuming CPU or memory resources during the derivation process.

The KDF does not operate on the master password alone. It also takes a salt — a randomly generated value unique to that account, stored alongside the encrypted vault. The salt ensures that two users with identical master passwords produce entirely different derived keys. Without a salt, a precomputed table of common-password hashes (a "rainbow table") could be used to reverse the derivation at scale; the salt defeats that shortcut by making every derivation unique.

The KDF runs the password and salt through its internal function a large number of times — an iteration count or work factor. PBKDF2, for example, applies an underlying pseudorandom function (typically HMAC-SHA-256) repeatedly, with each round's output feeding into the next. The final output of this process is a fixed-length string of bytes: the derived key. This derived key is never transmitted to a server in a well-designed system; it exists only in the client's memory for the duration of the session.

That derived key is then used as the input to a symmetric encryption algorithm — most commonly AES-256 in a mode such as GCM or CBC — to encrypt or decrypt the vault contents. AES-256 operates on the vault data using the derived key; without the correct key, the ciphertext is computationally indistinguishable from random noise. This is the same symmetric encryption principle underlying zero-knowledge encryption architectures, where the service provider holds only ciphertext and never the key.

Some implementations add a second derivation step: the derived key is itself hashed (using a fast function such as SHA-256) to produce a separate "authentication hash." This authentication hash — not the encryption key itself — is what gets sent to the server during login to verify the master password is correct. The server stores only this authentication hash, meaning the encryption key never leaves the device. The two values serve distinct purposes: one unlocks the vault locally, the other proves identity to the server.

Technical Components Involved in Key Derivation

The key derivation function (KDF). This is the core algorithm — PBKDF2, scrypt, bcrypt, or Argon2 — that transforms the master password into key material. Each algorithm differs in its resistance to hardware-accelerated attacks: scrypt and Argon2 are memory-hard, meaning they require large amounts of RAM during computation, which limits the speed advantage an attacker gains from using a GPU or specialized chip.

The salt. A randomly generated value, typically 128 or 256 bits, produced by a cryptographically secure pseudorandom number generator (CSPRNG). The same kind of randomness that underlies random password generation is also applied here — entropy sourced from the operating system's secure random facility. The salt is stored in plaintext alongside the vault, because its purpose is uniqueness, not secrecy.

The symmetric cipher. AES-256 (Advanced Encryption Standard with a 256-bit key) is the encryption algorithm that operates on vault data using the derived key. In GCM (Galois/Counter Mode), AES also produces an authentication tag that detects tampering with the ciphertext, adding integrity verification on top of confidentiality.

The HMAC function. HMAC (Hash-based Message Authentication Code) is used inside PBKDF2 as its pseudorandom function, and separately as the basis for the authentication hash sent to servers. It combines a hash function (typically SHA-256) with a secret key to produce a value that cannot be forged without knowing the key.

The client application. The local software — desktop client, browser extension, or mobile app — is where derivation happens. The master password enters this environment, the KDF runs entirely within it, and the derived key resides in process memory. When the session ends or the vault locks, the key is zeroed from memory.

The remote vault store (where applicable). In cloud-synced password managers, the server stores the encrypted vault blob, the salt, and the authentication hash. It does not store the master password or the derived encryption key. The server's role is custody of ciphertext, not participation in decryption.

Where Key Derivation Produces Unexpected or Problematic Results

Weak master passwords undermine the entire chain. The KDF's work factor slows down an attacker, but it cannot compensate for a master password drawn from a small space of possibilities. A short, common, or predictable master password dramatically reduces the number of candidates an attacker must test, even at high iteration counts. The mathematical strength of AES-256 is irrelevant if the key derived from the password can be found by testing a few thousand candidates.

Iteration counts become outdated. The work factor — the number of KDF iterations — is chosen at the time the vault is created or the password is set. As hardware becomes faster, a count that was computationally expensive in one year becomes trivially fast several years later. A vault created with a low iteration count and never updated retains that weaker setting, even if the software's default has since increased. The vault does not automatically re-derive with a higher count unless the master password is changed.

Memory exposure during an active session. The derived key must exist in process memory while the vault is unlocked. On systems where memory is accessible to other processes — through a compromised operating system, a memory-scraping attack, or a system crash that produces a memory dump — the key can potentially be extracted. This is a property of all in-memory cryptographic operations, not a flaw specific to password managers.

The authentication hash is not the encryption key, but confusion between them has consequences. If an implementation incorrectly sends the derived encryption key (rather than a secondary hash of it) to the server for authentication, the server gains the ability to decrypt the vault. This is an implementation error, not a flaw in the KDF itself, but it illustrates that the security of the architecture depends on the derivation chain being implemented correctly at every step.

Account recovery mechanisms can weaken the model. Some services offer master password recovery through email or a recovery key. These mechanisms necessarily involve an alternative path to vault decryption. The cryptographic properties of that alternative path — how the recovery key is generated, stored, and used — determine whether it introduces a weaker link than the primary derivation chain.

What Audits and Standards Actually Assess in Key Derivation

Security audits of password manager implementations typically examine whether the KDF in use is a recognized, vetted algorithm; whether the iteration count or work factor meets current recommendations; whether the salt is generated with a CSPRNG and is of sufficient length; and whether the derived encryption key is correctly separated from any authentication value sent to a server.

NIST (the National Institute of Standards and Technology) publishes guidance on approved KDFs and minimum iteration counts for PBKDF2 in its Special Publication 800-132. As of recent revisions, NIST recommends a minimum of 600,000 iterations for PBKDF2-HMAC-SHA-256 for password hashing purposes — a figure that reflects the current speed of commodity hardware. Auditors check whether a product's defaults meet or exceed this floor, and whether existing vaults created under older defaults are migrated.

What audits do not assess is the behavior of the master password itself — its length, randomness, or uniqueness — because that is determined by the person who creates it, not the software. An audit can confirm that the KDF is correctly implemented and that the iteration count is adequate; it cannot confirm that the input to the KDF is drawn from a large enough space to resist guessing.

Audits also typically do not cover the full runtime environment: whether the operating system's memory protections are sufficient, whether the process is isolated from other applications, or whether the device itself is compromised. The FTC has noted in its guidance on data security that even technically sound encryption implementations operate within a broader system context, and that the security of any one component depends on the integrity of the surrounding environment. The cryptographic record of a password manager audit is therefore a statement about the algorithm and its implementation, not about the end-to-end security of the device or network on which it runs — a limitation relevant to understanding any consumer security tool, including those that claim monitoring for credential exposure as an added layer.

The derivation of an encryption key from a master password is a well-understood cryptographic operation, standardized across decades of research and reflected in published NIST guidance. Its properties — the one-way nature of the KDF, the uniqueness enforced by the salt, the computational cost of the work factor — are measurable and auditable. What the derivation chain cannot do is compensate for inputs outside its scope: the quality of the password fed into it, the security of the device running it, or the correctness of every surrounding implementation decision.

Sources

Note: This explains how digital privacy and security tools work technically. It is not legal or cybersecurity advice, and it is not a substitute for a reader's own judgment about a real security concern. Check the cited sources for current guidance.

5 desks. How it works, not what to do.

Start from the top