You should try printing out some of the intermediate steps and see if you get the values you are expecting. What you will find is that $print_this only contains one-quarter of the encrypted text, as $ciphertext is 32 bytes long, but you are only getting 8 of them the way you are calling unpack.
What I would do in your shoes is use MIME::Base64, and replace your pack/unpack calls with encode_base64 and decode_base64. That will give you a readable string in a known encoding that is much easier to work with. Otherwise you need to figure out the length of the string before calling unpack, so you can pass the right count instead of hard-coding it to 16.
We're not surrounded, we're in a target-rich environment! |
---|