pgcrypto
cryptographic functions
pgcrypto · cryptographic functions
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 7980 | pgcrypto | pgcrypto | 1.4 | SEC | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-dtr | No | Yes | No | Yes | yes | yes |
PG18 SQL/control baseline 1.4; older PostgreSQL majors may differ.
Packages
| PG19 | PG18 | PG17 | PG16 | PG15 |
|---|---|---|---|---|
| 1.4 | 1.4 | 1.4 | 1.4 | 1.4 |
This contrib extension ships with PostgreSQL.
Install
Create this extension with:
Usage
pgcrypto provides cryptographic functions including hashing, password hashing, PGP encryption, and raw encryption.
General Hashing
Supported algorithms: md5, sha1, sha224, sha256, sha384, sha512.
Password Hashing
gen_salt() types: bf (Blowfish), md5, xdes, des, sha256crypt, sha512crypt.
PGP Symmetric Encryption
PGP Public Key Encryption
Key Utilities
Raw Encryption
Algorithms: bf (Blowfish), aes. Modes: cbc (default), cfb, ecb. Padding: pkcs (default), none.
Random Data
PGP Encryption Options
| Option | Values | Default |
|---|---|---|
cipher-algo | bf, aes128, aes192, aes256, 3des, cast5 | aes128 |
compress-algo | 0 (none), 1 (ZIP), 2 (ZLIB) | 0 |
compress-level | 0-9 | 6 |
s2k-mode | 0, 1, 3 | 3 |