Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nodejs-aes256

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodejs-aes256

This is an easy to use AES256 module for nodejs.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
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

Package last updated on 27 Dec 2015

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc