pg_pwhash
Advanced password hashing methods for PostgreSQL
Overview
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 7330 | pg_pwhash | No | Yes | No | Yes | No | Yes | - |
| Related | passwordcheck passwordcheck_cracklib passwordpolicy credcheck chkpass pg_enigma column_encrypt |
|---|
RPM metadata shows license=PostgreSQL, but packaged LICENSE file is MIT
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PGDG | 1.0 | 1817161514 | pg_pwhash | - |
| RPM | PGDG | 1.0 | 1817161514 | pg_pwhash_$v | - |
| DEB | PGDG | 1.0 | 1817161514 | postgresql-$v-pg-pwhash | - |
Install
You can install pg_pwhash directly. First, make sure the PGDG repository is added and enabled:
Install the extension using pig or apt/yum/dnf:
Install
pig
dnf
apt
Create Extension:
Usage
pg_pwhash provides modern adaptive password hashing algorithms including Argon2, scrypt, and yescrypt for PostgreSQL.
Supported Algorithms
| Identifier | Algorithm | Salt Pattern |
|---|---|---|
argon2i | Argon2i | $argon2i$v=19$m=4096,t=3,p=1$<salt> |
argon2d | Argon2d | $argon2d$v=19$m=4096,t=3,p=1$<salt> |
argon2id | Argon2id | $argon2id$v=19$m=4096,t=3,p=1$<salt> |
scrypt | Scrypt | $scrypt$ln=16,r=8,p=1$<salt> |
$7$ | Scrypt (crypt) | $7$BU<salt> |
yescrypt | yescrypt (crypt) | $y$j9T$<salt> |
Core Functions
Generate Salt and Hash
Verify Password
Direct Hashing Functions
Custom Salt Parameters
Configuration
| Parameter | Description |
|---|---|
pg_pwhash.argon2_default_backend | Backend for Argon2: libargon2 or openssl |
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)