dint-dev / cryptography

Cryptography for Flutter developers: encryption, digital signatures, key agreement, etc.
https://pub.dev/packages/cryptography
Apache License 2.0
162 stars 90 forks source link

Allow decrypting SecretBox with a missing Mac #154

Closed plarson closed 1 year ago

plarson commented 1 year ago

This allows skipping the Mac check when decrypting a SecretBox in DartCipher.

In the project I am working on, I need to be able to decrypt with an empty Mac in the SecretBox. Other locations in the library allow skipping authentication checks and support null.

terrier989 commented 1 year ago

Hi! Thank you for the PR. This will not be merged because you can already use MacAlgorithm.empty if you don't have a MAC:

final algorithm = Chacha20(macAlgorithm: MacAlgorithm.empty);
plarson commented 1 year ago

Thank you, I missed that.