aescrypt
v1.0.0
Published
AES Salted Encryption helper
Downloads
6
Maintainers
Readme
AESCrypt
AES Salted Encryption helper
Partially inspired by AESCrypt Ruby gem.
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