Skip to content
/ typex Public

This is a Javascript implementation of the British Cipher Machine - TypeX

Notifications You must be signed in to change notification settings

rd13/typex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

This is a Javascript implementation of the British Cipher Machine - TypeX

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published