(scroll below for detailed instructions)
const enigmajs = require('easy-enigma');
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));
- Super simple
- Easy to use
- Customisable
const enigmajs = require('easy-enigma');
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.