PHPackages                             postfixadmin/password-hashing - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. postfixadmin/password-hashing

ActiveLibrary[Security](/categories/security)

postfixadmin/password-hashing
=============================

Routines to generate password hashes, useful for Dovecot or Courier Mail servers

0.0.2(1y ago)321.7k—3.2%2GPL-2.0PHPPHP &gt;=7.4

Since Oct 2Pushed 1y ago4 watchersCompare

[ Source](https://github.com/postfixadmin/pacrypt)[ Packagist](https://packagist.org/packages/postfixadmin/password-hashing)[ RSS](/packages/postfixadmin-password-hashing/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (1)Dependencies (3)Versions (3)Used By (0)

PostfixAdmin\\PasswordHashing
=============================

[](#postfixadminpasswordhashing)

Standalone PHP library for creating various password hashes

Note, this library is still quite new (2021/07/02). It's quite likely to have major refactoring / renaming as it's reviewed.

Supported Mechanisms (hash formats)
-----------------------------------

[](#supported-mechanisms-hash-formats)

See:

 [pacrypt/src/Crypt.php](https://github.com/postfixadmin/pacrypt/blob/46ddd21a28433faa8ea279e4161f7853a69b40cb/src/Crypt.php#L12)

 Line 12 in [46ddd21](/postfixadmin/pacrypt/commit/46ddd21a28433faa8ea279e4161f7853a69b40cb)

     public const SUPPORTED = \[

Some mechanisms support either HEX (.HEX) encoded or BASE64 (.B64) encoded output.

Currently:

- SHA1, SHA1.HEX, SHA1.B64
- SSHA
- SSHA512
- BLF-CRYPT, BLF-CRYPT.B64
- SHA512-CRYPT, SHA512-CRYPT.B64
- ARGON2I, ARGON2I.B64
- ARGON2ID, ARGON2ID.B64
- SHA256, SHA256-CRYPT, SHA256-CRYPT.B64
- SHA512, SHA512.B64
- MD5-CRYPT, MD5
- PLAIN-MD5
- CRYPT ({CRYPT} prefix, defaults to use Blowfish)
- SYSTEM (DES CRYPT, best avoid)
- PLAIN, CLEAR, CLEARTEXT (useful for testing)
- COURIER:MD5
- COURIER:MD5RAW
- COURIER:SSHA (same as SSHA)
- COURIER:SHA256 (same as SHA256)

Example usage
-------------

[](#example-usage)

The main functionality reflects legacy behaviour in PostfixAdmin with a 'pacrypt' function, which when given ...

- one argument - clear text password - returns a hash.
- two arguments - clear text password and stored hash - if the return value matches the stored hash, then the clear text password was a match for the hash we have.

```
$tool = new \PostfixAdmin\PasswordHashing\Crypt('ARGON2I');

// should output something to indicate what your system supports (may be dependent on PHP variant, PHP modules etc)

$hash = $tool->crypt('fishbeans');

echo "Hash is: $hash \n";

echo "Verify: " . json_encode($hash == $tool->crypt('fishbeans', $hash)) . "\n";
echo "Verify fails with: " . json_encode('cat' == $tool->crypt('fishbeans', $hash)) . "\n";
```

the above code will output something similar to:

```
Hash is: {ARGON2I}$argon2i$v=19$m=65536,t=4,p=1$d1JMUXVHSUtLTGhxYnowVQ$4raz6DDUbtRysi+1ZTdNL3L5j4tcSYnzWxyLVDtFjKc
Verify: true
Verify fails with: false

```

ChangeLog
---------

[](#changelog)

2021/07/03 - Initial release / copying of code from  ...

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance41

Moderate activity, may be stable

Popularity32

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1237 days

Total

2

Last Release

487d ago

PHP version history (2 changes)0.0.1PHP &gt;=7.2

0.0.2PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/c060c1674b4cba05d732300b294891102b12c949ca53399869692edb5df8ff5b?d=identicon)[DavidGoodwin](/maintainers/DavidGoodwin)

---

Top Contributors

[![DavidGoodwin](https://avatars.githubusercontent.com/u/203929?v=4)](https://github.com/DavidGoodwin "DavidGoodwin (23 commits)")[![seaking91](https://avatars.githubusercontent.com/u/1733307?v=4)](https://github.com/seaking91 "seaking91 (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/postfixadmin-password-hashing/health.svg)

```
[![Health](https://phpackages.com/badges/postfixadmin-password-hashing/health.svg)](https://phpackages.com/packages/postfixadmin-password-hashing)
```

###  Alternatives

[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k18.0M134](/packages/mews-purifier)[paragonie/ecc

PHP Elliptic Curve Cryptography library

24772.0k35](/packages/paragonie-ecc)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
