javascript-strong-password-generator
JavaScript Strong Password Generator: based on Jeff Atwood's Post "Password Rules Are Bullshit".
You can view a working demo at https://www.sethserver.com/strong-random-password-generator.html
Currently uses six unicode blocks, and I don't see why we can't use them all; this just makes the best looking passwords.
Installation
npm i javascript-strong-password-generator
Basic Usage
This is a quick out-of-the-box usage example. This is not how you'd use it in production if you want it to be secure, but it will give you a decent random unicode password.
const jsspg = ; jsspg;const newPassword = jsspg; console;
Command-line Usage
JSSPG includes a simple command-line app that will generate a single random password seeded by your local environment.
$ js-spgƗÇŒk😪Ư2ëjOåęğ⚎Ŭ☦Ƙ🙅ēňxę😣☨😺Ú
Advanced Usage
To reduce predictability add entropy from dynamic sytem state inforation such as CPU usage, number of active processes, availalbe ram and disk io.
const jsspg = ;const si = ;const sha512 = ; let entropyval; { return async { const cpuSpeed = await si; const processes = await si; const disksIO = await si; const memory = await si; entropyval = ; ; };} { return entropyval;} { await ; jsspg; processstdout;} ;
Building for Browsers
This will generate a ./build/jsspg.min.js file for use in a web browser.
$ npm run webpack
Basic Browser Usage
<script src="js/jsspg.min.js"></script><script> { jsspg; var newPassword = jsspg ;};</script>
Core Concept
Just read "Password Rules Are Bullshit".
API
jsspg.init(options)
Options [{ k: v }]
- entropyFxn [function fxn()]: Custom entropy function. Must return an Array or string of length fortuna.entropySz (128 by default)
- timeBasedEntropy [bool]: Detaches the reseeding of the algorithm from the call to random().
- accumulateTimeout [int]: The amount of time in milliseconds between each timeBasedEntropy call. Requires timeBasedEntropy to be true.
jsspg.generate(passwordLength)
Generates a random Unicode password of length passwordLength
(length is Unicode characters, not bytes).