Generateur de mot de passe

Description

Génère des mots de passe automatiquement à partir de critères à déterminer
(Ce code n'est pas de moi, je l'ai récupéré de Zataz.com)

Source / Exemple :


<HTML>
<HEAD>
	<TITLE>Generateur de mots de passe</TITLE>
			<STYLE TYPE="text/css">
		<!--
		A:link     {text-decoration: none;}
		A:active   {text-decoration: none;}
		A:visited  {text-decoration: none;}
		A:hover    {text-decoration: none; color: #FFFFFF;}

		TD         { font-family: Tahoma, Verdana, Arial, Helvetica; font-size: 8pt;}
		.title     { font-family: Verdana, Tahoma, Arial, Helvetica; font-weight: bold; font-size: 11pt;}
		.header	   { font-family: Tahoma, Verdana, Arial, Helvetica;  font-size : 10pt; font-weight : bold; color : #FFFFFF; }
		.menutitle { font-family: Verdana, Arial, Helvetica;  font-size : 8pt; font-weight : bold; color : #888888; }
		.quote     { font-family: Tahoma, Verdana, Arial, Helvetica; font-size: 8pt; color : #888888; }
		//-->
	 </STYLE>

	 <SCRIPT LANGUAGE="JavaScript">
<!-- Original:  ataxx@visto.com -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function getRandomNum(lbound, ubound) {
return (Math.floor(Math.random() * (ubound - lbound)) + lbound);
}
function getRandomChar(number, lower, upper, other, extra) {
var numberChars = "0123456789";
var lowerChars = "abcdefghijklmnopqrstuvwxyz";
var upperChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var otherChars = "`~!@#$%^&*()-_=+[{]}\\|;:'\",<.>/? ";
var charSet = extra;
if (number == true)
charSet += numberChars;
if (lower == true)
charSet += lowerChars;
if (upper == true)
charSet += upperChars;
if (other == true)
charSet += otherChars;
return charSet.charAt(getRandomNum(0, charSet.length));
}
function getPassword(length, extraChars, firstNumber, firstLower, firstUpper, firstOther,
latterNumber, latterLower, latterUpper, latterOther) {
var rc = "";
if (length > 0)
rc = rc + getRandomChar(firstNumber, firstLower, firstUpper, firstOther, extraChars);
for (var idx = 1; idx < length; ++idx) {
rc = rc + getRandomChar(latterNumber, latterLower, latterUpper, latterOther, extraChars);
}
return rc;
}
// End -->
</script>

</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#FFFFFF" VLINK="#FFFFFF" ALINK="#FFFFFF" MARGINHEIGHT="0" MARGINWIDTH="0" TOPMARGIN=0 BOTTOMMARGIN="0">
<TABLE ALIGN="left" WIDTH="464" CELLSPACING="1" CELLPADDING="1" BORDER="0" BGCOLOR="#000000">
  <TR>
    <TD ROWSPAN="3" VALIGN="top" BGCOLOR="#FFFFFF" WIDTH=460>
      <div align="center"><BR>
        <!-- STEP TWO: Copy this code into the BODY of your HTML document  -->
        Generateur de mot de passe </div>
      <center>
        <table width=97% border=0>
          <tr align=center>
            <td> <form name="myform">
              <table border=0 width="330">
                <tr>
                  <td> Premier caractére</td>
                  <td>
                    <input type=checkbox name=firstNumber checked>
                    Chiffres
<input type=checkbox name=firstLower checked>
                    Minuscules<br>
                    <input type=checkbox name=firstUpper checked>
                    Majuscules
<input type=checkbox name=firstOther>
                    Autres</td>
                </tr>
                <tr>
                  <td> Caractéres suivants</td>
                  <td>
                    <input type=checkbox name=latterNumber checked>
                    Chiffres
<input type=checkbox name=latterLower checked>
                    Minuscules<br>
                    <input type=checkbox name=latterUpper checked>
                    Majuscules
<input type=checkbox name=latterOther>
                    Autres</td>
                </tr>
                <tr>
                  <td> Taille du mot de passe</td>
                  <td>
                    <input type=text name=passwordLength value="7" size=3>
                  </td>
                </tr>
                <tr>
                  <td> Autres caractéres</td>
                  <td>
                    <input type=text name=extraChars size=20>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
          <tr align=center>
            <td> Votre mot de passe
              <input type=text name=password size=20>
              <br>
              <input type=button value="Generateur de mots de passe" onClick="document.myform.password.value =
getPassword(document.myform.passwordLength.value, document.myform.extraChars.value,
document.myform.firstNumber.checked, document.myform.firstLower.checked,
document.myform.firstUpper.checked, document.myform.firstOther.checked,
document.myform.latterNumber.checked, document.myform.latterLower.checked,
document.myform.latterUpper.checked, document.myform.latterOther.checked);">
              </form>
            </td>
          </tr>
        </table>
      </center>
    </TD>
  </TR>
</TABLE>

</BODY>
</HTML>

Codes Sources

A voir également

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.