1.1.5 • Published 1 year ago
@distributed/aes v1.1.5
Package to encrypt & decrypt strings using
aes-256-gcm.
Install
With yarn:
yarn add @distributed/aesWith npm:
npm install @distributed/aesUsage
Don't use this package to encrypt your passwords, use hashing algorithms like argon2 or bcrypt instead.
import { encrypt, decrypt } from '@distributed/aes';
const key = 'secureKey';
const encrypted = encrypt(key, 'foo'); // 4lxXNMY0dxjTLtP2i8KV3Fe770+yaEj3KnGUPdKKHn0pgXo=
const decrypted = decrypt(key, encrypted); // fooDemo on the fly
# Encrypt
curl https://aes.distributed.sh/encrypt?key=secureKey&input=foo
# -> aWmlhjZpAn/vbhsN60zciuUMnNNyec8ow0mNNde/IbCgy0M=%
# Decrypt
curl -X https://aes.distributed.sh/decrypt?key=secureKey&input="aWmlhjZpAn/vbhsN60zciuUMnNNyec8ow0mNNde/IbCgy0M="
# -> fooDevelopment
- Install dependencies using
yarn installornpm install - Start development server using
yarn watch