Latest Threat Research:Malicious dYdX Packages Published to npm and PyPI After Maintainer Compromise.Details
Socket
Book a DemoInstallSign in
Socket

endecrypt

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

endecrypt

Password based en-/decryption of arbitrary data with and for node.js.

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
3
-50%
Maintainers
1
Weekly downloads
 
Created
Source

endecrypt

Password based en-/decryption of arbitrary data with and for node.js.

Features

  • Utilizes PBKDF2 and AES256 through node's crypto module and is therefore pretty fast
  • Encrypted outputs are indistinguishable from random data
  • Works with arbitrary buffer contents
  • Provides simple streaming and one-shot APIs
  • Includes handy encrypt and decrypt command line utilities

API

The API is quite simple:

var endecrypt = require("endecrypt");

One-shot usage for small data:

  • endecrypt.encrypt(buf:Buffer, passphrase:string[, options:Object], callback:function(err:Error, data:Buffer))

    Encrypts the specified buffer with the given passphrase and returns the result

  • endecrypt.decrypt(buf:Buffer, passphrase:string[, options:Object], callback:function(err:Error, data:Buffer))

    Decrypts the specified buffer with the given passphrase and returns the result

  • endecrypt.createEncrypt(passphrase:string[, options:Object]):endecrypt.Encrypt

    Creates a ready-to-pipe encrypting (transforming) stream.

  • endecrypt.createDecrypt(passphrase:string[, options:Object]):endecrypt.Decrypt

    Creates a ready-to-pipe decrypting (transforming) stream.

Available options:

  • rounds
    Number of PBKDF2 (HMAC-SHA1) rounds to perform, defaults to 100000.

Command line

Pretty much the same as available through the API, but with the exception that the application will ask for the passphrase if it is not specified as an argument. The number of PBKDF2 rounds defaults to 100000.

  • encrypt <infile> [-r=ROUNDS] [-p=PASSPHRASE] [> <outfile>]
  • decrypt <infile> [-r=ROUNDS] [-p=PASSPHRASE] [> <outfile>]

That's pretty much it.

Examples

The file README.md.crypt has been generated through encrypt README.md -p=123 > README.md.crypt and can be decrypted using decrypt README.md.crypt -p=123.

Considerations

endecrypt uses node's stock PBKDF2 implementation which uses HMAC-SHA1 to derive keys. Thus, the effective entropy is 160 bits aligned to 256 bits of AES which may change with future versions (i.e. when the guys at node.js implement SHA256).

License: Apache License, Version 2.0

FAQs

Package last updated on 27 Sep 2013

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