Encrypt Passwords Perl Script


Quick and Dirty Perl Script to encrypt a list of passwords

It expects the list of usernames and passwords to be sperated by : and to be piped to stdin. Problems might occur, when a username contains : (in the password, there shouldn't be a problem) Perl

#!/usr/bin/perl
while (<>) {
($username, $password)=split /:/, $_, 2;
chomp($password);
system("/usr/bin/htpasswd", "-b", "/path/to/htaccess", $username, $password);
Last update:
2012-02-06 07:36
Author:
Rod
Revision:
1.1
Average rating:0 (0 Votes)

You cannot comment on this entry

Chuck Norris has counted to infinity. Twice.