mirror of
https://github.com/gchq/CyberChef
synced 2025-01-04 00:38:41 +00:00
Fix CryptoJS argument passing in DeriveEVPKey
CryptoJS treats strings as Utf8, so for binary strings, Latin1 needs to be used.
This commit is contained in:
parent
8a17abae45
commit
ab47b3557f
1 changed files with 4 additions and 2 deletions
|
@ -62,11 +62,13 @@ class DeriveEVPKey extends Operation {
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
run(input, args) {
|
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,
|
keySize = args[1] / 32,
|
||||||
iterations = args[2],
|
iterations = args[2],
|
||||||
hasher = args[3],
|
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]
|
key = CryptoJS.EvpKDF(passphrase, salt, { // lgtm [js/insufficient-password-hash]
|
||||||
keySize: keySize,
|
keySize: keySize,
|
||||||
hasher: CryptoJS.algo[hasher],
|
hasher: CryptoJS.algo[hasher],
|
||||||
|
|
Loading…
Reference in a new issue