Browse Source

Switch to 10,000 PBKDF2 iterations (should be compatible with standard v3)

Rob Napier 10 years ago
parent
commit
6ba58d675f
4 changed files with 15 additions and 15 deletions
  1. 1 1
      rncryptor.js
  2. 1 1
      tests/GenVectorTests
  3. 11 11
      tests/Generated/rncryptor-vectors.js
  4. 2 2
      tests/rncryptor-test.js

+ 1 - 1
rncryptor.js

@@ -12,7 +12,7 @@ RNCryptor.KeyForPassword = function(password, salt) {
           return hasher.encrypt.apply(hasher, arguments);
       };
   };
-  return sjcl.misc.pbkdf2(password, salt, 1000, 32 * 8, hmacSHA1);
+  return sjcl.misc.pbkdf2(password, salt, 10000, 32 * 8, hmacSHA1);
 }
 
 /*

+ 1 - 1
tests/GenVectorTests

@@ -5,7 +5,7 @@ require 'json'
 
 require File.join(File.dirname(__FILE__), '../Spec/vectors', 'vectorparser')
 
-@test_files = ["kdf_short", "password_short"]
+@test_files = ["kdf", "password"]
 
 @options = {}
 

File diff suppressed because it is too large
+ 11 - 11
tests/Generated/rncryptor-vectors.js


+ 2 - 2
tests/rncryptor-test.js

@@ -1,9 +1,9 @@
-var verify_kdf_short = function(vector) {
+var verify_kdf = function(vector) {
   var key = RNCryptor.KeyForPassword(vector["password"], sjcl.codec.hex.toBits(vector["salt_hex"]));
   equal(sjcl.codec.hex.fromBits(key), vector["key_hex"].replace(/\s/g,''));
 }
 
-var verify_password_short = function(vector) {
+var verify_password = function(vector) {
   var ciphertext = RNCryptor.Encrypt(vector["password"], 
                                      sjcl.codec.hex.toBits(vector["plaintext_hex"].replace(/\s/g,'')), 
                                      { "encryption_salt": sjcl.codec.hex.toBits(vector["enc_salt_hex"].replace(/\s/g,'')),

Some files were not shown because too many files changed in this diff