Skip to content

Sumeru / #984 - Remove insecure AES/CBC/PKCS5Padding for new encryption#1032

Closed
sumeruchat wants to merge 1 commit intomasterfrom
sumeru/984-fix-insecure-cbc-padding
Closed

Sumeru / #984 - Remove insecure AES/CBC/PKCS5Padding for new encryption#1032
sumeruchat wants to merge 1 commit intomasterfrom
sumeru/984-fix-insecure-cbc-padding

Conversation

@sumeruchat
Copy link
Copy Markdown
Contributor

@sumeruchat sumeruchat commented Apr 7, 2026

Summary

  • Always use AES/GCM/NoPadding for new encryption, eliminating the insecure AES/CBC/PKCS5Padding path
  • Throw UnsupportedOperationException on pre-KitKat devices instead of falling back to vulnerable CBC mode
  • Retain legacy CBC decryption for backward compatibility with existing encrypted data
  • Remove CBC block mode from new AndroidKeyStore key generation

Test plan

  • Verify existing encrypted data (email, userId, authToken) can still be decrypted after upgrade
  • Verify new encryption always uses GCM (flag byte = 1 in encrypted output)
  • Run IterableDataEncryptorTest — updated tests validate legacy decrypt + modern-only encrypt
  • Test on a fresh install to verify key generation uses GCM-only spec

🤖 Generated with Claude Code

Always use AES/GCM/NoPadding for encryption. Legacy CBC decryption
retained for backward compatibility with existing encrypted data.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sumeruchat sumeruchat self-assigned this Apr 7, 2026
@sumeruchat sumeruchat changed the title Sumeru - #984 Remove insecure AES/CBC/PKCS5Padding for new encryption Sumeru / #984 - Remove insecure AES/CBC/PKCS5Padding for new encryption Apr 7, 2026
@franco-zalamena-iterable franco-zalamena-iterable deleted the sumeru/984-fix-insecure-cbc-padding branch April 8, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants