You Must Encrypt Database Data! How Do We Do It?
summary
Describes implementing column-level symmetric encryption in PostgreSQL using pgcrypto with PGP_SYM_ENCRYPT/DECRYPT, storing ciphertext in a private table and exposing decrypted columns via a view that reads a per-connection key set through pg_settings. Uses triggers to encrypt on insert/update and a custom uniqueness check that decrypts rows to enforce constraints; no application changes or extra services required, but applies to small datasets (~2,000 rows) and loses indexing/performance and can produce broken views if the wrong key is used.
AI-written summary · about
chapters (20)
- 0:00Introduction
- 1:30Why encrypt database data
- 3:14Encryption types
- 5:01Disk encryption
- 6:45Transparent encryption
- 8:07Column encryption
- 9:09Application encryption
- 10:33Browser encryption
- 10:55Chosen solution and tools
- 12:21Views and triggers
- 13:44Secret key transfer
- 15:30Uniqueness constraints
- 16:35Method advantages
- 17:36Issues and limits
- 18:16Performance and Q&A
- 19:41Secure communications
- 20:46Key storage
- 21:11Alternatives and tests
- 21:52Data validation
- 22:17Conclusion
