mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 15:26:16 -04:00
ESM: Tidied up recently ported ops
This commit is contained in:
parent
905bc6699e
commit
6768038a2f
14 changed files with 47 additions and 27 deletions
|
@ -62,7 +62,9 @@ class DerivePBKDF2Key extends Operation {
|
|||
*/
|
||||
run(input, args) {
|
||||
const passphrase = Utils.convertToByteString(args[0].string, args[0].option),
|
||||
[, keySize, iterations, hasher, ] = args, //eslint-disable-line array-bracket-spacing
|
||||
keySize = args[1],
|
||||
iterations = args[2],
|
||||
hasher = args[3],
|
||||
salt = Utils.convertToByteString(args[4].string, args[4].option) ||
|
||||
forge.random.getBytesSync(keySize),
|
||||
derivedKey = forge.pkcs5.pbkdf2(passphrase, salt, iterations, keySize / 8, hasher.toLowerCase());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue