phpass password hash generator

Legacy 6.7 and earlier · phpass Modern 6.8+ · bcrypt

Portable phpass $P$ hashes, WordPress's password format through 6.7. On 6.8+? Use the modern generator — it produces a different format.

Legacy phpass hash · $P$

Paste into the user_pass column of wp_users (or your own prefix's users table).

When you actually need phpass

Since WordPress 6.8, $P$ is no longer the default — Core writes bcrypt $wp$2y$ hashes instead. This generator still matters for three real cases: an installation still running 6.7 or earlier, a plugin or integration that verifies phpass directly, and migration or recovery procedures that explicitly call for a portable hash. Outside those, use the modern generator — it matches what a current WordPress site actually creates.

Anatomy of a $P$B hash

Every portable phpass hash WordPress writes is exactly 34 characters long and splits into four fixed-width parts. This one is the hash of correct horse battery staple:

$P$

The portable phpass identifier. phpBB writes the same format as $H$.

B

The iteration count, encoded as one character: 2 to the power of its position in the alphabet below.

8 chars

A random salt, fresh for every hash, so the same password never hashes the same way twice.

22 chars

The 16-byte MD5 result after every iteration, written in phpass's own base-64 alphabet.

The fourth character is the one people ask about. phpass encodes numbers with the 64-character alphabet ./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz, and the character after $P$ is the base-2 logarithm of the round count. B sits at position 13, so the hash ran 213 = 8,192 rounds of MD5 over the salt and password. WordPress always asks for that strength — new PasswordHash(8, true), which phpass turns into 8 + 5 = 13 in portable mode — so every $P$ hash it creates starts $P$B. A different letter usually means another application wrote the value, and WordPress still verifies it as long as the count is within phpass's limits.

Those 8,192 rounds were a sensible defence in 2008. Today a single GPU computes billions of MD5 operations per second, which is why WordPress 6.8 moved to bcrypt, whose cost is designed to stay expensive. The hash formats guide compares every format side by side.

Quick answers

Is $P$ still accepted on WordPress 6.8 and later?

Yes. WordPress verifies phpass hashes on any version and rehashes the account to $wp$2y$ automatically the next time that user logs in successfully. You do not need to convert existing hashes by hand.

How is this different from a plain MD5 hash?

phpass runs 8,192 rounds of salted MD5 rather than one, which makes brute-forcing meaningfully slower. It is still weaker than bcrypt, which is why 6.8 replaced it as the default.

Why does every WordPress phpass hash start with $P$B?

The B is the iteration count. WordPress always requests 2 to the 13th power rounds, and B is character 13 of phpass's alphabet, so every portable hash Core writes begins $P$B. The eight characters after it are the random salt.

Can I use this to hash a password for WordPress 6.8 or later?

You can — 6.8+ still verifies $P$ hashes and upgrades them at the next login — but there is no reason to choose the weaker format. Use the modern $wp$2y$ generator for a current site.