Encrypting and decrypting strings with `aes-256-gcm`
npm install @devoxa/aes-encryptionaes-256-gcm.
src="https://img.shields.io/npm/v/@devoxa/aes-encryption?style=flat-square"
alt="Package Version"
/>
Installation •
Usage •
Contributors •
License
``bash`
yarn add @devoxa/aes-encryption
**Under no circumstances use this for passwords. You should be using hashing instead.
Read more**
`ts
import { encrypt, decrypt } from '@devoxa/aes-encryption'
// The 32 character encryption key
const key = 'ZtdDl3Ex7ycFfgdbAC3uTLNk8eLVDcEd'
const encrypted = encrypt(key, 'My secret text')
// -> 'j2G63AgcRSkiFeE4jonB8I/GZYp6Uc40ItdwSappAWi75ItbDzzoOzo7EuaMaA=='
const decrypted = decrypt(key, encrypted)
// -> 'My secret text'
``
Thanks goes to these wonderful people (emoji key):
David Reeß 💻 📖 ⚠️ |
This project follows the all-contributors
specification. Contributions of any kind welcome!
MIT