#!/usr/bin/perl ################################################## # WebMasterTools パスワード作成CGI # Created by WEB新撰組 津田貴史 # Created on 2002年04月01日 ################################################## use CGI qw(:standard); @char = ('a'..'z','A'..'Z','0'..'9'); srand(time|$$); foreach (0..7) { { local(@temp); push(@temp,splice(@char,rand(@char),1)) while @char; @char = @temp; } $keisu = $char[($_)] . $keisu; } $pass = param('pass'); $now = time; ($p1, $p2) = unpack("C2",$keisu); $wk = $now / (60*60*24*7) + $p1 + $p2 - 8; @saltset = ('a'..'z','A'..'Z','0'..'9','.','/'); $nsalt = $saltset[$wk % 64] . $saltset[$now % 64]; $passw = crypt($pass, $nsalt); if ($pass eq ""){ &shuki; }else{ &html; } sub html{ print <<"EOL"; Content-type: text/html
$pwd
$lsdata
EOL
}
sub shuki {
print <<"EOL";
Content-type: text/html