Skip to content
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

Use an explicit mode of operation, as "AES" defaults to insecure ECB mode #20

Open
overheadhunter opened this issue Dec 8, 2015 · 0 comments

Comments

@overheadhunter
Copy link

Currently you encrypt messages using Cipher cipher = Cipher.getInstance(MessageEncryptionFactory.ENCRYPTION_ALGORITHM); with MessageEncryptionFactory.ENCRYPTION_ALGORITHM = "AES";

AES however defaults to ECB mode, which is not secure when we're talking about messages longer than 128 bit. E.g. "hiWorld!hiWorld!" would result in a regular pattern.

If you don't want to send an IV inside message (due to 160 char restriction), use a hard coded one. This way attackers could see that two SMS are the same, but at least are unable to identify patterns.

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

No branches or pull requests

1 participant