#!/usr/bin/env perl # $Id$ # Legacy tool ; will be replaced with C one soon. use Digest::SHA qw(sha512 sha512_hex); require Term::ReadKey; if(@ARGV < 1) { print STDERR "Pass me username\n"; exit 1 } print STDERR "Password: "; Term::ReadKey::ReadMode("noecho"); chomp(my $password = Term::ReadKey::ReadLine(0)); print STDERR "\n"; print STDERR "Verify Password: "; chomp(my $verify = Term::ReadKey::ReadLine(0)); print STDERR "\n"; if ($password eq $verify) { my $digest = sha512_hex($password); print "$ARGV[0]:$digest\n"; } else { print STDERR "Unmatched\n"; exit 1 } Term::ReadKey::ReadMode("restore");