nodejs-aes256

1.0.1 • Public • Published

nodejs-aes256

This is an easy to use AES256 module for nodejs.

This module generates a random initialization vector each time the encrypt method is called. Furthermore, your shared key can be of any size because it is hashed using sha256.

Setup

Make sure you install and require the nodejs-aes256 module.

npm install nodejs-aes256

var aes256 = require('nodejs-aes256');

Encryption

Ciphertext is base64 encoded. The first parameter is the shared key and the second is the plaintext.

var ciphertext = aes256.encrypt(key, plaintext);

Decryption

For decryption, simply provide the shared key and ciphertext.

var plaintext = aes256.decrypt(key, ciphertext);

Notes

  • This has only been tested with strings for the shared key and plaintext
  • It does not detect if decryption has failed

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    1,797
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    1,797
  • 1.0.0
    0

Package Sidebar

Install

npm i nodejs-aes256

Weekly Downloads

1,797

Version

1.0.1

License

MIT

Last publish

Collaborators

  • jaysvoboda