httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sameer <sam...@c2.org>
Subject Re: Password generator?
Date Thu, 22 Feb 1996 06:54:38 GMT
> 
> Sorry for the off topic message, but I wondered if anyone knows of a good
> password generator written in c or perl?

	Here's the one I use for the apache-ssl registration thing:


sub genpw
{
    local($index, $pass);
    local($size) = @_;
    $charlist = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz";

    $pass = "";
    for($index = 0; $index < $size; $index++)
    {
	$rand = int(rand(length($charlist)));
	$pass .= substr($charlist, $rand, 1);
    }
    return $pass;
}

-- 
Sameer Parekh					Voice:   510-601-9777x3
Community ConneXion, Inc.			FAX:     510-601-9734
The Internet Privacy Provider			Dialin:  510-658-6376
http://www.c2.org/ (or login as "guest")		sameer@c2.org

Mime
View raw message