mirror of
https://github.com/gchq/CyberChef.git
synced 2024-11-02 14:11:02 +01:00
Merge branch 'AESGCMAAD' of https://github.com/n1073645/CyberChef into n1073645-AESGCMAAD
This commit is contained in:
commit
ba8591293b
@ -41,8 +41,33 @@ class AESEncrypt extends Operation {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Mode",
|
"name": "Mode",
|
||||||
"type": "option",
|
"type": "argSelector",
|
||||||
"value": ["CBC", "CFB", "OFB", "CTR", "GCM", "ECB"]
|
"value": [
|
||||||
|
{
|
||||||
|
name: "CBC",
|
||||||
|
off: [5]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "CFB",
|
||||||
|
off: [5]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "OFB",
|
||||||
|
off: [5]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"CTR",
|
||||||
|
off: [5]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "GCM",
|
||||||
|
on: [5]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "ECB",
|
||||||
|
off: [5]
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Input",
|
"name": "Input",
|
||||||
@ -53,6 +78,11 @@ class AESEncrypt extends Operation {
|
|||||||
"name": "Output",
|
"name": "Output",
|
||||||
"type": "option",
|
"type": "option",
|
||||||
"value": ["Hex", "Raw"]
|
"value": ["Hex", "Raw"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Additional Authenticated Data",
|
||||||
|
"type": "string",
|
||||||
|
"value": ""
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@ -83,7 +113,12 @@ The following algorithms will be used based on the size of the key:
|
|||||||
input = Utils.convertToByteString(input, inputType);
|
input = Utils.convertToByteString(input, inputType);
|
||||||
|
|
||||||
const cipher = forge.cipher.createCipher("AES-" + mode, key);
|
const cipher = forge.cipher.createCipher("AES-" + mode, key);
|
||||||
|
|
||||||
|
if (args[5])
|
||||||
|
cipher.start({iv: iv, additionalData: args[5]});
|
||||||
|
else
|
||||||
cipher.start({iv: iv});
|
cipher.start({iv: iv});
|
||||||
|
|
||||||
cipher.update(forge.util.createBuffer(input));
|
cipher.update(forge.util.createBuffer(input));
|
||||||
cipher.finish();
|
cipher.finish();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user