2.0.1 • Published 12 months ago

@jihyunlab/secret v2.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

@jihyunlab/secret

Version Downloads Last commit License Linter code style: prettier\ Build Lint codecov

@jihyunlab/secret provides functionality in Node.js applications to decrypt .env files encrypted with @jihyunlab/secret-cli.

The encryption function is implemented with @jihyunlab/crypto and provides encryption for AES 256 GCM.

Installation

npm i @jihyunlab/secret

Usage

Decrypt the .env key value by directly entering the separately managed encryption key.

import { CIPHER, Env } from '@jihyunlab/secret';

const cipher = await Env.createCipher(CIPHER.AES_256_GCM, 'YourSecretKey');
const value = await cipher.decrypt(process.env.ENV_KEY);

Encryption key

If you register JIHYUNLAB_SECRET_KEY in system or user environment variables, it will be used as the encryption key during encryption.

export JIHYUNLAB_SECRET_KEY=YourSecretKey

You can decrypt the .env key value using the encryption key registered in the environment variables.

import { Env } from '@jihyunlab/secret';

const cipher = await Env.createCipher();
const value = await cipher.decrypt(process.env.ENV_KEY);

Credits

Authored and maintained by JihyunLab <info@jihyunlab.com>

License

Open source licensed as MIT.

2.0.1

12 months ago

2.0.0

12 months ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.10

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago