Hi, we are evaluating to migrate from embedded SQLCipher to Badger. As I understand Badger can enable AES encryption using Options.EncrpytionKey.
Is it envisaged to add modern encryption algorithms as an option, like XChaCha20Poly1305?
According to cryptographers (Latacora - Cryptographic Right Answers) it’s far better than AES for multiple reasons, the number one being it’s simplicity.
I feel really better using XChaCha20-Poly1305 rather than AES, because it’s a lot simpler to understand and it is a modern AEAD cipher: it supports both encryption and authentication, which allow detection of corrupted data (tink/PRIMITIVES.md at master · google/tink · GitHub)
Regarding the last point, I’m not sure if there is other mechanisms in place in badger, but AEAD encryption ‘gives for free’ the detection of corrupted data.
Regarding the breaking change, can’t it be added simply by an Options ? Like Options.EncryptionCipher and an Enum
Instead of baking in encryption, please provide an API so that users can supply their own cryptographic primitives. There are business reasons why a particular encryption package might be used instead of the stdlib’s crypto.
Hardware can be backdoored to produce faulty cryptography (The recent story of CryptoAG prove it) thus pure software crypto (like XChCha20-Poly1305) is safer and more auditable.