A key derivation function produces one or more cryptographic keys from a secret input such as a password or an existing key.
A key derivation function turns an input secret into keys of the right length and purpose. There are two broad families. Password-based KDFs, such as Argon2id and PBKDF2, take a low-entropy input like a human-chosen password and make each guess expensive with a salt and a deliberate work factor. Key-based KDFs, such as HKDF (RFC 5869), take an input that is already high-entropy, for example a shared secret from a key exchange or a random root key, and expand it into several independent subkeys. HKDF has an extract step that concentrates entropy and an expand step that outputs keys bound to a context string, so a key made for encryption cannot be confused with one made for authentication. NIST describes KDF constructions in SP 800-108. In a password manager the two combine: a slow password-based KDF turns the master password into an unlock key, and a fast key-based KDF derives purpose-labelled keys for items, sync and recovery. Using distinct labels is a basic hygiene rule, since reusing one key for two purposes can open attacks. BotPassword uses Argon2id for the password step and HKDF-SHA-256 with versioned purpose labels for everything derived afterwards.