pgcrypto
cryptographic functions
pgcrypto : cryptographic functions
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 7980 | pgcrypto | pgcrypto | 1.3 |
SEC | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-dt- | No | Yes | No | Yes | no | yes |
| Relationships | |
|---|---|
| Need By | column_encrypt omni_auth omni_aws omni_credentials omni_rest pg_dispatch pgcryptokey pgjwt |
| See Also | pgsodium pgsmcrypto pgcryptokey pguecc shacrypt cryptint pg_tde column_encrypt supabase_vault pg_enigma hashlib xxhash |
Packages
| PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|
| 1.3 | 1.3 | 1.3 | 1.3 | 1.3 |
This is a built-in contrib extension ship with the PostgreSQL kernel
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 |