An npm package to simulate an enigma machine
(scroll below for detailed instructions)
const enigmajs = require('enigmajs');
const rotor1 = enigmajs.rotor('BDFHJLCPRTXVZNYEIWGAKMUSQO', 'A');
const rotor2 = enigmajs.rotor('AJDKSIRUXBLHWTMCQGZNPYFVOE', 'A');
const rotor3 = enigmajs.rotor('EKMFLGDQVZNTOWYHXUSPAIBRCJ', 'A');
const reflector = enigmajs.reflector('YRUHQSLDPXNGOKMIEBFZCWVJAT');
const engine = enigmajs.engine([rotor1, rotor2, rotor3],reflector)
const message = 'Hello World'
console.log(engine.convert(message));
const enigmajs = require('enigmajs');
const rotor1 = enigmajs.rotor(/* Rotor Configuration */, /* Current rotor position */);
const reflector = enigmajs.reflector(/* Reflector Configuration */);
const engine = enigmajs.engine( [/* rotor1, rotor2, rotor3 */], /* reflector */
engine.setRotorPositions(['A', 'A', 'A']);
Having trouble? Contact me and I’ll help you sort it out.