From 06943aff358361e74295c44060f3124fd60ec1ed Mon Sep 17 00:00:00 2001 From: GCHQDeveloper581 <63102987+GCHQDeveloper581@users.noreply.github.com> Date: Thu, 12 Feb 2026 11:49:58 +0000 Subject: [PATCH] Update tests for new AES Encrypt functionality in CyberChef 10.22.1 --- src/test/bake.mjs | 10 +++++----- src/test/batchBake.mjs | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/test/bake.mjs b/src/test/bake.mjs index 2cc586c..bf094c0 100644 --- a/src/test/bake.mjs +++ b/src/test/bake.mjs @@ -137,14 +137,14 @@ describe("POST /bake", function() { .send({ input: "irrelevant", recipe: { - op: "AES Encrypt", - args: { - key: "notsixteencharslong" - } + "op": "AES Encrypt", + "args": [ + { "option": "UTF8", "string": "notsixteencharslong" }, { "option": "Hex", "string": "" }, "CBC", "Raw", "Hex", { "option": "Hex", "string": "" } + ] } }) .expect(400) - .expect("Invalid key length: 3 bytes\n\nThe following algorithms will be used based on the size of the key:\n 16 bytes = AES-128\n 24 bytes = AES-192\n 32 bytes = AES-256", done); + .expect("Invalid key length: 19 bytes\n\nThe following algorithms will be used based on the size of the key:\n 16 bytes = AES-128\n 24 bytes = AES-192\n 32 bytes = AES-256", done); }); it("should return a string output as a byte array, if outputType is defined", (done) => { diff --git a/src/test/batchBake.mjs b/src/test/batchBake.mjs index d540da3..95f70aa 100644 --- a/src/test/batchBake.mjs +++ b/src/test/batchBake.mjs @@ -201,16 +201,16 @@ describe("POST /batch/bake", function() { .send({ input: ["irrelevant"], recipe: { - op: "AES Encrypt", - args: { - key: "notsixteencharslong" - } + "op": "AES Encrypt", + "args": [ + { "option": "UTF8", "string": "notsixteencharslong" }, { "option": "Hex", "string": "" }, "CBC", "Raw", "Hex", { "option": "Hex", "string": "" } + ] } }) .expect(200) .expect([{ success: false, - error: "Invalid key length: 3 bytes\n\nThe following algorithms will be used based on the size of the key:\n 16 bytes = AES-128\n 24 bytes = AES-192\n 32 bytes = AES-256" + error: "Invalid key length: 19 bytes\n\nThe following algorithms will be used based on the size of the key:\n 16 bytes = AES-128\n 24 bytes = AES-192\n 32 bytes = AES-256" }], done); });