#!/usr/local/bin/perl ######################################################### #BooPasswordCrypter-Lite- v1.04 / This program is free. # #(C) BooBooClub 1999-2007 # ######################################################### #read if ($ENV{'REQUEST_METHOD'} eq "POST"){ read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); } else{ $buffer = $ENV{'QUERY_STRING'}; } @pairs = split(/&/,$buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s/\r\n|[\r\n]//ig; $FORM{$name} = $value; } #allow if (!$FORM{'key'}){ &html; } elsif($FORM{'key'} =~ /\W/ || length($FORM{'key'}) > 8){ &error; } else{ @saltset = ('a'..'z','A'..'Z','0'..'9','.','/'); $salt = $saltset[int(rand(64))] . $saltset[int(rand(64))]; $passwd = crypt($FORM{'key'},$salt); print "Content-type: text/html\n\n"; print "Successful\n"; print "
\n"; print "




Successful!




\n"; print "
\n"; print "パスワード $FORM{'key'}
\n"; print "
\n"; print "暗号化後 $passwd
\n"; print "
\n"; print "
\n"; exit 0; } sub html { print "Content-type: text/html\n\n"; print "BooPasswordCrypter-Lite-\n"; print "
\n"; print "




BooPasswordCrypter-Lite-




\n"; print "
\n"; print "   \n"; print "\n"; print "
\n"; print "
\n"; print '半角英数のみ8文字以下で入力してください。',"\n"; print "
\n"; exit 0; } sub error { print "Content-type: text/html\n\n"; print "Error\n"; print "
\n"; print "




Error!




\n"; print '半角英数以外の文字が含まれているか、8文字以上が入力されました。

ブラウザのバックボタンで戻ってください。',"\n"; print "
\n"; exit 0; }