postgresql_16:9.6.28.6 Notes
PostgreSQL 16 > Appendixes > Additional Supplied Modules and Extensions > pgcrypto — cryptographic functions > Notes
Configuration
pgcrypto configures itself according to the findings of the main PostgreSQL configure script. The options that affect it are --with-zlib and --with-ssl=openssl.
When compiled with zlib, PGP encryption functions are able to compress data before encrypting.
pgcrypto requires OpenSSL. Otherwise, it will not be built or installed.
When compiled against OpenSSL 3.0.0 and later versions, the legacy provider must be activated in the openssl.cnf configuration file in order to use older ciphers like DES or Blowfish.
NULL Handling
As is standard in SQL, all functions return NULL, if any of the arguments are NULL. This may create security risks on careless usage.
Security Limitations
All pgcrypto functions run inside the database server. That means that all the data and passwords move between pgcrypto and client applications in clear text. Thus you must:
1. Connect locally or use SSL connections. 2. Trust both system and database administrator.
If you cannot, then better do crypto inside client application.
The implementation does not resist side-channel attacks. For example, the time required for a pgcrypto decryption function to complete varies among ciphertexts of a given size.