DoctrineEncryptBundle
DoctrineEncryptBundle copied to clipboard
Invalid message authentication code
I get this error on decrypt using 5.1
The encryption happens on a different project using paragonie/halite 4.6 which matches the version that this bundle uses
I can echo out the value of $data on line 44 of vendor/michaeldegroot/doctrine-encrypt-bundle/src/Encryptors/HaliteEncryptor.php and it shows the decrypted value without a problem
Something happens after that which generates the error "Invalid message authentication code" In Crypto.php line 193
After further investigation, the error is triggered from this check - if ($config->MAC_ALGO === 'BLAKE2b')
@sterichards it seems like the issues might have been in paragonie/halite. See issue: https://github.com/paragonie/halite/issues/161
Seems that their version 5.x did not have the issue, see last comment in the above issue.
Possible for you to upgrade to 5.x? This repository allows for paragonie/halite 5.x to be used: https://github.com/DoctrineEncryptBundle/DoctrineEncryptBundle
Unsure if it's related, but I've had this same error if my .Halite.key
file gets a newline at the end of. Which it does automatically if you open it in most text editors :facepalm: