Skip to content

Commit

Permalink
Merge pull request #1767 from zb3/fix-evpkey
Browse files Browse the repository at this point in the history
  • Loading branch information
a3957273 committed Apr 2, 2024
2 parents 8a17aba + ab47b35 commit 9448106
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/operations/DeriveEVPKey.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,13 @@ class DeriveEVPKey extends Operation {
* @returns {string}
*/
run(input, args) {
const passphrase = Utils.convertToByteString(args[0].string, args[0].option),
const passphrase = CryptoJS.enc.Latin1.parse(
Utils.convertToByteString(args[0].string, args[0].option)),
keySize = args[1] / 32,
iterations = args[2],
hasher = args[3],
salt = Utils.convertToByteString(args[4].string, args[4].option),
salt = CryptoJS.enc.Latin1.parse(
Utils.convertToByteString(args[4].string, args[4].option)),
key = CryptoJS.EvpKDF(passphrase, salt, { // lgtm [js/insufficient-password-hash]
keySize: keySize,
hasher: CryptoJS.algo[hasher],
Expand Down

0 comments on commit 9448106

Please sign in to comment.