3 ms·
Show HN: Pgsodium – A Crytographic PostgreSQL Extension
- michelpp 5y agoHey HN, I shared an earlier prototype version of pgsodium but I just released 2.0 and felt this could be a good opportunity to share some updates! [pgsodium](https://github.com/michelp/pgsodium https://github.com/michelp/pgsodium) 2.0.0 is a postgres extension that uses the [libsodium](https://doc.libsodium.org/ https://doc.libsodium.org/) library to provide high-performance, modern cryptography support for PostgreSQL 10+. 2.0.0 includes a ton of new feature and a few bug-fixes: * Support for [XChaCha20-SIV](https://github.com/jedisct1/libsodium-xchacha20-siv https://github.com/jedisct1/libsodium-xchacha20-siv) deterministic nonce-free encryption, this is useful for one-time workflows sacrificing a bit of speed and larger key size without worrying about nonce-handling issues. * Support for [SignCryption](https://github.com/jedisct1/libsodium-signcryption https://github.com/jedisct1/libsodium-signcryption) Sign & Encrypt identity verification. Signcryption goes beyond public key verification to provide identity verification, and negotiating a shared-secret key between two parties to use fast streaming encryption of the payload. * Key id support for HMACSHA 512/256, generichash, and shorthash. This extends support for pgsodium's key management feature to these useful hash functions. * Support for low level [XChaCha20 streaming](https://libsodium.gitbook.io/doc/advanced/stream_ciphers/xchacha20 https://libsodium.gitbook.io/doc/advanced/stream_ciphers/xch...). This is if you want to support your own low level algorithms on top of XChaCha20 for example, PASETO. * More tests, docs, and small bug fixes in argument parsing * In-memory key now protected with [sodium\_malloc](https://libsodium.gitbook.io/doc/memory_management https://libsodium.gitbook.io/doc/memory_management), now the key has additional protection from over/underflow memory attack. Check it out at: [https://github.com/michelp/pgsodium](https://github.com/michelp/pgsodium) https://github.com/michelp/pgsodium](https://github.com/mich... Please feel free to submit any issues you may have and as usual pull requests are greatly appreciated!
- rurban 5y agoPraising sodium_malloc as secure annoys me. Its memset is definitely not secure. It is just not skipped, but it is not meltdown secure, so prone to sidechannel attacks. My fix was rejected, because a secure memset would be too slow (flushing the caches). So the headline should be fast crypto, in opposition to secure crypto.