pg_pwhash
Advanced password hashing methods for PostgreSQL
pg_pwhash : Advanced password hashing methods for PostgreSQL
Overview
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-r | No | Yes | No | Yes | yes | no |
| Relationships | |
|---|---|
| See Also | passwordcheck passwordcheck_cracklib passwordpolicy credcheck chkpass pg_enigma column_encrypt |
RPM metadata shows license=PostgreSQL, but packaged LICENSE file is MIT
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PGDG | 1.0 |
18 17 16 15 14 | pg_pwhash |
- |
| RPM | PGDG | 1.0 |
18 17 16 15 14 | pg_pwhash_$v |
- |
| DEB | PGDG | 1.0 |
18 17 16 15 14 | postgresql-$v-pg-pwhash |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 |
| el8.aarch64 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 |
| el9.x86_64 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 |
| el9.aarch64 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 |
| el10.x86_64 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 |
| el10.aarch64 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 |
| d12.x86_64 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 |
| d12.aarch64 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 |
| d13.x86_64 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 |
| d13.aarch64 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 |
| u22.x86_64 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 |
| u22.aarch64 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 |
| u24.x86_64 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 |
| u24.aarch64 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 |
| u26.x86_64 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 |
| u26.aarch64 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 |
Source
github.com/cybertec-postgresql/pg_pwhash
Install
Make sure PGDG repo available:
Install this extension with pig:
Create this extension with:
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 |