Pepper (cryptography)

Short description: Cryptographic secret, more secure than a salt

In cryptography, a pepper is a secret added to an input such as a password during hashing with a cryptographic hash function. This value differs from a salt in that it is not stored alongside a password hash, but rather the pepper is kept separate in some other medium, such as a Hardware Security Module.[1] Note that the National Institute of Standards and Technology refers to this value as a secret key rather than a pepper. A pepper is similar in concept to a salt or an encryption key. It is like a salt in that it is a randomized value that is added to a password hash, and it is similar to an encryption key in that it should be kept secret.

A pepper performs a comparable role to a salt or an encryption key, but while a salt is not secret (merely unique) and can be stored alongside the hashed output, a pepper is secret and must not be stored with the output. The hash and salt are usually stored in a database, but a pepper must be stored separately to prevent it from being obtained by the attacker in case of a database breach.[2] Where the salt only has to be long enough to be unique per user[dubious - discuss], a pepper should be long enough to remain secret from brute force attempts to discover it (NIST recommends at least 112 bits).

## Contents

* 1 History
* 2 Types
* 3 Shared-secret pepper
* 4 Unique pepper per user
* 5 See also
* 6 References
* 7 External links

## History

The idea of a site- or service-specific salt (in addition to a per-user salt) has a long history, with Steven M. Bellovin proposing a local parameter in a Bugtraq post in 1995.[3] In 1996 Udi Manber also described the advantages of such a scheme, terming it a secret salt.[4] The term pepper has been used, by analogy to salt, but with a variety of meanings. For example, when discussing a challenge-response scheme, pepper has been used for a salt-like quantity, though not used for password storage;[5] it has been used for a data transmission technique where a pepper must be guessed;[6] and even as a part of jokes.[7]

The term pepper was proposed for a secret or local parameter stored separately from the password in a discussion of protecting passwords from rainbow table attacks.[8] This usage did not immediately catch on: for example, Fred Wenzel added support to Django password hashing for storage based on a combination of bcrypt and HMAC with separately stored nonces, without using the term.[9] Usage has since become more common.[10][11][12]

## Types

There are multiple different types of pepper:

* A secret unique to each user.[citation needed]
* A shared secret that is common to all users.[2]
* A randomly-selected number that must be re-discovered on every password input.[13]

## Shared-secret pepper

In the case of a shared-secret pepper, a single compromised password (via password reuse or other attack) along with a user's salt can lead to an attack to discover the pepper, rendering it ineffective. If an attacker knows a plaintext password and a user's salt, as well as the algorithm used to hash the password, then discovering the pepper can be a matter of brute forcing the values of the pepper. This is why NIST recommends the secret value be at least 112 bits, so that discovering it by exhaustive search is intractable. The pepper must be generated anew for every application it is deployed in, otherwise a breach of one application would result in lowered security of another application. Without knowledge of the pepper, other passwords in the database will be far more difficult to extract from their hashed values, as the attacker would need to guess the password as well as the pepper.

A pepper adds security to a database of salts and hashes because unless the attacker is able to obtain the pepper, cracking even a single hash is intractable, no matter how weak the original password. Even with a list of (salt, hash) pairs, an attacker must also guess the secret pepper in order to find the password which produces the hash. The NIST specification for a secret salt suggests using a Password-Based Key Derivation Function (PBKDF) with an approved Pseudorandom Function such as HMAC with SHA-3 as the hash function of the HMAC. The NIST recommendation is also to perform at least 1000 iterations of the PBKDF, and a further minimum 1000 iterations using the secret salt in place of the non-secret salt.

## Unique pepper per user

In the case of a pepper which is unique to each user, the tradeoff is gaining extra security at the cost of storing more information securely. Compromising one password hash and revealing its secret pepper will have no effect on other password hashes and their secret pepper, so each pepper must be individually discovered, which greatly increases the time taken to attack the password hashes.

## See also

* Salt (cryptography)
* HMAC
* passwd

## References

