POK Flag Weirdness wth binary files
From: Wayne Myers (waz_at_easynet.co.uk)
Date: 05/26/04
- Next message: Jeff Schwab: "Re: localtime problems with month"
- Previous message: Gerry George: "localtime problems with month"
- Next in thread: ! aaa: "Re: POK Flag Weirdness wth binary files"
- Reply: ! aaa: "Re: POK Flag Weirdness wth binary files"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 26 May 2004 13:18:38 -0700
Hi,
This week I got bitten by something very strange. I was writing
code that needed to decrypt something encrypted using Rijndael
encryption, but when I read the key in, for some reason, the
Crypt::Rijndael module refused to accept the key as a valid
scalar string.
Digging around in the Crypt::Rijndael code and testing the string
with Devel::Peek revealed that no matter what method I used to
read the key (a stream of random binary digits), the internal POK
flag was not being set. Crypt::Rijndael explicitly tests the POK
flag before accepting a key: this is why that was failing.
However, I am not the first person to come across this problem,
and found an extremely strange workaround here:
I have written a short script reproducing the problem (under Perl
5.6.1 and Perl 5.8.3) and demonstrating the same workaround, here:
http://www.waz.easynet.co.uk/pok/pok.pl.txt
Is it a bug in Perl, a bug in Crypt::Rijndael, or a bug in my
understanding of how to read in binary files?
I'd be grateful if anyone could help me shed light on the matter
Cheers etc.,
Wayne
-- Wayne Myers http://www.waz.easynet.co.uk/
- Next message: Jeff Schwab: "Re: localtime problems with month"
- Previous message: Gerry George: "localtime problems with month"
- Next in thread: ! aaa: "Re: POK Flag Weirdness wth binary files"
- Reply: ! aaa: "Re: POK Flag Weirdness wth binary files"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|