1.0.0 • Published 7 years ago

aescrypt v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

AESCrypt

Build Status Coverage Status Dependency Status devDependency Status Downloads

AES Salted Encryption helper

Partially inspired by AESCrypt Ruby gem.

NPM

Installation

npm install --save aescrypt

Usage

AESCrypt.encryptWithSalt(keytext, cleardata)

AESCrypt = require "aescrypt"

keytext   = "toomanysecrets"
cleardata = "we have explosive"

{encrypted, salt} = AESCrypt.encryptWithSalt keytext, cleardata

###
encrypted = "nm6Ky1J/L7oBmiCont3hBzMwIf7cThAakcokykg="
salt      = "C/GzCUNDSjiotRNei17TfQ=="
###

AESCrypt.decryptWithSalt(keytext, salt, encrypted)

AESCrypt = require "aescrypt"

encrypted = "nm6Ky1J/L7oBmiCont3hBzMwIf7cThAakcokykg="
salt      = "C/GzCUNDSjiotRNei17TfQ=="

decrypted = AESCrypt.decryptWithSalt keytext, salt, encrypted

###
decrypted = "we have explosive"
###

License

MIT