mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-25 09:16:17 -04:00
Merge branch 'master' into parse-ethernet-frame
This commit is contained in:
commit
bab366e699
7 changed files with 219 additions and 4 deletions
|
@ -136,7 +136,7 @@ TestRegister.addApiTests([
|
|||
|
||||
it("chef.help: returns multiple results", () => {
|
||||
const result = chef.help("base 64");
|
||||
assert.strictEqual(result.length, 11);
|
||||
assert.strictEqual(result.length, 13);
|
||||
}),
|
||||
|
||||
it("chef.help: looks in description for matches too", () => {
|
||||
|
|
80
tests/operations/tests/Fernet.mjs
Normal file
80
tests/operations/tests/Fernet.mjs
Normal file
|
@ -0,0 +1,80 @@
|
|||
/**
|
||||
* Fernet tests.
|
||||
*
|
||||
* @author Karsten Silkenbäumer [github.com/kassi]
|
||||
* @copyright Karsten Silkenbäumer 2019
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
import TestRegister from "../TestRegister";
|
||||
|
||||
TestRegister.addTests([
|
||||
{
|
||||
name: "Fernet Decrypt: no input",
|
||||
input: "",
|
||||
expectedOutput: "Error: Invalid version",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Fernet Decrypt",
|
||||
args: ["MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI="]
|
||||
}
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Fernet Decrypt: no secret",
|
||||
input: "gAAAAABce-Tycae8klRxhDX2uenJ-uwV8-A1XZ2HRnfOXlNzkKKfRxviNLlgtemhT_fd1Fw5P_zFUAjd69zaJBQyWppAxVV00SExe77ql8c5n62HYJOnoIU=",
|
||||
expectedOutput: "Error: Secret must be 32 url-safe base64-encoded bytes.",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Fernet Decrypt",
|
||||
args: [""]
|
||||
}
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Fernet Decrypt: valid arguments",
|
||||
input: "gAAAAABce-Tycae8klRxhDX2uenJ-uwV8-A1XZ2HRnfOXlNzkKKfRxviNLlgtemhT_fd1Fw5P_zFUAjd69zaJBQyWppAxVV00SExe77ql8c5n62HYJOnoIU=",
|
||||
expectedOutput: "This is a secret message.\n",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Fernet Decrypt",
|
||||
args: ["VGhpc0lzVGhpcnR5VHdvQ2hhcmFjdGVyc0xvbmdLZXk="]
|
||||
}
|
||||
],
|
||||
}
|
||||
]);
|
||||
|
||||
TestRegister.addTests([
|
||||
{
|
||||
name: "Fernet Encrypt: no input",
|
||||
input: "",
|
||||
expectedMatch: /^gAAAAABce-[\w-]+={0,2}$/,
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Fernet Encrypt",
|
||||
args: ["MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI="]
|
||||
}
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Fernet Encrypt: no secret",
|
||||
input: "This is a secret message.\n",
|
||||
expectedOutput: "Error: Secret must be 32 url-safe base64-encoded bytes.",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Fernet Encrypt",
|
||||
args: [""]
|
||||
}
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Fernet Encrypt: valid arguments",
|
||||
input: "This is a secret message.\n",
|
||||
expectedMatch: /^gAAAAABce-[\w-]+={0,2}$/,
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Fernet Encrypt",
|
||||
args: ["MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI="]
|
||||
}
|
||||
],
|
||||
}
|
||||
]);
|
Loading…
Add table
Add a link
Reference in a new issue