1. ↑ "NIST Special Publication 800-63B". 2022-12-16. Section 5.1.1.2. https://pages.nist.gov/800-63-4/sp800-63b/authenticators/#memsecretver. ""... verifiers SHOULD perform an additional iteration of a keyed hashing or encryption operation using a secret key known only to the verifier""
2. ↑ 2.0 2.1 Akhawe, Devdatta. "How Dropbox securely stores your passwords" (in en). https://dropbox.tech/security/how-dropbox-securely-stores-your-passwords.
3. ↑ Bellovin, Steve (1995-04-16). "passwd hashing algorithm". https://seclists.org/bugtraq/1995/Apr/143.
4. ↑ Manber, Udi (1996). "A simple scheme to make passwords based on one-way functions much harder to crack". Computers & Security 15 (2): 171–176. doi:10.1016/0167-4048(96)00003-x. https://dx.doi.org/10.1016/0167-4048(96)00003-x. Retrieved 2020-11-11.
5. ↑ Blake, Ross; Jackson, Collin; Miyake, Nick; Boneh, Dan; Mitchell, John (2005). "Stronger Password Authentication Using Browser Extensions". USENIX Security Symposium: 17–32. https://www.usenix.org/legacy/publications/library/proceedings/sec05/tech/full_papers/ross/ross_html/index.html. Retrieved 2020-11-11.
6. ↑ Lars Schoening (January 25, 2006). "Hash only (Pepper) data transmission". Newsgroup: sci.crypt.
7. ↑ cyrusthevirus (June 7, 2007). "Bruce Schneier Facts". Newsgroup: it.test. "Most people salt their hash. Bruce salt and peppers his."
8. ↑ Webster, Craig (2009-08-03). "Securing Passwords with Salt, Pepper and Rainbows". http://www.barkingiguana.com/2009/08/03/securing-passwords-with-salt-pepper-and-rainbows/.
9. ↑ Wenzel, Fred (2011-03-12). "History for django-sha2/django_sha2/bcrypt_auth.py". https://github.com/fwenzel/django-sha2/commits/master/django_sha2/bcrypt_auth.py.
10. ↑ Patrick Mylund Nielsen (May 30, 2012). "Generating Salt for encryption using golang". golang-nuts (Mailing list).
11. ↑ Duong, Thai (2020-09-05). "Why you want to encrypt password hashes". https://vnhacker.blogspot.com/2020/09/why-you-want-to-encrypt-password-hashes.html.
12. ↑ @Sc00bzT (2020-09-18). "Pepper use to mean "a non-cryptographic salt"". https://twitter.com/Sc00bzT/status/1306780371258880007.
13. ↑ "Brute Force Attack on UNIX Passwords with SIMD Computer". August 1999. https://www.usenix.org/legacy/events/sec99/full_papers/kedem/kedem.pdf.

## External links

* v
* t
* e

Cryptographic hash functions & message authentication codes

* List
* Comparison
* Known attacks

Common functions|

* MD5
* SHA-1
* SHA-2
* SHA-3
* BLAKE2

SHA-3 finalists|

* BLAKE
* Grøstl
* JH
* Skein
* Keccak (winner)

Other functions|

* CubeHash
* ECOH
* FSB
* GOST
* HAS-160
* HAVAL
* Kupyna
* LM hash
* MD2
* MD4
* MD6
* MDC-2
* N-Hash
* RIPEMD
* RadioGatún
* SM3
* SWIFFT
* Snefru
* Streebog
* Tiger
* VSH
* Whirlpool

Key derivation functions|

* Argon2
* Balloon
* bcrypt
* crypt
* Lyra2
* PBKDF2
* scrypt

MAC functions|

* DAA
* CBC-MAC
* GMAC
* HMAC
* NMAC
* OMAC/CMAC
* PMAC
* VMAC
* UMAC
* Poly1305
* SipHash

Authenticated
encryption modes|

* CCM
* CWC
* EAX
* GCM
* IAPM
* OCB

Attacks|

* Collision attack
* Preimage attack
* Birthday attack
* Brute-force attack
* Rainbow table
* Side-channel attack
* Length extension attack

Design|

* Avalanche effect
* Hash collision
* Merkle–Damgård construction
* Sponge function
* HAIFA construction

Standardization|

* CRYPTREC
* NESSIE
* NIST hash function competition

Utilization|

* Hash-based cryptography
* Key stretching
* Merkle tree
* Message authentication
* Proof of work
* Salt
* Pepper

* v
* t
* e

Cryptography

* History of cryptography
* Cryptanalysis
* Outline of cryptography

* Symmetric-key algorithm
* Block cipher
* Stream cipher
* Public-key cryptography
* Cryptographic hash function
* Message authentication code
* Random numbers
* Steganography

* Category

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Pepper (cryptography). Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Pepper_(cryptography)&oldid=189644"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template