This is a Javascript implementation of the British Cipher Machine - TypeX
JavaScript
Switch branches/tags
Nothing to show
Latest commit 1f1883d Jun 21, 2013 @rd13 rd13 Update to readme
Permalink
Failed to load latest commit information.
example Update to readme Jun 21, 2013
.gitignore Added simple frontend, updated readme. Jun 20, 2013
README.md Update to readme Jun 21, 2013
typex.js Added simple frontend, updated readme. Jun 20, 2013

README.md

Typex Simulator

This is a Javascript implementation of the British Rotor Cipher Machine - Typex.

TypeX.init() accepts 4 arguments:

  1. Which rotors to use.
  2. The orientation of the rotors. 1 = reversed.
  3. The indicator key (the starting position for each rotor)
  4. Text to encipher / decipher

Unfortunately the actual rotor wirings of the Typex have never been disclosed or recovered. So the wirings used in this example are that of the Enigma.

Usage instructions

Either run from the command line with Node, or there is an example interface in example/index.html. Just open this file in your browser.

Enciphering
TypeX.init('01234', '00100', 'AOAKN', 'This is the string to be encoded');
// Output: KLHESNYNIMQAZHIZROBHDZHKWRQFFRTY
Deciphering
TypeX.init('01234', '00100', 'AOAKN', 'KLHESNYNIMQAZHIZROBHDZHKWRQFFRTY');
// Output: THISXISXTHEXSTRINGXTOXBEXENCODED