Merge branch 'NewCiphers' of https://github.com/n1073645/CyberChef into n1073645-NewCiphers

This commit is contained in:
n1474335 2020-03-05 15:25:10 +00:00
commit 5e7b004925
6 changed files with 202 additions and 0 deletions

View file

@ -98,6 +98,7 @@ import "./tests/ParseUDP.mjs";
import "./tests/AvroToJSON.mjs";
import "./tests/Lorenz.mjs";
import "./tests/LuhnChecksum.mjs";
import "./tests/CipherSaber2.mjs";
// Cannot test operations that use the File type yet

View file

@ -0,0 +1,45 @@
/**
* Ciphersaber2 tests.
*
* @author n1073645 [n1073645@gmail.com]
*
* @copyright Crown Copyright 2020
* @license Apache-2.0
*/
import TestRegister from "../../lib/TestRegister.mjs";
TestRegister.addTests([
{
name: "CipherSaber2 Encrypt",
input: "Hello World",
expectedMatch: /.{21}/s,
recipeConfig: [
{
op: "CipherSaber2 Encrypt",
args: ["test", 20],
},
],
},
{
name: "CipherSaber2 Decrypt",
input: "\x5d\xd9\x7f\xeb\x77\x3c\x42\x9d\xfe\x9c\x3b\x21\x63\xbd\x53\x38\x18\x7c\x36\x37",
expectedOutput: "helloworld",
recipeConfig: [
{
op: "CipherSaber2 Decrypt",
args: ["test", 20],
},
],
},
{
name: "CipherSaber2 Encrypt",
input: "",
expectedMatch: /.{10}/s,
recipeConfig: [
{
op: "CipherSaber2 Encrypt",
args: ["", 20],
},
],
},
]);