@robotti.io/escrypt

0.0.3 • Public • Published

escrypt

ESCrypt: An enterprise secret encryption/decryption package designed to enable build time secret encryption capabilities

pipeline status

coverage report

Latest Release

Install via NPM

npm intall @robotti.io/escrypt

Usage

Create Encryption Key Pair

This will create a key pair with the name environment-public.pem and environment-private.pem. It will also create an empty json file called environment.config to to store encrypted secrets in.

const ESCrypt = require('escrypt');
const mySecretEncryptor = new ESCrypt({
  environment: 'local',
  keyDirectory: './',
  configurationDirectory: './',
  configurationType: 'json'
});

Encrypt a secret

To encrypt a secret only the public key is required. The cryptor will encrypt the secret with the the public key and store it in the environment.config file.

const ESCrypt = require('escrypt');
const mySecretEncryptor = new ESCrypt({
  environment: 'local',
  keyDirectory: './',
  configurationDirectory: './',
  configurationType: 'json'
});
mySecretEncryptor.encrypt('secretKey', '5up3rS3cr37$%!');

Decrypt a secret

To decrypt a secret the private key is required. The cryptor will decrypt the value of the key in the environment.config file and return the decrypted value.

const ESCrypt = require('escrypt');
const mySecretEncryptor = new ESCrypt({
  environment: 'local',
  keyDirectory: './',
  configurationDirectory: './',
  configurationType: 'json'
});
const decryptedSecret = mySecretEncryptor.decrypt('secretKey');

Package Sidebar

Install

npm i @robotti.io/escrypt

Weekly Downloads

0

Version

0.0.3

License

ISC

Unpacked Size

21 kB

Total Files

11

Last publish

Collaborators

  • jeymz