Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I recently installed the Crypt::OTP module, and I'm having trouble getting it to work properly (or it is working properly, and I've misunderstood the situation). Could you tell me why $cip is coming up empty?

#!/usr/bin/perl use Crypt::OTP; use strict; my $pad = "ABC"; my $mes = "BAD"; my $cip = OTP("$pad", $mes, 1); print "Key | $pad |\n"; print "Message| $mes |\n"; print "Cipher | $cip |\n";

Replies are listed 'Best First'.
Re: Crypt::OTP issue
by sgifford (Prior) on Jul 01, 2003 at 03:54 UTC
    OTP isn't returning printable ASCII text to you. In your case, it's returning the characters with ASCII values 3, 3, and 7, all of which are unprintable. To make this printable, you can uuencode it (with pack perhaps), Base64 encode it, etc.