Skip to content

ArmoredVortex/easy-enigma

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

An npm package to simulate an enigma machine

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published