34k+
News
Guide
API
Wiki
Forum
Community
Places
Members
Hall of Fame
Badges
More
Learn
Books
Resources
Develop
Download Yii
Extensions
Report an Issue
Report a Security Issue
Contribute to Yii
Donate
About
Release Cycle
License
Team
Official Logos and Design
Login
Secure password hashing with bCrypt
Comparing
#2
with
#3
Revision #3 was created by
Ivo Pereira
on Nov 29, 2012, 2:25:30 AM.
salsa20 was being used as the algorithm, however since PHP 5.4 it was removed. I've replaced it by sha512.
« Previous (#2)
Content
[...]
$key = uniqid($this->prefix, true);
// 12 rounds of HMAC must be reproduced / created verbatim, no known shortcuts.
// Salsa20 returns more than enough bytes.
for($i = 0; $i < 12; $i++) {
$bytes = hash_hmac('s
alsa20
ha512
', microtime() . $bytes, $key, true);
usleep(10);
}
}
return $bytes;
}
[...]