@haydenhigg/affine
A small library for affine encryption. Ideal behavior taken from here, other source is here.
Usage
const affine = require("@haydenhigg/affine");
let a = 5; // multiplicand
let b = 8; // addend
var encrypted = affine.encrypt(a, b, "the message");
var decrypted = affine.decrypt(a, b, encrypted);
console.log(encrypted); // "ZRC QCUUIMC"
console.log(decrypted); // "THE MESSAGE"
var encryptedWithKey = affine.encrypt(a, b, "the message", "the key");
var decryptedWithKey = affine.decrypt(a, b, encryptedWithKey, "the key");
console.log(encryptedWithKey); // "ZPE OESSDJE"
console.log(decryptedWithKey); // "THE MESSAGE"