Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
A simple bi-directional salting and encryption system designed for securing authentication tokens.
A simple bi-directional salting and encryption system designed for securing authentication tokens.
"use strict";
const EasyCrypt = require("../EasyCrypt.js");
const ez = new EasyCrypt();
let stringToEncrypt = "This is easy.";
let crypted = ez.encrypt(stringToEncrypt);
console.log(`Crypted: ${crypted.content}`);
console.log(`Decrypted: ${ez.decrypt(crypted)}`);
npm install easycrypt
Main class, constructor has no arguments and returns a EasyCrypt object.
The encryption password is stored on an environment variable called EasyCryptPW.
You must set the environment variable before using EasyCrypt.
From the command line:
EasyCryptPW='3zTvzr3p67VC61jmV54rIYu1545x4TlY' node EasyCrypt.js
const EasyCrypt = require("../EasyCrypt.js");
const ez = new EasyCrypt();
Used to salt an encrypt a piece of text.
const EasyCrypt = require("../EasyCrypt.js");
const ez = new EasyCrypt(/\S+/g);
const text = ez.encrypt("Easy");
console.log(text);
/*
* { content: '5cc07dd95c919de9544ed4f1f5+H9StNlQK',
* tag: <Buffer 97 78 be 76 66 da 3c 71 ca fd 4e a0 07 d0 39 f8> }
*/
// This same object must be passed to decrypt, so store content and tag
Returns object with authorization buffer and encrypted content.
Used to salt an encrypt a piece of text.
const EasyCrypt = require("../EasyCrypt.js");
const ez = new EasyCrypt(/\S+/g);
const text = ez.encrypt("Easy");
console.log(ez.decrypt(text)); // Easy
Returns the original decrypted string.
To run mocha/chai tests.
npm run test
To run the main example.
npm run ex
EasyCrypt.js is released under the MIT license.
FAQs
A simple bi-directional salting and encryption system designed for securing authentication tokens.
The npm package easycrypt receives a total of 1 weekly downloads. As such, easycrypt popularity was classified as not popular.
We found that easycrypt demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.