Skip to content
This repository was archived by the owner on Oct 5, 2022. It is now read-only.

Conversation

@technion
Copy link
Contributor

Hi,

It is not a best security practice to utilise a key for both encryption and HMAC. Although there is no significant breach in the default CTR mode, a user unwittingly changing $_mode to CBC falls into a known exploit [1]/

The system proposed involves using PBKDF to break them the key into two - to "derive" as it's designed to. Although the salts are hardcoded in this patch, we are not using this to hash passwords, and this approach is within practices used by other projects [2].

Along the way I have increased the unit testing of the Crypto class.

The work order of 1000 on the HMAC only slows down the integrity check, as any key derivation should be done on the key itself.

Finally, I note that my build is failing a Travis-ci test on the Authy class[3]. I did not touch this class and will open an issue for it. I can't see where I caused this, although I'm happy to eat my words if wrong.

[1] http://weblogs.asp.net/scottgu/archive/2010/09/18/important-asp-net-security-vulnerability.aspx
[2] https://github.com/jamesyonan/jacs/blob/master/README.md
[3] https://travis-ci.org/technion/phpSec/jobs/24867427

@technion technion mentioned this pull request May 10, 2014
xqus added a commit that referenced this pull request Nov 3, 2014
@xqus xqus merged commit 99afd3f into phpsec:master Nov 3, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants