Update DeriveEVPKey.mjs

This commit is contained in:
Zeroday BYTE 2025-07-12 14:16:09 +07:00 committed by GitHub
parent c57556f49f
commit b9d6f1db76
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -45,7 +45,7 @@ class DeriveEVPKey extends Operation {
{
"name": "Hashing function",
"type": "option",
"value": ["SHA1", "SHA256", "SHA384", "SHA512", "MD5"]
"value": ["SHA256", "SHA384", "SHA512"]
},
{
"name": "Salt",
@ -69,10 +69,10 @@ class DeriveEVPKey extends Operation {
hasher = args[3],
salt = CryptoJS.enc.Latin1.parse(
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,
hasher: CryptoJS.algo[hasher],
iterations: iterations,
iterations: Math.max(iterations, 10000), // Ensure a minimum of 10,000 iterations
});
return key.toString(CryptoJS.enc.Hex);