Skip to content

fix: CryptoFailedException: Wrapped error/Decryption failed #749

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

DorianMazur
Copy link
Collaborator

Closes #730

Fixes critical decryption failures that occurred with "Authentication tag verification failed" errors by removing the Cipher instance caching mechanism.

Why this change was necessary:
AES-GCM is an authenticated encryption mode that maintains internal state during operation.
Reusing cached Cipher instances for AES-GCM operations causes this internal state to be carried over between unrelated encryption/decryption operations, corrupting the authentication tag verification process.

Performance:
While Cipher instantiation does have some overhead, measurements showed that the cost of creating fresh Cipher instances is negligible compared to the cryptographic operations themselves

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

Successfully merging this pull request may close these issues.

com.oblador.keychain.exceptions.CryptoFailedException: Wrapped error: null
1 participant