in reply to Re^4: binmode copy loses final byte
in thread binmode copy loses final byte

Yes. That was the issue. Thank you kindly. An encryption program, naturally, must expect to read in files of whatever type.

What I'm hoping to do is recreate in Perl an encryption program which I had written long decades past and subsequently lost. The original was among many which I had authored in JForth on an Amiga 2000. Those I had preserved for ten years or more on a CDROM but now cannot find that disk anywhere.

I have all but entirely forgotten Forth, and my Perl has also grown rusty. Being now retired, I have elected to refresh myself in both as hobby projects. Again, I thank you for your indulgence.

Replies are listed 'Best First'.
Re^6: binmode copy loses final byte
by ikegami (Patriarch) on Jul 01, 2025 at 15:07 UTC

    Note that my padding algorithm may not be optimal from a cryptographic standpoint. I have not researched the padding algorithms used in crypto. But I doubt you care :)

    Also, you've confirmed that I doesn't make sense. The encryption should work the same on every machine. You want L< (or L>) or Q< (or Q>). See Mini-Tutorial: Formats for Packing and Unpacking Numbers.