1.1.5 • Published 3 years ago
keyboard-cipher v1.1.5
Keyboard Cipher
A keyboard shift cipher encryption and decryption algorithm.
Installation
# Install with npm
$ npm i --save keyboard-cipher
# Install with Yarn
$ yarn add keyboard-cipher
Examples
Encryption
var keyboardCipher = require('keyboard-cipher');
// Message to encrypt.
var plainText = 'hello world';
// Encrypt the message with either types of shifts: left or right.
var leftCipherText = keyboardCipher.encrypt(plainText, 'left');
var rightCipherText = keyboardCipher.encrypt(plainText, 'right');
// Log the results.
console.log(leftCipherText);
console.log(rightCipherText);
Decryption
var keyboardCipher = require('keyboard-cipher');
// Message to decrypt.
var cipherText = 'hello world';
// Decrypt the message with either types of shifts: left or right.
var leftPlainText = keyboardCipher.decrypt(cipherText, 'left');
var rightPlainText = keyboardCipher.decrypt(cipherText, 'right');
// Log the results.
console.log(leftPlainText);
console.log(rightPlainText);
Contributing
- Fork the repository.
- Clone the forked repository.
$ git clone git@github.com:GITHUB_USERNAME/keyboard-cipher.git
- Install and test.
$ npm install
$ npm run test
- Before committing, run ESLint.
$ npm run lint
Security
See the security policy for reporting vulnerabilities.
License
MIT License :copyright: Ryan Harrington