
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
netcore-passwords
Advanced tools
This library provides Node.js compatibility with .NET Core Identity framework. If you're migrating a .NET Core application to Node.js, or if you need to share the same users database, this library is here to help.
This library is compatible with both Version 2 and Version 3 hashes.
PBKDF2 with HMAC-SHA1, 128-bit salt, 256-bit subkey, 1000 iterations.
Format: { 0x00, salt, subkey }
PBKDF2 with HMAC-SHA256, 128-bit salt, 256-bit subkey, 10000 iterations.
Format: { 0x01, prf (UInt32), iter count (UInt32), salt length (UInt32), salt, subkey }
(All UInt32s are stored big-endian.)
npm install netcore-passwords
/*
* Callback-style
*/
passwords.hash("qwerty", (err, hash) => {
console.log(hash);
})
/*
* Promise
*/
passwords.hash("qwerty").then((hash) => {
console.log(hash);
})
/*
* Async / Await
*/
console.log(await passwords.hash("qwerty"));
/*
* Callback-style
*/
passwords.hash("qwerty", { version: 2 }, (err, hash) => {
console.log(hash);
})
/*
* Promise
*/
passwords.hash("qwerty", { version: 2 }).then((hash) => {
console.log(hash);
})
/*
* Async / Await
*/
console.log(await passwords.hash("qwerty", { version: 2 }));
/*
* Callback-style
*/
passwords.verify("qwerty", "AQAAAAEAACcQAAAAEFsyb88d2/nTrV2QJ3CG6y8ac3QwYBdnb6SR3LT/rG/SZemrHAoh/MrQmxFrqMey5A==",
(err, valid) => { console.log(valid); });
/*
* Promise
*/
passwords.verify("qwerty", "AQAAAAEAACcQAAAAEFsyb88d2/nTrV2QJ3CG6y8ac3QwYBdnb6SR3LT/rG/SZemrHAoh/MrQmxFrqMey5A==")
.then((valid) => { console.log(valid); });
/*
* Async / Await
*/
console.log(await passwords.verify("qwerty", "AQAAAAEAACcQAAAAEFsyb88d2/nTrV2QJ3CG6y8ac3QwYBdnb6SR3LT/rG/SZemrHAoh/MrQmxFrqMey5A=="));
NOTE: you don't need to specify the version when verifying a password. The version is stored in the first byte of the hash, so the library auto-detects it and use the appropriate verification algorithm
npm test
MIT
[2.0.0] - 2018-06-02
async/await
FAQs
.NET Core compatible password hashing and verification
The npm package netcore-passwords receives a total of 1 weekly downloads. As such, netcore-passwords popularity was classified as not popular.
We found that netcore-passwords 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
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.