Skip to content

Encrypting and decrypting strings with `aes-256-gcm`

Notifications You must be signed in to change notification settings

devoxa/aes-encryption

Folders and files

NameName
Last commit message
Last commit date
Dec 21, 2024
Dec 5, 2024
Aug 8, 2023
Aug 5, 2023
May 22, 2020
May 22, 2020
Dec 21, 2024
Dec 5, 2024
Dec 21, 2024
Mar 7, 2025
Dec 21, 2024
Mar 7, 2025

Repository files navigation

aes-encryption

Encrypting and decrypting strings with aes-256-gcm

Package Version Build Status Code Coverage

InstallationUsageContributorsLicense


Installation

yarn add @devoxa/aes-encryption

Usage

Under no circumstances use this for passwords. You should be using hashing instead. Read more

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'

Contributors

Thanks goes to these wonderful people (emoji key):


David Reeß

💻 📖 ⚠️

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT