|
|
|
<html>
<head>
<title>JSPassGen v2.1</b></title>
<script language="javascript">
<!-- //hide
// JSPassGen v2.1
// Javascript password generator
// by Ummon <jeffhawke@iname.com>
// heavily based on Jpass v1.1 (Kelv 2000 kelv@kelv.net)
// http://freshmeat.net/projects/jpass/
/*
complete simply working javascript password generator file. Use letter,
vowels, consonants
(uppercase and lowercase) arrays to create a really random and secure password.
improved security using time functions to initialize random number generator.
can be embedded in html and can be used in HTML event handler like onclick
and onmouseover.
tested in Explorer, Netscape and Mozilla enviroment.
This little script uses some arrays of consonants, vowels and digits to
create a really random
password
As javascript doesn't have a reliable random function, it use more layers of
randomizers than
normally required for such a script.
*/
function choice(arg)
//return random index number in valid range of arg array
{
return Math.floor(Math.random()*arg.length);
}
function randstr(arg)
//return random argument of arg array
{
var str = '';
var seed = choice(arg);
str = arg[seed];
return str;
}
function initialize()
//use actual time to initialize random function as javascript doesn't provide an
initialization function itself
//to get more random, use getMilliseconds() function
//don't use getTime() as it produces numbers larger than 1000 billions, eheh
{
var count=new Date().getSeconds();
for (c=0; c<count; c++)
Math.random();
}
function mkpass()
{
//use of initialize() can decrease speed of script. On really slow systems,
disable it.
initialize();
//password length
var pass_len=10;
var cons_lo =
['b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','y','z']
;
var cons_up =
['B','C','D','F','G','H','J','K','L','M','N','P','Q','R','S','T','V','W','X','Y','Z']
;
var hard_cons_lo = ['b','c','d','f','g','h','k','m','p','s','t','v','z'];
var hard_cons_up = ['B','C','D','F','G','H','K','M','P','S','T','V','Z'];
var link_cons_lo = ['h','l','r'];
var link_cons_up = ['H','L','R'];
var vowels_lo = ['a','e','i','o','u'];
var vowels_up = ['A','E','I','U']; //O (letter o) and 0 (number zero) get
confused
var digits = ['1','2','3','4','5','6','7','8','9'];
//change at will how many times digits appears in names array. Order doesn't
matter
var names = [cons_lo, cons_up, digits, hard_cons_lo, hard_cons_up, digits,
link_cons_lo,
link_cons_up, digits, vowels_lo, vowels_up, digits];
var newpass= '';
for(i=0; i<pass_len; i++)
newpass = newpass + randstr(names[choice(names)]);
return newpass;
}
// -->
</script>
</head>
<body bgcolor=#ffffff>
<center>
<b>JSPassGen v2.1</b><br>
(c) 2002 <a href="mailto:jeffhawke@iname.com">Ummon</a>
<br><br>
Onclick event on button:<br>
<form name="pswd">
<input type="text" name="pass" size="15">
<input type="button" value="Generate" onclick="document.pswd.pass.value=mkpass()">
</form>
Onclick event on link:<br>
<form name="pswd2">
<input type="text" name="pass" size="15">
<a href="javascript:void(0)" onclick="document.pswd2.pass.value=mkpass
()">Generate</a>
</form>
</center>
</body>
</html> |
|
| Prevent Right Mouse steal your graphics Categories : HTML, Java Script, Security | | | MD5 secured login Categories : PHP, Java Script, Authentication, Security | | | Password using php, Javascript, and html form Categories : Security, PHP, Authentication, Java Script | | | Random Password Generator Categories : PHP, Strings, Security | | | How to create <SELECT> menues that change on the fly according to other <SELECT> menues on the page? Categories : Java Script, HTML | | | Javascript linked dropdowns Categories : Java Script, HTML, Classes and Objects | | | Javascript animated menu items Categories : DHTML, CSS, Java Script, HTML | | | Authenticator for Exchange Server LDAP Categories : PHP, Authentication, LDAP, Security, Sessions | | | phpSecurePages is a PHP module to secures pages with a loginname and
password. It handles multiple user groups (each has own viewing rights),
store data in a MySQL database or a configuration file, and can be used to
identify Web site viewers. Categories : PHP, Security, Authentication | | | Bouncing Marquee at Status Bar Categories : Java Script, HTML, Browsers | | | A damaged image generator (class) for validating text.
CAPTCHA - Completely Automated Public Turing test to tell Computers and Humans Apart Categories : PHP, PHP Classes, Security, GD image library, Security | | | Use of bitmasks to represent permissions Categories : PHP, Authentication, Bitwise Operators, Security, PHP Classes | | | Check if Javascript is Enabled or Disabled - Works in all Browsers Categories : Java Script, HTML, Web Browsers | | | Page Loading Message shown during the time your site's page is being loaded. Categories : HTML, CSS, Java Script | | | Javascript Background Scroller Categories : Java Script, CSS, HTML | |
|
|