pgsodium
Postgres extension for libsodium functions
pgsodium : Postgres extension for libsodium functions
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 7020 | pgsodium | pgsodium | 3.1.11 |
SEC | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --sLd-- | No | Yes | Yes | Yes | no | no |
| Relationships | |
|---|---|
| Schemas | pgsodium |
| See Also | pgcrypto shacrypt cryptint pguecc pgcryptokey pgsmcrypto column_encrypt supabase_vault pg_tde pg_enigma |
Packages
| Linux / PG | PG19 | PG18 | PG17 | PG16 | PG15 |
|---|---|---|---|---|---|
| el8.x86_64 | N/A | PGDG 3.1.11 | PGDG 3.1.11 | PGDG 3.1.11 | PGDG 3.1.11 |
| el8.aarch64 | N/A | PGDG 3.1.11 | PGDG 3.1.11 | PGDG 3.1.11 | PGDG 3.1.11 |
| el9.x86_64 | PGDG 3.1.11 | PGDG 3.1.11 | PGDG 3.1.11 | PGDG 3.1.11 | PGDG 3.1.11 |
| el9.aarch64 | PGDG 3.1.11 | PGDG 3.1.11 | PGDG 3.1.11 | PGDG 3.1.11 | PGDG 3.1.11 |
| el10.x86_64 | PGDG 3.1.11 | PGDG 3.1.11 | PGDG 3.1.11 | PGDG 3.1.11 | PGDG 3.1.11 |
| el10.aarch64 | PGDG 3.1.11 | PGDG 3.1.11 | PGDG 3.1.11 | PGDG 3.1.11 | PGDG 3.1.11 |
| d12.x86_64 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 |
| d12.aarch64 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 |
| d13.x86_64 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 |
| d13.aarch64 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 |
| u22.x86_64 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 |
| u22.aarch64 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 |
| u24.x86_64 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 |
| u24.aarch64 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 |
| u26.x86_64 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 |
| u26.aarch64 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 | PIGSTY 3.1.11 |
Source
github.com/michelp/pgsodium
pgsodium-3.1.11.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Config this extension to shared_preload_libraries:
Create this extension with:
Usage
pgsodium: libsodium-based cryptographic functions for PostgreSQL
pgsodium is an encryption library extension for PostgreSQL using the libsodium library. It provides a direct SQL interface to libsodium, server-managed key derivation, and Transparent Column Encryption (TCE).
Generating Random Data
Secret Key Encryption (Authenticated)
Public Key Encryption
Public Key Signatures
Password Hashing
Hashing
Server Key Management
pgsodium can load an external root key into memory that is never accessible to SQL. Sub-keys are derived by key id:
Transparent Column Encryption (TCE)
Encrypted data is stored on disk and automatically decrypted via a generated view.
Security Roles
pgsodium_keyiduser– less privileged, can only access keys by UUIDpgsodium_keymaker– more privileged, can work with raw keys