@haydenhigg/rot

1.0.0 • Public • Published

@haydenhigg/rot

A small library for ROT encryption. Ideal behavior taken from here.

Usage

const rot = require("@haydenhigg/rot");

var encrypted = rot.encrypt(17, "the message");
var decrypted = rot.decrypt(17, encrypted);

console.log(encrypted); //=> "KYV DVJJRXV"
console.log(decrypted); //=> "THE MESSAGE"
 
var encryptedWithKey = rot.encrypt(17, "the message", "the key");
var decryptedWithKey = rot.decrypt(17, encryptedWithKey, "the key");

console.log(encryptedWithKey); //=> "GXU KUFFPWU"
console.log(decryptedWithKey); //=> "THE MESSAGE"

Package Sidebar

Install

npm i @haydenhigg/rot

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

2.59 kB

Total Files

3

Last publish

Collaborators

  • haydenhigg