Skip to content

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