Skip to content Skip to sidebar Skip to footer

Pycryptodome Error: Mac Check Failed

I am working on an encryption program with Pycryptodome in Python 3. I am trying to encrypt a (byte) string and then decrypt it and verify the MAC tag. When I get to verify it, an

Solution 1:

If you look at the state diagram for authenticated modes:

enter image description here

You see that verify() should be called at the very end, after any decrypt() has taken place. So, either you invert the calls or you replace them with a combined decrypt_and_verify().

Post a Comment for "Pycryptodome Error: Mac Check Failed"