1.0.0 • Published 5 years ago

@haydenhigg/rot v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

@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"