简单 aes-json
简约的 nodejs AES-256 实现。
安装
npm install simple - aes - json -- save
用法
var saj = require ( 'simple-aes-json' ) ;
// Encryption
saj . encrypt ( '123456789' , 'passphrase' , function ( encrypted ) {
console . log ( encrypted )
//{"ct":"z/apIxwSDRmqDlvhmTfhJA==","iv":"f960b8b5722b64b1ea4b09d7c548ffb8","s":"d20cc8ac7b5f31cb"}
} ) ;
// Decryption
saj . decrypt ( encryptedJSON , 'passph
1