mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-22 15:56:16 -04:00
Typex: add ring setting
This commit is contained in:
parent
1b1a3c261d
commit
220053c044
2 changed files with 35 additions and 11 deletions
|
@ -39,6 +39,11 @@ class Typex extends Operation {
|
|||
type: "boolean",
|
||||
value: false
|
||||
},
|
||||
{
|
||||
name: "1st rotor ring setting",
|
||||
type: "option",
|
||||
value: LETTERS
|
||||
},
|
||||
{
|
||||
name: "1st rotor initial value",
|
||||
type: "option",
|
||||
|
@ -55,6 +60,11 @@ class Typex extends Operation {
|
|||
type: "boolean",
|
||||
value: false
|
||||
},
|
||||
{
|
||||
name: "2nd rotor ring setting",
|
||||
type: "option",
|
||||
value: LETTERS
|
||||
},
|
||||
{
|
||||
name: "2nd rotor initial value",
|
||||
type: "option",
|
||||
|
@ -71,6 +81,11 @@ class Typex extends Operation {
|
|||
type: "boolean",
|
||||
value: false
|
||||
},
|
||||
{
|
||||
name: "3rd rotor ring setting",
|
||||
type: "option",
|
||||
value: LETTERS
|
||||
},
|
||||
{
|
||||
name: "3rd rotor initial value",
|
||||
type: "option",
|
||||
|
@ -87,6 +102,11 @@ class Typex extends Operation {
|
|||
type: "boolean",
|
||||
value: false
|
||||
},
|
||||
{
|
||||
name: "4th rotor ring setting",
|
||||
type: "option",
|
||||
value: LETTERS
|
||||
},
|
||||
{
|
||||
name: "4th rotor initial value",
|
||||
type: "option",
|
||||
|
@ -103,6 +123,11 @@ class Typex extends Operation {
|
|||
type: "boolean",
|
||||
value: false
|
||||
},
|
||||
{
|
||||
name: "5th rotor ring setting",
|
||||
type: "option",
|
||||
value: LETTERS
|
||||
},
|
||||
{
|
||||
name: "5th rotor initial value",
|
||||
type: "option",
|
||||
|
@ -156,14 +181,14 @@ class Typex extends Operation {
|
|||
* @returns {string}
|
||||
*/
|
||||
run(input, args) {
|
||||
const reflectorstr = args[15];
|
||||
const plugboardstr = args[16];
|
||||
const typexKeyboard = args[17];
|
||||
const removeOther = args[18];
|
||||
const reflectorstr = args[20];
|
||||
const plugboardstr = args[21];
|
||||
const typexKeyboard = args[22];
|
||||
const removeOther = args[23];
|
||||
const rotors = [];
|
||||
for (let i=0; i<5; i++) {
|
||||
const [rotorwiring, rotorsteps] = this.parseRotorStr(args[i*3]);
|
||||
rotors.push(new Rotor(rotorwiring, rotorsteps, args[i*3 + 1], args[i*3+2]));
|
||||
const [rotorwiring, rotorsteps] = this.parseRotorStr(args[i*4]);
|
||||
rotors.push(new Rotor(rotorwiring, rotorsteps, args[i*4 + 1], args[i*4+2], args[i*4+3]));
|
||||
}
|
||||
const reflector = new Reflector(reflectorstr);
|
||||
let plugboardstrMod = plugboardstr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue