node-enigma
Node.js module to cipher and decipher messages. This module is intended to imitate the operation of the Enigma M3/M4 developed during the WWII. For more information on Enigma, visit Enigma Cipher Machine.
Contact me @daveyeb with any questions, feedback or bugs.
New feature 😄
-
Machine avoids whitespaces and illegal characters.
-
Machine has no dependencies.
Install 🛠
$ npm install node-enigma
Usage 📜
var Enigma = ; /** * M4 CONFIGURATION * WHEEL POSITIONS [4TH, 3RD, 2ND, 1ST, REFLECTOR] * * M3 CONFIGURATION * WHEEL POSITIONS [ 3RD, 2ND, 1ST, REFLECTOR] * * WHEELS * ROTORS['i','ii','iii','iv','v','vi','vii,'viii'] * REFLECTORS['ukw-b','ukw-c','b-thin','c-thin'] * GREEK['beta', 'gamma'] */ const m4 = "beta" "v" "iv" "iii" "b-thin";m4;m4;m4; // XXXKMVOXH const m3 = "v" "iv" "iii" "ukw-b";m3;m3;m3; // INAPICKLE const enigma = "i" "ii" "iii" "ukw-b";enigma; //ADLVITPHWX
Refer to test directory for more basic usage
Contribute 🤝
Clone this repo to add custom wheels. Make a script inside the folder to test outputs with require('./lib/node-enigma')
. Any fixes, cleanup or new features are always appreciated.