Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid message authentication code #76

Open
sterichards opened this issue Apr 6, 2023 · 2 comments
Open

Invalid message authentication code #76

sterichards opened this issue Apr 6, 2023 · 2 comments

Comments

@sterichards
Copy link

sterichards commented Apr 6, 2023

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')

@r3hp1c
Copy link

r3hp1c commented Jul 25, 2023

@sterichards it seems like the issues might have been in paragonie/halite. See issue: paragonie/halite#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

@ndench
Copy link

ndench commented Jan 2, 2024

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 🤦

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants