소스 검색

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,'')),

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.