@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.
npm i @jihyunlab/web-secret
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);
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.
Authored and maintained by JihyunLab <[email protected]>
Open source licensed as MIT.