dint-dev / cryptography

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

Allow decrypting SecretBox with a missing Mac #154

Closed plarson closed 10 months ago

plarson commented 11 months 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 10 months 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 10 months ago

Thank you, I missed that.