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

hmac-cli

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hmac-cli

Command line utilities to generate or verify HMAC

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

HMAC-CLI

Simple Node.js HMAC Command Line Utility

Quickly create and verify hashed message authentication codes

Generate HMAC

$ export HMAC_SECRET=MY_SECRET_KEY
$ npx hmac-cli generate 'Message to Hash'

36a2f1cb3e77384f5d98dac34e501d9367570408d2b5fb7519808c34443dc3a6

Verify HMAC

$ node verify 'Message to Hash' -e 36a2f1cb3e77384f5d98dac34e501d9367570408d2b5fb7519808c34443dc3a6

Success: Given HMAC string matches the generated!

Installation (optional)

$ npm i -g hmac-cli

then use the global hmac command:

hmac generate 'Message to Hash' -s MY_SECRET_KEY

More example usages

Get help:

$ npx hmac-cli --help

Usage: hmac [options] [command]

Options:
  -h, --help                    display help for command

Commands:
  generate [options] <content>
  verify [options] <content>
  help [command]                display help for command

or help for specific command:

$ npx hmac-cli help generate

Usage: hmac generate [options] <content>

Options:
  -h, --hash <name>         Name of the hash function (default: "sha256")
  -d, --digest <alhorithm>  Digest algorithm (default: "hex")
  -s, --secret <secret>     HMAC secret string
  --help                    display help for command

Example usage with options:

$ npx hmac-cli generate 'Message to Hash' -h sha512 -d base64 -s YOUR_SECRET
  • Hash can be any hashing algorithm on your current system see crypto docs
  • Encoding can be any valid string encoding

LICENSE

MIT

Keywords

FAQs

Package last updated on 07 Oct 2020

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