Socket
Socket
Sign inDemoInstall

cryptorjs

Package Overview
Dependencies
0
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cryptorjs

Encrypt and decrypt string using a key


Version published
Weekly downloads
181
increased by23.97%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Cryptorjs Build Status

Simple library for encryption and decryption of string using a key

Installation

npm install cryptorjs --save

Example

Basic

var cryptorjs = require('cryptorjs');

var myCryptor = new cryptorjs('yourSecretKey');

var encoded = myCryptor.encode('myExampleString');
// => '37d8e07a3dddc2971f3e53b1021f51'

var decoded = myCryptor.decode('37d8e07a3dddc2971f3e53b1021f51');
// => 'myExampleString'

With a cipher

For example using "blowfish" cipher

var cryptorjs = require('cryptorjs');

var myCryptor = new cryptorjs('yourSecretKey', 'blowfish');

var encoded = myCryptor.encode('myExampleString');
// => 'd21c35352099eac53a129a414530c162'

var decoded = myCryptor.decode('d21c35352099eac53a129a414530c162');
// => 'myExampleString'

Ciphers

You can get the list with a static method

var cryptorjs = require('cryptorjs');

cryptorjs.getCiphers();

/*=> [ 'aes-128-cbc',
        'aes-128-cbc-hmac-sha1',
        'aes-128-cbc-hmac-sha256',
        'aes-128-ccm',
        'aes-128-cfb',
        'aes-128-cfb1',
        'aes-128-cfb8',...]
        */

Keywords

FAQs

Last updated on 27 May 2017

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