You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 31, 2026. It is now read-only.
When decrypting an AES CBC message with an incorrect key, I've noticed an inconsistent behavior between Java/Android and Darwin (MacOS, iOS, ecc..) targets.
Java/Android: correctly throws an exception (an Error with BadPaddingException cause), indicating decryption failure.
Darwin: returns a byte array of incorrect data without throwing an error.
This prevents the detection of a decryption failure due to an invalid key on Darwin targets and a different behaviour among platforms.
Expected Behavior
Both Java/Android and Darwin targets should consistently throw an exception or return an error when an incorrect key is used for AES CBC decryption.
Steps to Reproduce
To reproduce the error, I've created a test case for the AesCbcTest test suite:
Description
When decrypting an AES CBC message with an incorrect key, I've noticed an inconsistent behavior between Java/Android and Darwin (MacOS, iOS, ecc..) targets.
ErrorwithBadPaddingExceptioncause), indicating decryption failure.This prevents the detection of a decryption failure due to an invalid key on Darwin targets and a different behaviour among platforms.
Expected Behavior
Both Java/Android and Darwin targets should consistently throw an exception or return an error when an incorrect key is used for AES CBC decryption.
Steps to Reproduce
To reproduce the error, I've created a test case for the
AesCbcTesttest suite:Environment