📖 WIPIVERSE

🔍 Currently registered entries: 103,062건

Pepper (cryptography)

In cryptography, a pepper is a secret value that is added to an input before it is processed by a cryptographic function, most commonly a hashing function. Unlike a salt, which is typically stored alongside the hashed output (often in a database), a pepper is kept secret and is not stored publicly. The purpose of a pepper is to increase the difficulty of successfully cracking passwords or other sensitive data even if an attacker gains access to the database containing the hashed values and any associated salts.

The security provided by a pepper relies on the secrecy of the pepper value itself. If the pepper is compromised, the security benefits are negated. Peppers are typically a global secret applied to all hashed inputs within a system, whereas salts are unique per input.

The use of a pepper alongside a salt in password hashing is a defense-in-depth strategy. While the salt protects against rainbow table attacks by making each hash unique, the pepper protects against an attacker who has successfully obtained the salt values and is attempting to use precomputed hash tables or brute-force attacks. By adding a secret value before hashing, even if an attacker knows the hashing algorithm and the salt, they still lack the critical information needed to effectively precompute hashes or launch targeted attacks.

A strong pepper should be a sufficiently long and randomly generated string. Its storage location should be carefully considered and access to it should be tightly controlled. Common places to store a pepper include a configuration file that is not accessible through the web, or a secure hardware security module (HSM).

The effectiveness of a pepper depends on the robust security practices surrounding its generation, storage, and access. A poorly managed pepper can provide a false sense of security.

While the addition of a pepper can enhance security, it's crucial to understand that it doesn't eliminate the need for strong hashing algorithms (like Argon2, bcrypt, scrypt, or PBKDF2) and proper salting techniques. The pepper should be seen as an additional layer of security rather than a replacement for fundamental cryptographic best practices.