@amanoese/enigma

0.1.1 • Public • Published

enigma

Build Status npm version

enigmaのNode.jsによるシンプルな実装です。

Install

$ npm install @amanoese/enigma

Usage

const Enigma = require('@amanoese/enigma')

//ローターとプラグボード、リフレクターの位置を保存
let save_rotor = new Enigma().toJSON()

//送信側のエニグマを生成
//ローターとプラグボード、リフレクターの位置を設定
let send_enigma = new Enigma(save_rotor);
let encryptOutput = send_enigma.typeString('HELLO')

console.log(encryptOutput) // HELLOではない英字列

//受信側のエニグマを生成
//ローターとプラグボード、リフレクターの位置を設定
let receve_enigma = new Enigma(save_rotor);
let decryptOutput = receve_enigma.typeString(encryptOutput)

console.log(decryptOutput) // HELLO

Readme

Keywords

none

Package Sidebar

Install

npm i @amanoese/enigma

Weekly Downloads

3

Version

0.1.1

License

Apache-2.0

Unpacked Size

17.7 kB

Total Files

6

Last publish

Collaborators

  • amanoese