pgsodium User Guide
pgsodium is an encryption library extension for PostgreSQL using the libsodium library for high level cryptographic algorithms.
pgsodium can be used a straight interface to libsodium, but it can also use a powerful feature called Server Key Management where pgsodium loads an external secret key into memory that is never accessible to SQL. This inaccessible root key can then be used to derive sub-keys that are used for encryption and decryption instead of the raw keys themselves.