Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
This is a Javascript implementation of the British Cipher Machine - TypeX
JavaScript
branch: master
Failed to load latest commit information.
example
.gitignore
README.md
typex.js

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
Something went wrong with that request. Please try again.