in reply to Something aint right using Crypt::CBC here...
I can't promise that this is the problem, but you don't check the results of sysread and syswrite. What happens if you get a short read and don't have a full block? The finish() method pads for that, but you can't use it in the midst of things.
It would be easier to use buffered I/O with local $/ = \1024;. Your loops would then look like:
{ local ($/, $_) = \1024; while (<ENCRYPTED>)) { print DECRYPTED $cipher->crypt($_)); } $cipher->finish(); # amend to what kiaf says! }
After Compline,
Zaxo
|
|---|