hash - Meteor,why same password after hashing, different string stored in database -
i found meteor default use sha-256 hash password. confused same password each account after hashing become different string stored in database. tell detail implementation, thx
per meteor docs, accounts-password uses bcrypt.
if @ source code of loginwithpassword, should able find out salt stored. second source, read masteram's answer laravel & meteor password hashing indicates meteor 2011 on uses $2y$ hash strings, i.e. php crypt_blowfish, uses
crypt_blowfish - blowfish hashing salt follows: "$2a$", "$2x$" or "$2y$", 2 digit cost parameter, "$", , 22 characters alphabet "./0-9a-za-z". using characters outside of range in salt cause crypt() return zero-length string. 2 digit cost parameter base-2 logarithm of iteration count underlying blowfish-based hashing algorithmeter , must in range 04-31, values outside range cause crypt() fail. versions of php before 5.3.7 support "$2a$" salt prefix: php 5.3.7 introduced new prefixes fix security weakness in blowfish implementation. please refer » document full details of security fix, summarise, developers targeting php 5.3.7 , later should use "$2y$" in preference "$2a$".
thus, $2y$ string in database, , extract salt it.
Comments
Post a Comment