sub AuthUser { my ($user, $pass) = @_; $user = substr($user, 0, -1); $pass = substr($pass, 0, -1); &Update_Log("Attempting to login as $usrname with $password... "); $auth_rc = 0; my $cipher = Crypt::CBC->new( { 'key' => "$pass", 'cipher' => 'Blowfish', 'iv' => '$KJh#(}q', 'regenerate_key' => 0, # default true 'padding' => 'space', 'prepend_iv' => 0 }); my $ciphertext = $cipher->encrypt("$user"); open PWD, "C:/MyListenSvc/bin/passwd" or return ($auth_rc); while () { if (m#\Q$ciphertext\E#) { &Update_Log("... Login OK\n"); $auth_rc = 1; last; } } close (PWD); return ($auth_rc); }