diff --git a/Passwords/php-hashes/README.md b/Passwords/php-hashes/README.md index 59f79758..236c2425 100644 --- a/Passwords/php-hashes/README.md +++ b/Passwords/php-hashes/README.md @@ -33,3 +33,15 @@ For bcrypt, passwords are automatically truncated to 72 characters, so as long a [Bcrypt example](https://3v4l.org/MsfS0) Descrypt have similar behavior to bcrypt, but passwords are instead truncated to 8 characters. + +- - - + +## Pre-hashed + + + +If you use a password longer than 64 bytes and hash it with PBKDF2-HMAC-SHA1, it is first pre-hashed with SHA1. + +For example, `PBKDF2-HMAC-SHA1(password1) === PBKDF2-HMAC-SHA1(password2)` as `sha1(password1) === bin2hex(password2)`. + +This behavior can also be seen in `PBKDF2-HMAC-SHA224` and `PBKDF2-HMAC-SHA256`. \ No newline at end of file diff --git a/Passwords/php-hashes/truncated/pbkdf2-sha1.txt b/Passwords/php-hashes/pre-hashed/pbkdf2-sha1.txt similarity index 100% rename from Passwords/php-hashes/truncated/pbkdf2-sha1.txt rename to Passwords/php-hashes/pre-hashed/pbkdf2-sha1.txt diff --git a/Passwords/php-hashes/truncated/pbkdf2-sha224.txt b/Passwords/php-hashes/pre-hashed/pbkdf2-sha224.txt similarity index 100% rename from Passwords/php-hashes/truncated/pbkdf2-sha224.txt rename to Passwords/php-hashes/pre-hashed/pbkdf2-sha224.txt diff --git a/Passwords/php-hashes/truncated/pbkdf2-sha256.txt b/Passwords/php-hashes/pre-hashed/pbkdf2-sha256.txt similarity index 100% rename from Passwords/php-hashes/truncated/pbkdf2-sha256.txt rename to Passwords/php-hashes/pre-hashed/pbkdf2-sha256.txt