Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The problem with pgcrypto is the fact that in the logs there's the password? that's it? I would like to see the talk to get a better understainding of the whole message, is it available somewhere?


The fundamental issue is that you should not be exposing the encryption keys to the database. If you're using pgcrypto then you're issuing SQL statements in the database with the key. You should do your encryption client-side so that the key is never passed over the wire at all.


That said, pgcrypto is still useful, you can compute hashes or generate UUIDs with it.


The point was that you probably shouldn't use it for data encryption in the DB and think the server doesn't have the keys.


No the issue is statement logging can be turned on at any time and when it is on, everything you are encrypting is revealed in plaintext in the log.


The bigger problem is that pgcrypto is 1990s cryptography: it supports Blowfish, has optional authentication, uses all-zeroes IVs, falls back to insecure RNGs, uses old cipher modes, has ambiguous padding...

Don't use pgcrypto. Use libsodium to encrypt in your application.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: