in reply to decryption problem

You could try to use pack to create an eight byte long binary string containing a 1 as least significant bit.

That should work like this: pack "N N", 0, 1 but I must admit I haven't tested it.