addin web tooks

This commit is contained in:
2026-07-13 01:17:54 -06:00
parent b7ee3498da
commit 8b28c70d15
3 changed files with 503 additions and 0 deletions
+100
View File
@@ -0,0 +1,100 @@
<html>
<head>
<title>Passgen</title>
<script>
var alphau = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var alphal = "abcdefghijklmnopqrstuvwxyz";
var numbers = "0123456789";
var symbols = "`~!@#$%^&*()-=_+[]\{}|;':\",./<>?";
var space = " ";
var baseYear = 120000000000000000000000;
function $id(id) {
return document.getElementById(id);
}
function secureRand(min,max,len) {
var str = "";
var rand = [];
var pos = 0;
while(rand.length<len) {
var buf = new Uint8Array(512);
window.crypto.getRandomValues(buf);
for(i=0;i<buf.length;i++) {
if(buf[i] >= min && buf[i] <= max) {
rand[pos] = buf[i];
pos++;
}
}
}
return rand.slice(0,len);
}
function generatepass(len,keys){
rlist='';
var srand = secureRand(0,keys.length,len);
for (i=0;i<len;i++) {
rlist+=keys.charAt(srand[i]);
}
return rlist;
}
function entropy(chars,len) {
return Math.round((Math.log(Math.pow(chars,len))/Math.log(2))*100)/100;
}
// chars = length of charset
//len = length of password
//base = total md5 tries per year
// TODO: Assumes power doubles every 18 months (Moore's law)
function yearsToCrack(chars,len,base) {
possible = Math.pow(chars,len);
return Math.round(possible/baseYear);
}
function generate() {
var len = $id('length').value;
var keylist = "";
if($id('alphal').checked) { keylist += alphal; }
if($id('alphau').checked) { keylist += alphau; }
if($id('symbols').checked) { keylist += symbols; }
if($id('numbers').checked) { keylist += numbers; }
if($id('space').checked) { keylist += space; }
$id('out').innerHTML = generatepass(len,keylist);
$id('entropy').innerHTML = entropy(keylist.length,len);
$id('years').innerHTML = yearsToCrack(keylist.length,len,baseYear);
}
window.onload = function(){generate();}
</script>
<style>
* { font-family: verdana; }
h1 { margin-bottom: 5px; }
a:link { color: black; }
a:hover { text-decoration:none; }
</style>
</head>
<body>
<h1>Passgen<sup><a href="javascript:alert('Passgen 0.2.8\nCryptographically secure password generator\n\nHere is how passgen protects you:\n* Uses a cryptographically secure random number generator to\ngenerate a properly random secure password\n* Nothing is ever sent to anyone! It all runs through your browser\n* Even visiting a website and loading pages from it is not needed\npassgen can run through a bookmarklet without even being online\n* Nothing is ever, ever stored or logged\n* The web page you got this from keeps no logs including IP logs or even a hit counter\n* The website you got this from is secured with TLS to ensure this bookmarklet was not tampered with in transit\n* This bookmarklet code is singed with PGP to guarantee it has not been tampered with by a hacker\n\nPrincess Pi - https://git.thecoven.info/PrincessPi');">?</a></sup></h1>
<input type="checkbox" id="alphal" onchange="generate()" checked> <label for="alphal">Lowercase Letters</label><br>
<input type="checkbox" id="alphau" onchange="generate()" checked> <label for="alphau">Uppercase Letters</label><br>
<input type="checkbox" id="numbers" onchange="generate()" checked> <label for="numbers">Numbers</label><br>
<input type="checkbox" id="symbols" onchange="generate()" checked> <label for="symbols">Symbols</label><br>
<input type="checkbox" id="space" onchange="generate()" checked> <label for="space">Space</label><br>
<label for="length">Length</label> <input type="text" id="length" size="4" value="23" onchange="generate()"><br>
<input type="button" value="Generate" onclick="generate()"> <input type="button" value="Close" onclick="window.close()">
<p><b>Password</b> <span id="out"></span></p>
<p><b>Strength<sup><a href="javascript:alert('Bits of entropy.\nlog2(characters^length)');">?</a></sup></b> <span id="entropy"></span> bits</p>
<p><b>Years to Crack<sup><a href="javascript:alert('Assumes all computing power on Earth being used collaboratively, doubling in power every 18 months.\nAlso assumes a weak, cryptologically broken hash, MD5. (EXCLUDES colissions in MD5)')">?</a></sup></b> <span id="years"></span></p>
</body>
</html>