Giter Site home page Giter Site logo

enc-js's Introduction

enc-js

Simple js util to process stuff in an openSSL enc-compatible way

Usage

Usage: enc-js <command> [options]

Commands:
  enc-js serve    Serve the crypt server                       [aliases: s, srv]
  enc-js encrypt  Encrypt data                                 [aliases: e, enc]
  enc-js decrypt  Decrypt data                                 [aliases: d, dec]

Options:
  --version  Show version number                                       [boolean]
  --help     Show help                                                 [boolean]

Encrypt

enc-js encrypt

Encrypt data

Options:
      --version     Show version number                                [boolean]
      --help        Show help                                          [boolean]
  -d, --data        Data to encrypt/decrypt                  [string] [required]
  -p, --passphrase  Passphrase to use                        [string] [required]
  -a, --algo        Algorithm to use           [string] [default: "aes-256-cbc"]
  -h, --hashFunc    Hash function to use            [string] [default: "sha256"]
  -i, --iters       Number of iterations                  [number] [default: 90]

This command should be equivalent to echo -n "<data>" | openssl enc -e <algo> -a -salt --iter <iters> -h <hashFunc> -k <passphrase>

Decrypt

enc-js decrypt

Decrypt data

Options:
      --version     Show version number                                [boolean]
      --help        Show help                                          [boolean]
  -d, --data        Data to encrypt/decrypt                  [string] [required]
  -p, --passphrase  Passphrase to use                        [string] [required]
  -a, --algo        Algorithm to use           [string] [default: "aes-256-cbc"]
  -h, --hashFunc    Hash function to use            [string] [default: "sha256"]
  -i, --iters       Number of iterations                  [number] [default: 90]

This command should be equivalent to echo "<data>" | openssl enc -d <algo> -a --iter <iters> -h <hashFunc> -k <passphrase>

Serve

enc-js serve

Serve the crypt server

Options:
      --version   Show version number                                  [boolean]
      --help      Show help                                            [boolean]
  -b, --bind      Bind address              [string] [default: "localhost:8080"]
  -a, --algo      Algorithm to use             [string] [default: "aes-256-cbc"]
  -h, --hashFunc  Hash function to use              [string] [default: "sha256"]
  -i, --iters     Number of iterations                    [number] [default: 90]

POST /encrypt

Send a form-urlencoded request with data & passphrase.

Returns the base64 encoded plain-text.

POST /decrypt

Send a form-urlencoded request with data & passphrase.

Returns a utf-8 plain-text containing the original text.

Build

To obtain native distros of this tool you can run the following:

npm run build 

enc-js's People

Contributors

qcfe avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.