Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

deguise

haydenhigg2MITdeprecated1.0.4

deprecated

A collection of pen-and-paper ciphers, for fun.

cipher, decipher, encipher, crypt, decrypt, encrypt, encryption, affine, atbash, otp, rot, rot13, vigenere, gronsfeld

readme

deguise

This is a library of pen-and-paper ciphers (not secure encryptions). They are excellent for quickly and easily obscuring/obfuscating text however, and while they are not technically encryptions, many have still eva

#

All of the algorithms have a similar set of methods: encrypt and decrypt. These methods do differ in what arguments they take, however.

#

For the rest of the documentation I will use the variables message to represent the text to be enciphered, key to represent a numerical key, passphrase to represent a textual key, and alphabetKey to represent a possible string to alter the alphabet used.

Initialization

  • Atbash: constructor()
  • ROT: constructor(key)
  • Substitution: constructor()
  • Affine: constructor(a, b) where a is the multiplicand and b is the addend
  • OTP: constructor(passphrase)
  • Vigenere: constructor(passphrase)
  • Gronsfeld: constructor(key)
  • Skip: constructor(key)

Encryption

  • Atbash: encrypt(message)
  • ROT: encrypt(message[, alphabetKey = ""])
  • Substitution: encrypt(message, alphabetKey) (the message won't change if alphabetKey == "")
  • Affine: encrypt(message[, alphabetKey = ""])
  • OTP: encrypt(message)
  • Vigenere: encrypt(message[, alphabetKey = ""])
  • Gronsfeld: encrypt(message[, alphabetKey = ""])
  • Skip: encrypt(message[, alphabetKey = ""])

Decryption

  • Atbash: decrypt(message)
  • ROT: decrypt(message[, alphabetKey = ""])
  • Substitution: decrypt(message, alphabetKey)
  • Affine: decrypt(message[, alphabetKey = ""])
  • OTP: decrypt(message)
  • Vigenere: decrypt(message[, alphabetKey = ""])
  • Gronsfeld: decrypt(message[, alphabetKey = ""])
  • Skip: decrypt(message[, alphabetKey = ""])

Example

const { Vigenere } = require("deguise");

const cipher = new Vigenere("passphrase");

var encrypted = cipher.encrypt("Hello world!");
var decrypted = cipher.decrypt(encrypted);

console.log(encrypted); // "WEDDD DFRDH!"
console.log(decrypted); // "HELLO WORLD!"