Merge b9d6f1db765ce3f11ee246176f9932f97e9d1935 into 2a1294f1c089bb8e68d38d1803d08858907f352a
This commit is contained in:
commit
34a293643a
@ -45,7 +45,7 @@ class DeriveEVPKey extends Operation {
|
|||||||
{
|
{
|
||||||
"name": "Hashing function",
|
"name": "Hashing function",
|
||||||
"type": "option",
|
"type": "option",
|
||||||
"value": ["SHA1", "SHA256", "SHA384", "SHA512", "MD5"]
|
"value": ["SHA256", "SHA384", "SHA512"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Salt",
|
"name": "Salt",
|
||||||
@ -69,10 +69,10 @@ class DeriveEVPKey extends Operation {
|
|||||||
hasher = args[3],
|
hasher = args[3],
|
||||||
salt = CryptoJS.enc.Latin1.parse(
|
salt = CryptoJS.enc.Latin1.parse(
|
||||||
Utils.convertToByteString(args[4].string, args[4].option)),
|
Utils.convertToByteString(args[4].string, args[4].option)),
|
||||||
key = CryptoJS.EvpKDF(passphrase, salt, { // lgtm [js/insufficient-password-hash]
|
key = CryptoJS.PBKDF2(passphrase, salt, { // Secure password-based key derivation
|
||||||
keySize: keySize,
|
keySize: keySize,
|
||||||
hasher: CryptoJS.algo[hasher],
|
hasher: CryptoJS.algo[hasher],
|
||||||
iterations: iterations,
|
iterations: Math.max(iterations, 10000), // Ensure a minimum of 10,000 iterations
|
||||||
});
|
});
|
||||||
|
|
||||||
return key.toString(CryptoJS.enc.Hex);
|
return key.toString(CryptoJS.enc.Hex);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user