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

Package detail

crypto-npm

alejack920BSD-3-Clause1.0.0

A small package to encrypt and decrypt messages using a pseudorandom function

crypto, encrypt, decrypt, pseudorandom, pseudo-random

readme

Crypto-npm

Crypto-npm is a small NPM Package to encrypt and decrypt arbitrary length messages via a pseudorandom functions.

Installation

Use the package manager npm to install crypto-npm.

npm install crypto-npm

Usage

const assert = require("assert");
const { getKey, encrypt, decrypt } = require("crypto-npm");

const message = "The secret message";
const key = getKey("the seed", message.length);
const encrypted = encrypt(message, key);
const decrypted = decrypt(encrypted, key);

assert(message === decrypted);

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

BSD 3-Clause License