@jihyunlab/web-secret
v1.0.4
Published
JihyunLab Web secret.
Downloads
7
Readme
@jihyunlab/web-secret
@jihyunlab/web-secret provides functionality in web applications to decrypt .env files encrypted with @jihyunlab/secret-cli.
The encryption function is implemented with @jihyunlab/web-crypto and provides encryption for AES 256 GCM.
Installation
npm i @jihyunlab/web-secret
Usage
Decrypt the .env key value by directly entering the separately managed encryption key.
import { CIPHER, Env } from '@jihyunlab/web-secret';
const cipher = await Env.createCipher(CIPHER.AES_256_GCM, 'YourSecretKey');
const value = await cipher.decrypt(process.env.ENV_KEY);
Encryption key
In web applications, since it's not possible to retrieve system or user environment variables, it's recommended to manage and directly input encryption keys separately.
Credits
Authored and maintained by JihyunLab <[email protected]>
License
Open source licensed as MIT.