
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
sha512crypt-node
Advanced tools
This implements the sha512crypt algorithm as described in http://www.akkadia.org/drepper/SHA-crypt.txt in pure javascript.
Its available in npm via:
$ npm install sha512crypt-node
A example how to use it in a html page is provided in doc/demo.html:
var hash = sha512crypt(document.forms["pwform"]["password"].value,
document.forms["pwform"]["salt"].value);
Basic commandline usage:
$ ./demo.js pass salt
$6$salt$3aEJgflnzWuw1O3tr0IYSmhUY0cZ7iBQeBP392T7RXjLP3TKKu3ddIapQaCpbD4p9ioeGaVIjOHaym7HvCuUm0
$ python -c 'import crypt; crypt.crypt("pass", "$6$salt")
$6$salt$3aEJgflnzWuw1O3tr0IYSmhUY0cZ7iBQeBP392T7RXjLP3TKKu3ddIapQaCpbD4p9ioeGaVIjOHaym7HvCuUm0
Using the "rounds" parameter as part of the salt:
$ ./demo.js pass '$6$rounds=1000$salt'
$6$rounds=1000$salt$NqhXojlgP5NLvJojBnjQD87i66jhb8s3bZord3hSZoIgbCJqUfJdp7pclsLBBqgn02fAtd/vn4lieLeX5J.h90
$ python -c 'import crypt; print crypt.crypt("pass", "$6$rounds=1000$salt")'
$6$rounds=1000$salt$NqhXojlgP5NLvJojBnjQD87i66jhb8s3bZord3hSZoIgbCJqUfJdp7pclsLBBqgn02fAtd/vn4lieLeX5J.h90
Tests are done via mocha, see REQUIREMENTS for details.
$ npm install mocha
...
$ npm test
> sha512crypt-node@1.0.0 test
> ./node_modules/mocha/bin/mocha -u tdd
sha512crypt
✔ sha512crypt_intermediate short
✔ sha512crypt_intermediate long
✔ rstr_sha512crypt (153ms)
✔ b64_sha512crypt (65ms)
✔ b64_sha512crypt with $6$ (70ms)
✔ b64_sha512crypt long (137ms)
✔ b64_sha512crypt long salt (106ms)
✔ wrong salt constant
✔ vectors from the drepper paper (3959ms)
9 passing (5s)
FAQs
Provide sha512crypt algorithm for nodejs
The npm package sha512crypt-node receives a total of 6,918 weekly downloads. As such, sha512crypt-node popularity was classified as popular.
We found that sha512crypt-node demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.