1
0
mirror of synced 2025-01-19 00:04:08 +01:00

Added SIGABA simple test

This commit is contained in:
hettysymes 2020-01-12 17:57:20 +00:00 committed by hettysymes
parent 938385c18b
commit e2b3389da6
2 changed files with 69 additions and 1 deletions

3
src/core/config/Categories.json Executable file → Normal file
View File

@ -116,7 +116,8 @@
"Multiple Bombe",
"Typex",
"Lorenz",
"Colossus"
"Colossus",
"SIGABA"
]
},
{

View File

@ -0,0 +1,67 @@
/**
SIGABA machine tests
@author hettysymes
@copyright hettysymes 2020
@license Apache-2.0
*/
import TestRegister from "../../lib/TestRegister.mjs";
TestRegister.addTests([
{
name: "SIGABA: encrypt",
input: "hello world testing the sigaba machine",
expectedOutput: "ULBECJCZJBJFVUDLIXGLGIVXSYGMFRJVCERGOX",
recipeConfig: [
{
"op": "SIGABA",
"args": [
"BHKWECJDOVAYLFMITUGXRNSPZQ", true, "G",
"CDTAKGQOZXLVJYHSWMIBPRUNEF", false, "L",
"WAXHJZMBVDPOLTUYRCQFNSGKEI", false, "I",
"HUSCWIMJQXDALVGBFTOYZKRPNE", false, "T",
"RTLSMNKXFVWQUZGCHEJBYDAIPO", false, "B",
"GHAQBRJWDMNZTSKLOUXYPFIECV", false, "N",
"VFLGEMTCXZIQDYAKRPBONHWSUJ", true, "Q",
"ZQCAYHRJNXPFLKIOTBUSVWMGDE", false, "B",
"EZVSWPCTULGAOFDJNBIYMXKQHR", false, "J",
"ELKSGDXMVYJUZNCAROQBPWHITF", false, "R",
"3891625740", "3",
"6297135408", "1",
"2389715064", "8",
"9264351708", "6",
"9573086142", "6",
"Encrypt"
]
}
]
},
{
name: "SIGABA: decrypt",
input: "helloxworldxtestingxthexsigabaxmachine",
expectedOutput: "XWCIWSAIQKNPBUKAP QXVYW RRNYAWXKRBGCQS",
recipeConfig: [
{
"op": "SIGABA",
"args": [
"ZECIPSQVBYKJTNRLOXUFGAWHMD", false, "C",
"IPHECDYSZTRXQUKWNVGOBLFJAM", true, "J",
"YHXUSRKIJVQWTPLAZOMDCGNEFB", true, "Z",
"TDPVSOBXULANZQYEHIGFMCRWJK", false, "W",
"THZGFXQRVBSDUICNYJWPAEMOKL", false, "F",
"KOVUTBMZQWGYDNAICSPHERXJLF", false, "F",
"DSTRLAUFXGWCEOKQPVMBZNIYJH", true, "A",
"KCULNSIXJDPEHGQYRTFZVWOBAM", false, "H",
"DZANEQLOWYRXKGUSIVJFMPBCHT", true, "M",
"MVRLHTPFWCAOKEGXZBJYIQUNSD", false, "E",
"9421765830", "3",
"3476815902", "2",
"5701842693", "7",
"4178920536", "0",
"5243709861", "1",
"Decrypt"
]
}
]
}
]);