Last active
August 13, 2016 17:10
-
-
Save RedHatter/b432f746cb53cc3f7f91 to your computer and use it in GitHub Desktop.
Greasemonkey script that generates and auto fills passwords using the website's domain as the seed. http://idioticdev.com/sprouted-passwords.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Sprouted Passwords | |
// @namespace http://idioticdev.com | |
// @description Generate and autofill passwords using that website's domain as the seed. | |
// @include * | |
// @version 1.3 | |
// @require http://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.min.js | |
// @require http://cdnjs.cloudflare.com/ajax/libs/seedrandom/2.4.2/seedrandom.min.js | |
// @grant GM_registerMenuCommand | |
// ==/UserScript== | |
const length = 26 | |
const salt = 'Your Salt' | |
const hostname = window.location.hostname.replace('www.', '') | |
function sprout (seed = hostname) { | |
let salted = seed + salt | |
let rand = new Math.seedrandom(salted) | |
let value = '' | |
for (let i = 0; i < length; i++) { | |
value += String.fromCharCode(rand() * 94 + 33) | |
} | |
return value | |
} | |
$("input[type='password']").val(sprout()) | |
GM_registerMenuCommand("Show password", () => prompt(hostname, sprout())) | |
GM_registerMenuCommand("From seed ...", () => { | |
let seed = prompt("What seed?", hostname) | |
prompt (seed, sprout(seed)) | |
}) | |
GM_registerMenuCommand("Fill from seed ...", () => { | |
let seed = prompt("What seed?", hostname) | |
$("input[type='password']").val(sprout(seed)) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I like the salt