Socket
Socket
Sign inDemoInstall

nodejs-aes256

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    nodejs-aes256

This is an easy to use AES256 module for nodejs.


Version published
Weekly downloads
1.4K
decreased by-34.33%
Maintainers
1
Install size
4.93 kB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 27 Dec 2015

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc