瀏覽代碼

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

Rob Napier 10 年之前
父節點
當前提交
6ba58d675f
共有 4 個文件被更改,包括 15 次插入15 次删除
  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 = {}
 

文件差異過大導致無法顯示
+ 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,'')),

部分文件因文件數量過多而無法顯示