#!/usr/bin/perl # Copyright 1999 Neil Skirrow. All Rights Reserved # This has been designed to aid you with encrypting # passwords for use with .htaccess. # This coding is copyright 1999 Neil Skirrow but # you may use it in your scripts if you give me a # free copy. If they are pay scripts then please # tell me the url of the script so I may see a # demo! # In all cases, please tell me the url of your website # using this script! # I really don't mind. I wrote this for others to use! # # # USE THIS CODE TO RUN IT #
# Username:

# Password:
#
$htpasswd = "/www/skirrow/hidden_stuff/.htpasswd"; # This is simply the server path to your .htaccess # file! (Full Path) $uselog = 1; print "Content-type:text/html\n\n"; read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @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; $FORM{$name} = $value; } $enc_password = crypt($FORM{'password'}, "Cd"); if ($uselog eq '1') { open (LOG, ">>$htpasswd"); print LOG "$FORM{'username'}:$enc_password\n"; close (LOG); } $success = <<"EOM";
Success

Remember your details:- Username: $FORM{'username'} Password: $FORM{'password'}


Powered by HTCrypt
EOM if ($uselog eq '1') { print "$success\n"; }