[EMAIL PROTECTED] writes: > (1) Always double check your crypto. > (2) Never use Perl BigInt's for anything ever... especially crypto. > (3) When in doubt, use LISP.
I believe that your Perl code is buggy. Why are you using ord()? Do you understand that when you read from /dev/u?random you're getting a raw integer value? I have attached an updated string2dec.pl program. Generally, when I am writing code and I encounter a strange result, my first inclination is to assume that perhaps I did something wrong. But you seem to be different than me. Regards, --kevin -- GnuPG ID: B280F24E And the madness of the crowd alumni.unh.edu!kdc Is an epileptic fit -- Tom Waits
#!/usr/bin/perl # read MSB-first 8-bit bytes from STDIN and print its value as a decimal integer use bignum; while (read STDIN,$byte,1) { $val = $val * 256; $val += unpack("C", $byte); } print "$val\n" if ($val ne "");