Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Implementation of Master Password for nodejs and browser
Requirements:
Note: this package uses scrypt
which is built with node-gyp
so you might need to compile C code. Blame node-gyp
.
First, install Node.js, and then open a terminal and run node -v
and npm -v
to make sure Node is installed correctly.
Now we can install the package.
$ npm install --save node-mpw
Once it's installed and in your node_modules
folder, you can now run the script! Here's an example:
import * as mpw from 'node-mpw'
const username = 'username'
const password = 'password'
const site = 'example.com'
const key = mpw.generateKey(username, password)
const generated = mpw.generatePassword(site, key, 1, 'long', 3)
mpw.generateKey(name: string, password: string, version?: string, namespace?: string): Buffer
Calculate the master key from a user's name and master password.
name: string
The desired username.password: string
The desired master password.version?: string
The algorithm version being used for this process.namespace? string
The namespace used as a salt to calculate the key.Returns: a key generated from the scrypt
algorithm.
mpw.generatePassword(site: string, key: Buffer, counter?: number, template?: string, version?: number, namespace?: string): string
Encode a site password using the site's type template.
site: string
The site name. The bare domain name is an ideal choice.key: Buffer
An scrypt
-hashed key generated from the generateKey()
function.counter?: number
An integer that can be incremented when the user needs a new password for the site.template?: string
The password template that the user chooses.version?: number
The algorithm version being used for this process.namespace?: string
The namespace used as a salt to calculate the seed.Returns: the final, generated password.
Issues and Pull Requests are welcome! Please read our Contributing Guidelines & Code of Conduct beforehand.
Our commit logs are Commitizen-friendly. With Commitizen, the header of every commit message has to include a type
, an optional scope
and a subject
with the following format:
<type>(<scope>): <subject>
You can use one of the following methods to use Commitizen.
Option 1: Install Commitizen by running npm install -g commitizen
, and run git cz
instead of git commit
when you want to commit. Follow the instructions on the next screen.
Option 2: When you run npm install
the core commitizen
library is also saved as devDependencies
. You can simply run npm run commit
instead of git commit
to enable Commitizen. Follow the instructions on the next screen.
Option 3: Manually typing the commits altogether. We use the following Commitizen tags.
FAQs
Implementation of Master Password for nodejs and browser
We found that node-mpw 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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.