npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

argon2-cli

v0.25.1

Published

A CLI tool for argon2 hashing

Downloads

8,560

Readme

node-argon2-cli NPM package Build status Coverage status Code Quality Dependencies

CLI utility for node-argon2.

Want to use it in your Javascript application? Instead check node-argon2.

Before installing

Check requirements for node-argon2 prior to installing this.

node-argon2-cli works only and is tested against Node >=8.0.0.

Usage

Run argon2-cli -h for a quick help on usage and arguments:

$ argon2-cli -h
usage: argon2-cli [-h] salt [-i|-d|-id] [-t iterations] [-m log2(memory in KiB) | -k memory in KiB] [-p parallelism] [-l hash length] [-e|-r] [-v (10|13)]
  Password is read from stdin

Positional arguments:
  salt

Optional arguments:
  -h, --help  Show this help message and exit.
  -i          Use Argon2i (this is the default)
  -d          Use Argon2d instead of Argon2i
  -id         Use Argon2id instead of Argon2i
  -t N        Sets the number of iterations to N (default 3)
  -m N        Sets the memory usage to 2^N KiB (default 12)
  -k N        Sets the memory usage to N KiB (default 4096)
  -p N        Sets parallelism to N threads (default 1)
  -l N        Sets hash output length to N bytes (default 32)
  -e          Output only encoded hash
  -r          Output only the raw bytes of the hash
  -v (10|13)  Argon2 version (defaults to the most recent version, currently 13)

To hash a password:

$ echo -n "password" | argon2-cli
Type: 		Argon2i
Iterations: 	3
Memory: 	4096 KiB
Parallelism: 	1
Encoded: 	$argon2i$v=19$m=4096,t=3,p=1$lwEEWp+MVB8ha79mVt8Gog$KXc3+y9Lg4YBm0C1nxk7t6j3ku4pw/uyd4RfVq3e8yI
0.010 seconds
Verification ok

By default, the output is verbose. You can output the hash only with -e:

$ echo -n "password" | argon2-cli -e
$argon2i$v=19$m=4096,t=3,p=1$wST5QhBgk2lu1ih4DMuxvg$LS1alrVdIWtvZHwnzCM1DUGg+5DTO3Dt1d5v9XtLws4

You can choose between Argon2i and Argon2d by using the -d flag:

$ echo -n "password" | argon2-cli -d -e
$argon2d$v=19$m=4096,t=3,p=1$diS6FEpcDzlFacSfAHyWSw$+JLnSo3YQP/CJ7g2cRSx6YjC1eRmxHPETmd99R6eaa8

You can provide your own salt as the positional argument. It is highly recommended to use the generated salt instead of a hardcoded salt, though:

$ echo -n "password" | argon2-cli somesalt -e
$argon2i$v=19$m=4096,t=3,p=1$c29tZXNhbHQ$iWh06vD8Fy27wf9npn6FXWiCX4K6pW6Ue1Bnzz07Z8A

You can also modify time, memory and parallelism constraints with -t, -m and -p respectively, followed by a valid number:

$ echo -n "password" | argon2-cli -t 2 -k 65536 -p 4
Type: 		Argon2i
Iterations: 	2
Memory: 	65536 KiB
Parallelism: 	4
Encoded: 	$argon2i$v=19$m=65536,t=2,p=4$1LoWDI7KvUoSIUlA+26nHw$KK1P9iYjYn8+FE1ACGWFNhC3UfJsc1LYS7ciMcxS7EA
0.058 seconds
Verification ok

All arguments are optional, and it's not possible to pass your password as argument for safety purposes (consider you should never write a password with echo).

License

Work licensed under the MIT License. Please check [P-H-C/phc-winner-argon2] (https://github.com/P-H-C/phc-winner-argon2) for license over Argon2 and the reference implementation.