Has anyone seen a version of the crypt command for Windows? My intention is to encrypt a list of passwords before sending them to the server (bcs my ISP will not allow me to schedule a program in CRON, and running a special prog everytime i upload a database is not practical...)
Nov 11, 1998, 9:26 PM
Administrator (9387 posts)
Nov 11, 1998, 9:26 PM
Post #2 of 2
Views: 2976
The latest ActiveState has a working crypt() function. So you could do:
srand;
open (DB, "<password.txt") or die $!;
open (OUT, ">crypt-password.txt") or die $!;
@salt_chars = ('A' .. 'Z', 0 .. 9, 'a' .. 'z', '.', '/');
while (<DB> {
chomp;
$salt = join '', @salt_chars[rand 64, rand 64];
$encrypted = crypt($_, $salt);
print OUT $encrypted, "\n";
}
close DB;
close OUT;
which will encrypt a list of passwords in password.txt and write it out to crypt-password.txt.
Hope this helps,
Alex
srand;
open (DB, "<password.txt") or die $!;
open (OUT, ">crypt-password.txt") or die $!;
@salt_chars = ('A' .. 'Z', 0 .. 9, 'a' .. 'z', '.', '/');
while (<DB> {
chomp;
$salt = join '', @salt_chars[rand 64, rand 64];
$encrypted = crypt($_, $salt);
print OUT $encrypted, "\n";
}
close DB;
close OUT;
which will encrypt a list of passwords in password.txt and write it out to crypt-password.txt.
Hope this helps,
Alex