mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 15:26:16 -04:00
AES Decrypt now handles blank IVs correctly. Fixes #613
This commit is contained in:
parent
772c6bbba5
commit
863551ee1d
2 changed files with 32 additions and 1 deletions
|
@ -91,7 +91,7 @@ The following algorithms will be used based on the size of the key:
|
||||||
|
|
||||||
const decipher = forge.cipher.createDecipher("AES-" + mode, key);
|
const decipher = forge.cipher.createDecipher("AES-" + mode, key);
|
||||||
decipher.start({
|
decipher.start({
|
||||||
iv: iv,
|
iv: iv.length === 0 ? "" : iv,
|
||||||
tag: gcmTag
|
tag: gcmTag
|
||||||
});
|
});
|
||||||
decipher.update(forge.util.createBuffer(input));
|
decipher.update(forge.util.createBuffer(input));
|
||||||
|
|
|
@ -54,6 +54,21 @@ The following algorithms will be used based on the size of the key:
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "AES Encrypt: AES-128-CTR, no IV, ASCII",
|
||||||
|
input: "The quick brown fox jumps over the lazy dog.",
|
||||||
|
expectedOutput: "a98c9e8e3b7c894384d740e4f0f4ed0be2bbb1e0e13a255812c3c6b0a629e4ad759c075b2469c6f4fb2c0cf9",
|
||||||
|
recipeConfig: [
|
||||||
|
{
|
||||||
|
"op": "AES Encrypt",
|
||||||
|
"args": [
|
||||||
|
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
||||||
|
{"option": "Hex", "string": ""},
|
||||||
|
"CTR", "Raw", "Hex"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "AES Encrypt: AES-128-CBC with IV, ASCII",
|
name: "AES Encrypt: AES-128-CBC with IV, ASCII",
|
||||||
input: "The quick brown fox jumps over the lazy dog.",
|
input: "The quick brown fox jumps over the lazy dog.",
|
||||||
|
@ -645,6 +660,22 @@ The following algorithms will be used based on the size of the key:
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "AES Decrypt: AES-128-CTR, no IV, ASCII",
|
||||||
|
input: "a98c9e8e3b7c894384d740e4f0f4ed0be2bbb1e0e13a255812c3c6b0a629e4ad759c075b2469c6f4fb2c0cf9",
|
||||||
|
expectedOutput: "The quick brown fox jumps over the lazy dog.",
|
||||||
|
recipeConfig: [
|
||||||
|
{
|
||||||
|
"op": "AES Decrypt",
|
||||||
|
"args": [
|
||||||
|
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
||||||
|
{"option": "Hex", "string": ""},
|
||||||
|
"CTR", "Hex", "Raw",
|
||||||
|
{"option": "Hex", "string": ""}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "AES Decrypt: AES-128-CBC with IV, ASCII",
|
name: "AES Decrypt: AES-128-CBC with IV, ASCII",
|
||||||
input: "4fa077d50cc71a57393e7b542c4e3aea0fb75383b97083f2f568ffc13c0e7a47502ec6d9f25744a061a3a5e55fe95e8d",
|
input: "4fa077d50cc71a57393e7b542c4e3aea0fb75383b97083f2f568ffc13c0e7a47502ec6d9f25744a061a3a5e55fe95e8d",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue