From eb1f8b4bc65fa60c9c6e1f0c9e86e66961d2c044 Mon Sep 17 00:00:00 2001 From: s2224834 <46319860+s2224834@users.noreply.github.com> Date: Thu, 3 Jan 2019 16:40:29 +0000 Subject: [PATCH] Add Typex operation WIP --- src/core/config/Categories.json | 3 +- src/core/operations/Typex.mjs | 396 ++++++++++++++++++++++++++++++++ 2 files changed, 398 insertions(+), 1 deletion(-) create mode 100644 src/core/operations/Typex.mjs diff --git a/src/core/config/Categories.json b/src/core/config/Categories.json index 3e0d108e..f3b73921 100755 --- a/src/core/config/Categories.json +++ b/src/core/config/Categories.json @@ -103,7 +103,8 @@ "Citrix CTX1 Encode", "Citrix CTX1 Decode", "Pseudo-Random Number Generator", - "Enigma" + "Enigma", + "Typex" ] }, { diff --git a/src/core/operations/Typex.mjs b/src/core/operations/Typex.mjs new file mode 100644 index 00000000..89114863 --- /dev/null +++ b/src/core/operations/Typex.mjs @@ -0,0 +1,396 @@ +/** + * Emulation of the Typex machine. + * + * @author s2224834 + * @copyright Crown Copyright 2019 + * @license Apache-2.0 + */ + +import Operation from "../Operation"; +import OperationError from "../errors/OperationError"; +import Utils from "../Utils"; +import * as Enigma from "../lib/Enigma"; + +const ROTORS = [ + {name: "1", value: "QWECYJIBFKMLTVZPOHUDGNRSXA