diff options
author | Steve Thomas <Sc00bz@users.noreply.github.com> | 2015-11-01 14:36:28 -0600 |
---|---|---|
committer | Steve Thomas <Sc00bz@users.noreply.github.com> | 2015-11-01 14:36:28 -0600 |
commit | db7e40d449ab4ae65bacf267b38d1bf836b4fe54 (patch) | |
tree | f6f815673f56490c8ae3bfdc8ed9a5f4d9996f76 /core/pbkdf2.js | |
parent | 025908ef2b091faab75f60188654f789b691ff0d (diff) | |
parent | f9a2494fae0dcddef493de453aa6ab69caa987cf (diff) | |
download | sjcl-db7e40d449ab4ae65bacf267b38d1bf836b4fe54.zip sjcl-db7e40d449ab4ae65bacf267b38d1bf836b4fe54.tar.gz sjcl-db7e40d449ab4ae65bacf267b38d1bf836b4fe54.tar.bz2 |
Merge pull request #1 from bitwiseshiftleft/master
Update
Diffstat (limited to 'core/pbkdf2.js')
-rw-r--r-- | core/pbkdf2.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/pbkdf2.js b/core/pbkdf2.js index 869e4df..3e9aa3f 100644 --- a/core/pbkdf2.js +++ b/core/pbkdf2.js @@ -12,7 +12,7 @@ * This is the method specified by RSA's PKCS #5 standard. * * @param {bitArray|String} password The password. - * @param {bitArray} salt The salt. Should have lots of entropy. + * @param {bitArray|String} salt The salt. Should have lots of entropy. * @param {Number} [count=1000] The number of iterations. Higher numbers make the function slower but more secure. * @param {Number} [length] The length of the derived key. Defaults to the output size of the hash function. @@ -30,6 +30,10 @@ sjcl.misc.pbkdf2 = function (password, salt, count, length, Prff) { password = sjcl.codec.utf8String.toBits(password); } + if (typeof salt === "string") { + salt = sjcl.codec.utf8String.toBits(salt); + } + Prff = Prff || sjcl.misc.hmac; var prf = new Prff(password), |