summaryrefslogtreecommitdiffstats
path: root/core/pbkdf2.js
diff options
context:
space:
mode:
authorSteve Thomas <Sc00bz@users.noreply.github.com>2015-11-01 14:36:28 -0600
committerSteve Thomas <Sc00bz@users.noreply.github.com>2015-11-01 14:36:28 -0600
commitdb7e40d449ab4ae65bacf267b38d1bf836b4fe54 (patch)
treef6f815673f56490c8ae3bfdc8ed9a5f4d9996f76 /core/pbkdf2.js
parent025908ef2b091faab75f60188654f789b691ff0d (diff)
parentf9a2494fae0dcddef493de453aa6ab69caa987cf (diff)
downloadsjcl-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.js6
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),