2.0.0 • Published 7 months ago

node-enigma v2.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 months ago

node-enigma workflow status

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.

Install 🛠

$ npm install node-enigma

Usage 📜

import { encode, enigma, decode } from "node-enigma";

const m4 = enigma({
  rotors: ["v", "iv", "iii", "beta"],
  reflector: "bthin",
  options: {
    plugboard: {
      W: "L",
      D: "N",
    },
    code: ["C", "D", "E"]
  },
});

var result = decode(m4, "OGRFHRJYV"); // XXXKMVOXH


const m3 = enigma({
  rotors: ["v", "iv", "iii"],
  reflector: "ukwb",
  options: {
    plugboard: {
      Q: "V",
      S: "M",
    },
    code: ["A", "B", "C"]
  },
});

var result = decode(m3, "OGRFHRJYV"); // INAPICKLE


const machine = enigma({
  rotors: ["i", "ii", "iii"],
  reflector: "ukwb",
});

var result = encode(machine, "BABYDRIVER"); //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 ./src/node-enigma. Any fixes, cleanup or new features are always appreciated.

2.0.0

7 months ago

1.3.1

5 years ago

1.2.2

5 years ago

1.3.0

5 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago