New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

mysql-aes-binary

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mysql-aes-binary

nodejs implementation of aes_encrypt and aes_decrypt, using binary data thus saving valuable space

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

mysql-aes-binary

  • This module is based on the popular module mysql-aes.

  • mysql-aes, however, transforms values to 'hex' after encryption. This results in at least 'doubling' the data size depending on the encoding you use. To directly quote from mysql documentation: "The size penalty for storing the hex string in a CHAR column is at least two times, up to eight times if the value is stored in a column that uses the utf8 character set (where each character uses 4 bytes). Storing the string also results in slower comparisons because of the larger values and the need to take character set collation rules into account."

  • You can check the mysql documentation for details: https://dev.mysql.com/doc/refman/8.0/en/encryption-functions.html

  • Our module is similar to mysql-aes, however, we keep the encrypted data as binary. Thus, we save you at least half (50%) your database size.

  • This is a Node.js implementation of MySQL aes_encrypt and aes_decrypt

  • Lastly, do not forget to make your column types as 'varbinary' in mysql...

Install

$ npm i mysql-aes-binary --save

API

const AES = require('mysql-aes-binary')
return typesignatureequal in mysql
StringAES.encrypt(str, key)SELECT AES_ENCRYPT(str, key)
StringAES.decrypt(encrypted, key)SELECT CAST(AES_DECRYPT(encrypted, key) as CHAR)

License

the MIT License http://magicdawn.mit-license.org

Keywords

mysql

FAQs

Package last updated on 29 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts