Data encryption in PostgreSQL TimescaleDB
To encrypt the data in PostgreSQL TimescaleDB, you can add the pgcrypto extension. This extension provides a set of cryptographic functions to protect data with:
- standard data hashing — digest(), hmac();
- password hashing — crypt(), gen_salt();
- symmetric and public keys (encrypt data according to OpenPGP standard) — pgp_sym_encrypt(), pgp_sym_decrypt(), pgp_pub_encrypt(), pgp_pub_decrypt(), armor(), dearmor();
- low-level encryption — encrypt(), decrypt();
- receiving random data — gen_random_bytes(), gen_random_uuid().
When using the pgcrypto extension, be aware of security restrictions.
See examples of data encryption using the pgcrypto extension.
Read more about the pgcrypto extension and its functions in the article pgcrypto — cryptographic functions documentation PostgreSQL.