in reply to Length of Crypt::CBC result

Why use pack at all? Try this:
use Crypt::CBC; use Storable qw(freeze thaw); use MIME::Base64 qw(encode_base64 decode_base64); my $priv_key = "fdslgjlsdgjl flds"; my $encrypt_method = "Crypt::Blowfish"; my $cipher = new Crypt::CBC($priv_key,$encrypt_method); sub save { my $data = shift; #data struct you want to save return encode_base64($cipher->encrypt(freeze($data)),""); } sub reload { my $string = shift; #string you got back from form return thaw($cipher->decrypt(decode_base64($string))); }
I use this to preserve the state in a cookie typically, but you could also pass it along in a form. If you want to pass it in the uri you need to translate some chars (I don't remember which ones though).