Random Text/Number Generator - Passord List

Creating a password list generator that will output 100 unique passwor

Page 1 of 1

2 Replies - 2809 Views - Last Post: 19 August 2008 - 05:00 PM

#1 westaustin  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 19-August 08

Random Text/Number Generator - Passord List

Post icon  Posted 19 August 2008 - 05:44 AM

All,

I'm a noob, and have had a Java programming class a while back, but just can't get this, even though it should be an easy fix. I'm trying to set up a password generator that will spit out a list of passwords for me. The only choice I want is whether or not it will be 8 or 15 characters, and the passwords have to have certain characteristics (ex: 2 each of upper case, lower case, number and special characters). I wanted to run it in a simple html page, I am just having a problem with getting the "generate password" button to create multiple passwords to populate a list, and with getting a random password while specifying the minimum characteristics of 2 of each type.....

I've played with numerous different snippets, but this one seems to have the most potential if I could figure out where to go next. I think having several different keylists for the types would work, but how do I make that random (not a capital letter in the 1st position every time...)?

<html>
<head>
<script>
var keylist="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789!@#$%^&*()"
var temp=''

function generatepass(plength)
{
temp=''
for (i=0;i<plength;i++)
temp+=keylist.charAt(Math.floor(Math.random()*keylist.length))
return temp
}

function populateform(enterlength)
{
document.pgenerate.output.value=generatepass(enterlength)
}
</script>
</head>
<body>
<form name="pgenerate">
<b>Password Length:</b> 
<input type="text" name="thelength" size=3 value="7"><br/>
<input type="text" size=25 name="output">
<input type="button" value="Generate Password" 
onclick="populateform(this.form.thelength.value)">
</form>
</body>
</html>



Is This A Good Question/Topic? 0
  • +

Replies To: Random Text/Number Generator - Passord List

#2 lordms12  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 30
  • View blog
  • Posts: 339
  • Joined: 16-February 08

Re: Random Text/Number Generator - Passord List

Posted 19 August 2008 - 07:47 AM

Can someone move this to javascript forum.
Was This Post Helpful? 0
  • +
  • -

#3 BetaWar  Icon User is offline

  • #include "soul.h"
  • member icon

Reputation: 1147
  • View blog
  • Posts: 7,134
  • Joined: 07-September 06

Re: Random Text/Number Generator - Passord List

Posted 19 August 2008 - 05:00 PM

I would suggest splitting the keylist into 4 lists (one of lower, upper numeric and special), then as you go through your loop you make sure that you ave the characters done (use some random thing and then have a counter for each of them that checks to make sure you haven't exceeded your limit of characters in the password and makes sure you get all the required characters at least once (or whatever) in the password.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1