Skip to content

nextorigin/aescrypt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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