|
|
|
<script language="php">
function passgen($len)
{
$pass = "";
if($len > 5 && $len < 17)
{
srand((double) microtime() * 1000000);
for($i=0;$i<12;$i++)
{
$pass .= chr(rand(0,255));
}
$pass = substr(base64_encode($pass), 0, $len);
}
return $pass;
}
</script>
<!--
Function passgen (above) creates a random password suitable for any use. The
generated passwords are pure junk - using mixed alpha, numeric and a few symbols.
Usage:
passgen(int password_length);
Password length can be anything from 6 to 16 characters. Other length values
result in an empty string being returned.
Method:
Quite simple. A string of 12 random 8 bit characters is built up in a loop. The
resulting random 12 bytes of data are then UU-Encoded which provides a 16
character string of mixed case, numerics and a few symbols. This is then
shortened to the length requested in the parameter passed to passgen to return
a random password of the requires length.
Example usage below (you can just chuck this on a server to see what it does).
Strip out the function above to use it in your own code.
-->
<html>
<head>
<title>Password Generator</title>
</head>
<body bgcolor="#FFFFFF">
<p>
<font face="Arial" size="4">
Password generator example
</font>
</p>
<pre>
<script language="php">
for($i=0;$i<8;$i++)
{
echo passgen(8)."<br>";
}
</script>
</pre>
</body>
</html>
|
|
| 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 | | | Distribute PHP Software Protected by a License Key. Categories : PHP, Cryptography, Security, Software | | | Simple Password example Categories : PHP, Authentication, Security, HTTP | | | Easily Grant Temporary SSH Access to yourself when in remote location Categories : PHP, Linux, Cron, Security | | | Query2Report : Generating Html, Pdf and Csv Reports from SQL Query Categories : PHP, PHP, HTML, PDF, Excel | | | SHA: Implementation of the Secure Hash Algorithm in pure PHP. This is a secure one-way function that can be used to perform challenge
response login algorithms over an insecure connection. Categories : Algorithms, PHP, Security | | | Scan Apache access log files and report possible worms attack Categories : PHP, PHP Classes, Security, Apache, Log Files | | | Scramble Eggs - php class to scramble/encode Categories : PHP, PHP Classes, Security, Encryption | | | MD5 secured login Categories : PHP, Java Script, Authentication, Security | | | A captcha image allows you to prevent spam posting when users reload the page and stop bots from submitting forms automatically. This version allows you to use your own fonts (.ttf) to show the text.
Categories : PHP, Security, Graphics, GD image library | | | A simple PHP login script that you can modify to suite your needs. It use a session to store data in a session file submited by the page. Categories : PHP, Sessions, Security, Authentication | | | session out Timer Categories : PHP, Sessions, Security, Beginner Guides | | | Human readable PHP password generator Categories : PHP, Security, Beginner Guides, Arrays | | | A few functions to create random passwords. Categories : PHP, Security, Strings | | | Forms protected from XSS attacks (FOPAXSS) Categories : PHP, PHP Classes, Form Processing, Security | |
| | | | Zaid Crowe wrote :1258
ive been scouring the net for a good simple alphnumeric random string generator ......and this one rocks!
| |
|
|