Gathering detailed insights and metrics for micro-password-generator
Gathering detailed insights and metrics for micro-password-generator
Gathering detailed insights and metrics for micro-password-generator
Gathering detailed insights and metrics for micro-password-generator
Utilities for password generation and estimation with support for iOS keychain
npm install micro-password-generator
Typescript
Module System
Node Version
NPM Version
72.8
Supply Chain
98.9
Quality
74.9
Maintenance
100
Vulnerability
100
License
TypeScript (62.79%)
JavaScript (37.21%)
Total Downloads
641
Last Day
1
Last Week
3
Last Month
20
Last Year
329
18 Stars
21 Commits
1 Forks
4 Watching
1 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
0.2.0
Package Id
micro-password-generator@0.2.0
Unpacked Size
32.79 kB
Size
9.38 kB
File Count
7
NPM Version
8.14.0
Node Version
18.6.0
Cumulative downloads
Total Downloads
Last day
-50%
1
Compared to previous day
Last week
-62.5%
3
Compared to previous week
Last month
900%
20
Compared to previous month
Last year
232.3%
329
Compared to previous year
3
Utilities for password generation with support for iOS keychain.
1import * as pwd from 'micro-password-generator'; 2import { scrypt } from '@noble/hashes/scrypt'; 3// Use cryptographically secure RNG. Do not use Math.random(), it's not secure 4import { randomBytes } from '@noble/hashes/utils'; 5 6(async () => { 7 const seed = scrypt('main-password', 'user@gmail.com', { N: 2**18, r: 8, p: 1 }); 8 9 // Deterministic password 10 console.log(pwd.secureMask.apply(seed).password); 11 // Secure random password 12 console.log(pwd.secureMask.apply(randomBytes(32)).password); 13 // wivfi1-Zykrap-fohcij, will change on each run 14 15 // Or using mask, if there is specific requirements 16 console.log(pwd.mask('@1Av').apply(seed).password); 17 // "9Sy 18 19 // Mask statistic (napkin math attack cost estimation) 20 console.log(pwd.mask('Cvcvcvc').estimate()); 21 /* 22 { 23 score: 'somewhat guessable', // ZXCVBN Score 24 // Guess times 25 guesses: { 26 online_throttling: '1y 115mo', // Throttled online attack 27 online: '1mo 10d', // Online attack 28 // Offline attack (salte, slow hash function like bcrypt, scrypt, PBKDF2, argon, etc) 29 slow: '57min 36sec', 30 fast: '0 sec' // Offline attack 31 }, 32 // Estimated attack costs (in $) 33 costs: { 34 luks: 1.536122841572242, // LUKS (Linux FDE) 35 filevault2: 0.2308740987992559, // FileVault 2 (macOS FDE) 36 macos: 0.03341598798410283, // MaccOS v10.8+ passwords 37 pbkdf2: 0.011138662661367609 // PBKDF2 (PBKDF2-HMAC-SHA256) 38 } 39 } 40 */ 41})();
Mask | Description | Example |
---|---|---|
1 | digits | 4, 7, 5, 0 |
@ | symbols | !, @, %, ^ |
v | vowels | a, e, i |
c | consonant | b, c, d |
a | letter (vowel or consonant) | a, b, e, c |
V | uppercase vowel | A, E, I |
C | uppercase consonant | B, C, D |
A | uppercase letter | A, B, E, C |
l | lower and upper case letters | A, b, C |
n | same as 'l', but also digits | A, 1, b, 2, C |
* | same as 'n', but also symbols | A, 1, !, b, @ |
s | syllable (same as 'cv') | ca, re, do |
S | Capitalized syllable (same as 'Cv) | Ca, Ti, Je |
All other characters used as is |
Examples:
Cvccvc-cvccvc-cvccv1
will generate Mavmuq-xadgys-poqsa5
@Ss-ss-ss
will generate: *Tavy-qyjy-vemo
********
, since it can generate passwords which won't satisfy these rules.******
mask, we need to calculate entropy for specific mask (which is smaller).MIT (c) Paul Miller (https://paulmillr.com), see LICENSE file.
No vulnerabilities found.
No security vulnerabilities found.