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

CBC without integrity is not secure #2

Open
technion opened this issue Aug 20, 2014 · 3 comments
Open

CBC without integrity is not secure #2

technion opened this issue Aug 20, 2014 · 3 comments

Comments

@technion
Copy link

Utilising encryption in CBC mode must always be accompanied by a MAC, or it is vulnerable to several attacks.
An example bitflipping attack which exploits this was recently written here:

https://github.com/technion/matasano_challenge/blob/master/set2/chal16/chal16.rb

@madrobby
Copy link
Member

So what to do about it to make it better?

@technion
Copy link
Author

The safest thing would be automatically append a HMAC, which is verified before decrypting.
The sanest HMAC would be SHA256-HMAC, keyed with a different key to the encryption key.

@ahill-shopatron
Copy link

It might be worth considering if you really need AES. If no, you are probably better off letting RbNaCl do the actual cryptography. Your use case seems to correspond to SimpleBox operating in secret-key mode.

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

3 participants