kids encyclopedia robot

Key derivation function facts for kids

Kids Encyclopedia Facts

A key derivation function (KDF) is a special tool in cryptography. It helps create a long, secret code, often called a "key," from a shorter secret phrase, like your password. Imagine you have a short secret word; a KDF turns it into a much longer, unique secret code. This long code looks like a random mix of letters and numbers.

KDFs are also used to change existing secret codes into a specific format. For example, a shared secret code from something like the Diffie-Hellman key exchange can be prepared by a KDF to be used for sending secret messages with AES.

Why We Use Key Derivation Functions

Key derivation functions are super important for security. They take a smaller "secret phrase," like a password, and stretch it into a much longer secret key. This key has a fixed length, meaning it's always the same size, no matter how long or short your original secret phrase was.

This process makes it much harder for someone to guess your original secret phrase. The longer key means a computer would have to try many, many more combinations to find it. This is called "brute-forcing," and KDFs make it very difficult. Sometimes, a small piece of random data, called a "salt," is mixed with your secret phrase before the KDF uses it. This makes it even harder to guess the original secret phrase, especially if someone has a list of common secret codes.

KDFs also make checking passwords safer without needing to store your actual password. Instead of keeping your real password, a KDF creates a special "hash" (a unique code) of it. When you type your password to log in, the system creates a new "hash" from what you typed and compares it to the stored "hash." If they match, you're in! This way, even if a hacker gets the stored "hashes," they don't have your actual password.

Some computer programs might limit how long your password can be. KDFs can also take a shorter password and make it into a longer, more secure secret key. KDFs are designed to take a bit of time and effort for a computer to create the "hash." This makes it very slow and difficult for attackers to try many different password combinations quickly.

Common Types of KDFs

Here are some key derivation functions that are often used:

  • SHA-2
  • PBKDF2
  • Scrypt
  • Bcrypt
  • Argon2
  • Chacha20

See also

kids search engine
Key derivation function Facts for Kids. Kiddle Encyclopedia.