Moved apache code into a folder to help prepare for packaging where we dont want...
[httpd-crcsyncproxy.git] / apache / support / SHA1 / htpasswd-sha1.pl
blobad624d1101ff0e1171033d1e9ca7b4e4ca9c5115
1 #!/usr/bin/perl -w
2 use strict;
4 # Utility which takes a username and password
5 # on the command line and generates a username
6 # sha1-encrytped password on the stdout.
7 #
8 # Typical useage:
9 # ./htpasswd-sha1.pl dirkx MySecret >> sha1-passwd
11 # This is public domain code. Do whatever you want with it.
12 # It was originally included in Clinton Wong's Apache 1.3.6 SHA1/ldif
13 # patch distribution as sample code for generating entries for
14 # Apache password files using SHA1.
16 use MIME::Base64; # http://www.cpan.org/modules/by-module/MIME/
17 use Digest::SHA1; # http://www.cpan.org/modules/by-module/MD5/
19 if ($#ARGV!=1) { die "Usage $0: user password\n" }
21 print $ARGV[0], ':{SHA}', encode_base64( Digest::SHA1::sha1($ARGV[1]) );