caeser
v1.1.6 cryptography crypto encryption decryption
Install
$ npm install --save caeser
Usage
var caeser = require('caeser');
console.log(caeser.encrypt('hello!', 3));
//=> khoor!
console.log(caeser.decrypt('khoor!', 3));
//=> hello!
API
caeser.encrypt(plainText, key)
plainText
Type: string
The plain text to be encrypted.
key
Type: number
The key that will be used to encrypt the plain text. It encrypts it by shifting each character right from it's current position in the alphabet by whatever the value of key is. If i used 3 as the key, a would become d, d would become g, etc.
caeser.decrypt(cipherText, key)
cipherText
Type: string
The cipher text to be decrypted.
key
Type: number
The key that will be used to decrypt the cipher text. It decrypts it by shifting each character left from it's current position in the alphabet by whatever the value of key is. If i used 3 as the key, d would become a, g would become d, etc.
License
MIT ©Maximilian Lloyd