Foxcolab

Glossary

Key derivation function

Definition

Key derivation function: An algorithm that turns a secret, such as a password, into one or more cryptographic keys. Password-based KDFs are deliberately slow and memory-hungry, so guessing passwords offline is expensive.

Also known asKDFpassword-based key derivation functionkey stretching

In short

A key derivation function (KDF) turns a secret, such as a password, into one or more cryptographic keys. Password-based KDFs are deliberately slow and memory-hungry, and they mix in a random salt, so an attacker who steals encrypted data has to spend real time and hardware on every single password guess. They slow guessing down, but they can't make a weak password strong.

Key takeaways

  • Passwords are too short and predictable to use directly as keys; a KDF stretches them into full-length keys.
  • A random salt makes the same password produce different keys for different people.
  • Memory-hard KDFs need a large block of memory for every guess, which blunts attacks with graphics cards and custom chips.
  • Some KDFs are fast on purpose and meant only for secrets that are already random, never for passwords.
  • In an end-to-end encrypted service, the KDF runs on your device, so the key it produces never reaches the provider.

Last reviewed 30 November 2026 by Foxcolab Team

A key derivation function (KDF) is an algorithm that turns a secret into one or more cryptographic keys. The most familiar use is turning a password, which is short and chosen by a person, into a full-length key that can encrypt data. A good password-based KDF is deliberately expensive to run, so someone trying to guess the password offline has to pay for every guess.

Why passwords need one#

An encryption key should be long and random. Passwords are neither. If a service used your password, or a quick hash of it, directly as a key, an attacker who copied the encrypted data could try billions of guesses per second on graphics cards. A password-based KDF fights back in two ways:

  • Salt: a random value stored alongside the result, so the same password gives different keys for different people and precomputed tables of guesses are useless.
  • Work factor: tunable cost settings that make each attempt slow and, in modern designs, memory-hungry.

What makes a good one#

The strongest password-based KDFs are memory-hard: every guess needs a large block of memory as well as processor time. Graphics cards and custom cracking chips have plenty of raw speed but little memory per core, so memory-hardness takes away most of their advantage. The settings are a balance. They must be high enough to slow an attacker down and low enough that your own device unlocks without a noticeable wait.

Standards bodies describe these designs in NIST SP 800-132, RFC 7914 and RFC 9106, and OWASP's Password Storage Cheat Sheet gives minimum settings for each. A second family of KDFs is fast on purpose. RFC 5869 describes one, meant for inputs that are already random, such as the result of a key exchange. It's no substitute for a password KDF.

In Foxcolab#

Foxcolab's end-to-end encryption starts here. When you sign up, your device creates your Master Identity Key, the account key that protects the keys each app uses for your mail, files and notes. Your device then runs a memory-hard KDF on your password, with a random salt, and uses the result to lock the Master Identity Key before anything is sent. Foxcolab stores only the locked copy, and the key derived from your password never leaves your device. Your Secret Recovery Key goes through the same function to lock a second copy. That's zero-knowledge encryption in practice: Foxcolab keeps your encrypted data and can't read it.

A long, unique password still matters. The KDF makes every guess expensive, but it can't make a weak password strong. Keep your recovery key somewhere offline, too.

Keep exploring

All terms

Foxcolab

Private work tools, without the ads.

Mail, files, documents, spreadsheets and meetings in one account. Files, documents and spreadsheets are end-to-end encrypted.

Jump to