A Node.js implementation of MySQL
aes_encrypt
andaes_decrypt
$ npm i mysql-aes --save
const AES = require('mysql-aes')
return type | signature | equal in mysql |
---|---|---|
String |
AES.encrypt(str, key) |
SELECT HEX(AES_ENCRYPT(str, key)) |
String |
AES.decrypt(encrypted, key) |
SELECT CAST(AES_DECRYPT(UNHEX(encrypted), key) as CHAR) |
the MIT License http://magicdawn.mit-license.org