easy-enigma
v1.0.1
Published
An npm package to simulate the enigma encrytption machine
Downloads
2
Readme
Welcome to easy-enigma Documentation
Installation
NPM:
Quick Start
(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));
Features
- Super simple
- Easy to use
- Customisable
Detailed Instructions
Import
const enigmajs = require('easy-enigma');
Creating a rotor
const rotor1 = enigmajs.rotor(/* Rotor Configuration */, /* Current rotor position */);
Creating a reflector
const reflector = enigmajs.reflector(/* Reflector Configuration */);
Creating the enigma engine
const engine = enigmajs.engine( [/* rotor1, rotor2, rotor3 */], /* reflector */);
Modifying rotor position on engine
engine.setRotorPositions(['A', 'A', 'A]);
Support or Contact
Having trouble? Contact me and I’ll help you sort it out.