
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
TODO: add test passing badge like this ->
Bcrypt is a password hashing function designed by Niels Provos and David Mazières, based on the Blowfish cipher
It is ideal for convert password into hash when saving in database, Besides incorporating a salt to protect against Rainbow table attacks, bcrypt is an adaptive function: over time, the iteration count can be increased to make it slower, so it remains resistant to brute-force search attacks even with increasing computation power.
This library makes it easier to use Bcrypt in NodeJS
npm i cryptokey
import { stringToHash, verifyHash, validateHash } from "cryptokey";
const hash = await stringToHash("pakistan", 10);
console.log("hash: ", hash);
const result = await verifyHash(
"pakistan",
"$2a$10$W3/bbpG0rexRwKBabxbp7efehubSnxDLM7OCEj0MEPAac98EUa9mW"
);
if (result) {
console.log("hash matched");
} else {
console.log("hash not matched");
}
var bcrypt = require("cryptokey");
bcrypt.stringToHash("pakistan").then((string) => {
console.log("hash: ", string);
});
bcrypt
.varifyHash(
"pakistan",
"$2a$10$W3/bbpG0rexRwKBabxbp7efehubSnxDLM7OCEj0MEPAac98EUa9mW"
)
.then((result) => {
if (result) {
console.log("matched");
} else {
console.log("not matched");
}
})
.catch((e) => {
console.log("error: ", e);
});
bcrypt
.validateHash("$2a$10$W3/bbpG0rexRwKBabxbp7efehubSnxDLM7OCEj0MEPAac98EUa9mW")
.then((result) => {
if (result) {
console.log("hash is valid");
} else {
console.log("hash is invalid");
}
});
| Author | M.Inzamam Malik, malikasinger@gmail.com |
| Contributor | Shehzad Iqbal |
FAQs
this is simple lib for string to hash and compare string and hash
The npm package cryptokey receives a total of 6 weekly downloads. As such, cryptokey popularity was classified as not popular.
We found that cryptokey 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.