Safe non-tamperable URL component in Perl using symmetric encryption?

Posted by Randal Schwartz on Stack Overflow See other posts from Stack Overflow or by Randal Schwartz
Published on 2010-05-24T22:40:12Z Indexed on 2010/05/24 23:01 UTC
Read the original article Hit count: 412

OK, I'm probably just having a bad Monday, but I have the following need and I'm seeing lots of partial solutions but I'm sure I'm not the first person to need this, so I'm wondering if I'm missing the obvious.

$client has 50 to 500 bytes worth of binary data that must be inserted into the middle of a URL and roundtrip to their customer's browser. Since it's part of the URL, we're up against the 1K "theoretical" limit of a GET URL. Also, $client doesn't want their customer decoding the data, or tampering with it without detection. $client would also prefer not to store anything server-side, so this must be completely standalone. Must be Perl code, and fast, in both encoding and decoding.

I think the last step can be base64. But what are the steps for encryption and hashing that make the most sense?

© Stack Overflow or respective owner

Related posts about perl

Related posts about hashing