mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-22 07:46:16 -04:00
AES Additional data can now be entered in a range of formats. #1011
This commit is contained in:
parent
32455cd20f
commit
8fadad5891
4 changed files with 105 additions and 46 deletions
|
@ -87,8 +87,9 @@ class AESDecrypt extends Operation {
|
|||
},
|
||||
{
|
||||
"name": "Additional Authenticated Data",
|
||||
"type": "binaryString",
|
||||
"value": ""
|
||||
"type": "toggleString",
|
||||
"value": "",
|
||||
"toggleValues": ["Hex", "UTF8", "Latin1", "Base64"]
|
||||
}
|
||||
];
|
||||
}
|
||||
|
@ -107,7 +108,7 @@ class AESDecrypt extends Operation {
|
|||
inputType = args[3],
|
||||
outputType = args[4],
|
||||
gcmTag = Utils.convertToByteString(args[5].string, args[5].option),
|
||||
aad = args[6];
|
||||
aad = Utils.convertToByteString(args[6].string, args[6].option);
|
||||
|
||||
if ([16, 24, 32].indexOf(key.length) < 0) {
|
||||
throw new OperationError(`Invalid key length: ${key.length} bytes
|
||||
|
|
|
@ -81,8 +81,9 @@ class AESEncrypt extends Operation {
|
|||
},
|
||||
{
|
||||
"name": "Additional Authenticated Data",
|
||||
"type": "binaryString",
|
||||
"value": ""
|
||||
"type": "toggleString",
|
||||
"value": "",
|
||||
"toggleValues": ["Hex", "UTF8", "Latin1", "Base64"]
|
||||
}
|
||||
];
|
||||
}
|
||||
|
@ -100,7 +101,7 @@ class AESEncrypt extends Operation {
|
|||
mode = args[2],
|
||||
inputType = args[3],
|
||||
outputType = args[4],
|
||||
aad = args[5];
|
||||
aad = Utils.convertToByteString(args[5].string, args[5].option);
|
||||
|
||||
if ([16, 24, 32].indexOf(key.length) < 0) {
|
||||
throw new OperationError(`Invalid key length: ${key.length} bytes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue