Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Can't pack "unpacked" stuff...

by jasonk (Parson)
on Jul 18, 2005 at 13:50 UTC ( [id://475760]=note: print w/replies, xml ) Need Help??


in reply to Can't pack "unpacked" stuff...

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!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://475760]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-23 06:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found