one-time-pad

3.0.0 • Public • Published

one-time-pad

a simple one-time pad cipher written in nodejs

Rules for this library

  • The key and message must only contain alphabetical letters.
  • All spaces in message and key will be removed when generating an encrypted message.
  • Punctuation and numbers will not be encrypted (in the future it will)

Usage

const pad = require("one-time-pad");
const secretKey = "ZXYSMMVBSTTVJ";
const encryptedMessage = pad.encrypt("SECRET MESSAGE", secretKey);
console.log(encryptedMessage); // RBAJQFHFKLTBN
 
const decryptedMessage = pad.decrypt("RBAJQFHFKLTBN", secretKey);
console.log(decryptedMessage); // SECRETMESSAGE

License

MIT

Package Sidebar

Install

npm i one-time-pad

Weekly Downloads

33

Version

3.0.0

License

MIT

Unpacked Size

6.24 kB

Total Files

6

Last publish

Collaborators

  • joshterrill