浏览代码

Tidied up Lorenz operation and created new Bletchley module for WW2-era ciphers

n1474335 5 年之前
父节点
当前提交
9ed2b26933

文件差异内容过多而无法显示
+ 1 - 1
src/core/operations/Bombe.mjs


+ 1 - 1
src/core/operations/Enigma.mjs

@@ -21,7 +21,7 @@ class Enigma extends Operation {
         super();
 
         this.name = "Enigma";
-        this.module = "Default";
+        this.module = "Bletchley";
         this.description = "Encipher/decipher with the WW2 Enigma machine.<br><br>Enigma was used by the German military, among others, around the WW2 era as a portable cipher machine to protect sensitive military, diplomatic and commercial communications.<br><br>The standard set of German military rotors and reflectors are provided. To configure the plugboard, enter a string of connected pairs of letters, e.g. <code>AB CD EF</code> connects A to B, C to D, and E to F. This is also used to create your own reflectors. To create your own rotor, enter the letters that the rotor maps A to Z to, in order, optionally followed by <code>&lt;</code> then a list of stepping points.<br>This is deliberately fairly permissive with rotor placements etc compared to a real Enigma (on which, for example, a four-rotor Enigma uses only the thin reflectors and the beta or gamma rotor in the 4th slot).<br><br>More detailed descriptions of the Enigma, Typex and Bombe operations <a href='https://github.com/gchq/CyberChef/wiki/Enigma,-the-Bombe,-and-Typex'>can be found here</a>.";
         this.infoURL = "https://wikipedia.org/wiki/Enigma_machine";
         this.inputType = "string";

+ 21 - 21
src/core/operations/Lorenz.mjs

@@ -21,21 +21,21 @@ class Lorenz extends Operation {
         super();
 
         this.name = "Lorenz";
-        this.module = "Default";
-        this.description = "The Lorenz SZ40/42 cipher attachment was a WW2 German rotor cipher machine with twelve rotors which attached in-line between remote teleprinters.<br><br>It used the Vernam cipher with two groups of five rotors (named the psi(ψ) wheels and chi(χ) wheels at Bletchley Park) to create two pseudorandom streams of five bits, encoded in ITA2, which were XOR added to the plaintext. Two other rotors, dubbed the mu(μ) or motor wheels, could hold up the stepping of the psi wheels meaning they stepped intermittently.<br><br>Each rotor has a different number of cams/lugs around their circumference which could be set active or inactive changing the key stream.<br><br>Three models of the Lorenz are emulated, SZ40, SZ42a and SZ42b and three example wheel patterns (the lug settings) are included (KH, ZMUG & BREAM) with the option to set a custom set using the letter 'x' for active or '.' for an inactive lug.<br><br>The input can either be plaintext or ITA2 when sending and ITA2 when receiving.<br><br>To learn more, Virtual Lorenz, an online, browser based simulation of the Lorenz SZ40/42 is available at <a href='https://lorenz.virtualcolossus.co.uk'>https://lorenz.virtualcolossus.co.uk</a>.";
-        this.infoURL = "https://en.wikipedia.org/wiki/Lorenz_cipher";
+        this.module = "Bletchley";
+        this.description = "The Lorenz SZ40/42 cipher attachment was a WW2 German rotor cipher machine with twelve rotors which attached in-line between remote teleprinters.<br><br>It used the Vernam cipher with two groups of five rotors (named the psi(ψ) wheels and chi(χ) wheels at Bletchley Park) to create two pseudorandom streams of five bits, encoded in ITA2, which were XOR added to the plaintext. Two other rotors, dubbed the mu(μ) or motor wheels, could hold up the stepping of the psi wheels meaning they stepped intermittently.<br><br>Each rotor has a different number of cams/lugs around their circumference which could be set active or inactive changing the key stream.<br><br>Three models of the Lorenz are emulated, SZ40, SZ42a and SZ42b and three example wheel patterns (the lug settings) are included (KH, ZMUG & BREAM) with the option to set a custom set using the letter 'x' for active or '.' for an inactive lug.<br><br>The input can either be plaintext or ITA2 when sending and ITA2 when receiving.<br><br>To learn more, Virtual Lorenz, an online, browser based simulation of the Lorenz SZ40/42 is available at <a href='https://lorenz.virtualcolossus.co.uk' target='_blank'>https://lorenz.virtualcolossus.co.uk</a>.";
+        this.infoURL = "https://wikipedia.org/wiki/Lorenz_cipher";
         this.inputType = "string";
         this.outputType = "string";
         this.args = [
             {
                 name: "Model",
                 type: "option",
-                "value": ["SZ40", "SZ42a", "SZ42b"]
+                value: ["SZ40", "SZ42a", "SZ42b"]
             },
             {
                 name: "Wheel Pattern",
                 type: "argSelector",
-                "value": [
+                value: [
                     {
                         name: "KH Pattern",
                         off: [19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]
@@ -65,7 +65,7 @@ class Lorenz extends Operation {
             {
                 name: "Mode",
                 type: "argSelector",
-                "value": [
+                value: [
                     {
                         name: "Send",
                         on: [4],
@@ -81,77 +81,77 @@ class Lorenz extends Operation {
             {
                 name: "Input Type",
                 type: "option",
-                "value": ["Plaintext", "ITA2"]
+                value: ["Plaintext", "ITA2"]
             },
             {
                 name: "Output Type",
                 type: "option",
-                "value": ["Plaintext", "ITA2"]
+                value: ["Plaintext", "ITA2"]
             },
             {
                 name: "ITA2 Format",
                 type: "option",
-                "value": ["5/8/9", "+/-/."]
+                value: ["5/8/9", "+/-/."]
             },
             {
                 name: "Ψ1 start (1-43)",
                 type: "number",
-                "value": 1
+                value: 1
             },
             {
                 name: "Ψ2 start (1-47)",
                 type: "number",
-                "value": 1
+                value: 1
             },
             {
                 name: "Ψ3 start (1-51)",
                 type: "number",
-                "value": 1
+                value: 1
             },
             {
                 name: "Ψ4 start (1-53)",
                 type: "number",
-                "value": 1
+                value: 1
             },
             {
                 name: "Ψ5 start (1-59)",
                 type: "number",
-                "value": 1
+                value: 1
             },
             {
                 name: "Μ37 start (1-37)",
                 type: "number",
-                "value": 1
+                value: 1
             },
             {
                 name: "Μ61 start (1-61)",
                 type: "number",
-                "value": 1
+                value: 1
             },
             {
                 name: "Χ1 start (1-41)",
                 type: "number",
-                "value": 1
+                value: 1
             },
             {
                 name: "Χ2 start (1-31)",
                 type: "number",
-                "value": 1
+                value: 1
             },
             {
                 name: "Χ3 start (1-29)",
                 type: "number",
-                "value": 1
+                value: 1
             },
             {
                 name: "Χ4 start (1-26)",
                 type: "number",
-                "value": 1
+                value: 1
             },
             {
                 name: "Χ5 start (1-23)",
                 type: "number",
-                "value": 1
+                value: 1
             },
             {
                 name: "Ψ1 lugs (43)",

+ 1 - 1
src/core/operations/MultipleBombe.mjs

@@ -54,7 +54,7 @@ class MultipleBombe extends Operation {
         super();
 
         this.name = "Multiple Bombe";
-        this.module = "Default";
+        this.module = "Bletchley";
         this.description = "Emulation of the Bombe machine used to attack Enigma. This version carries out multiple Bombe runs to handle unknown rotor configurations.<br><br>You should test your menu on the single Bombe operation before running it here. See the description of the Bombe operation for instructions on choosing a crib.<br><br>More detailed descriptions of the Enigma, Typex and Bombe operations <a href='https://github.com/gchq/CyberChef/wiki/Enigma,-the-Bombe,-and-Typex'>can be found here</a>.";
         this.infoURL = "https://wikipedia.org/wiki/Bombe";
         this.inputType = "string";

+ 1 - 1
src/core/operations/Typex.mjs

@@ -22,7 +22,7 @@ class Typex extends Operation {
         super();
 
         this.name = "Typex";
-        this.module = "Default";
+        this.module = "Bletchley";
         this.description = "Encipher/decipher with the WW2 Typex machine.<br><br>Typex was originally built by the British Royal Air Force prior to WW2, and is based on the Enigma machine with some improvements made, including using five rotors with more stepping points and interchangeable wiring cores. It was used across the British and Commonwealth militaries. A number of later variants were produced; here we simulate a WW2 era Mark 22 Typex with plugboards for the reflector and input. Typex rotors were changed regularly and none are public: a random example set are provided.<br><br>To configure the reflector plugboard, enter a string of connected pairs of letters in the reflector box, e.g. <code>AB CD EF</code> connects A to B, C to D, and E to F (you'll need to connect every letter). There is also an input plugboard: unlike Enigma's plugboard, it's not restricted to pairs, so it's entered like a rotor (without stepping). To create your own rotor, enter the letters that the rotor maps A to Z to, in order, optionally followed by <code>&lt;</code> then a list of stepping points.<br><br>More detailed descriptions of the Enigma, Typex and Bombe operations <a href='https://github.com/gchq/CyberChef/wiki/Enigma,-the-Bombe,-and-Typex'>can be found here</a>.";
         this.infoURL = "https://wikipedia.org/wiki/Typex";
         this.inputType = "string";

+ 1 - 0
tests/operations/tests/Lorenz.mjs

@@ -1,5 +1,6 @@
 /**
  * Lorenz SZ40/42a/42b machine tests.
+ *
  * @author VirtualColossus
  * @copyright Crown Copyright 2019
  * @license Apache-2.0

部分文件因为文件数量过多而无法显示