I have a small problem. I am attempting to decode a cookie which appears to be Base64 encoded. However, using MIME::Base64's decode_base64 function is giving me something which cannot be parsed.

Below is what the company security web page tells me about my own cookie. However, I cannot get their "cyphertext" to decode to something which can be parsed into what they have in the table.

Note that they don't show a few fields near the end, and I know for a fact that the last field is an MD5 hash of an RSA key, so it won't be readable. But the rest . . . how am I supposed to parse the result of decode_base64? It's garbage!

Please help!!!
Your WSL certificate/cookie in plain text is:
issue date Fri Mar 16 19:27:12 2001
exp. date Sat Mar 17 05:27:12 2001
issuer issuer here
cdsid JROBISO2
ip addr. 19.82.24.80
aci group NONOVVM
dept no. 1239D709
org. code ENG
employee type V
mr role N
organization organization here
company company here
div. abbr. VP

Your WSL cookie in ciphertext:
OrJpEDqy9bBwcm9mc3B3MkB3ZWJmYXJtLmRlYXJib3JuLmZvcmQuY29tAGpyb2Jpc28yADE5LjgyLjI0LjgwAE5PTk9WVk0AMTIzOUQ3MDkARU5HAFYATgBWSVNURU9OAFZJU1RFT04uQ09SUE9SQVRJT04AVlAANTIwNQBERUFSQk9STgBNSQBVU0EATlVMTC5jZW50b2tzAACKnsXgqAYrukdta7sDd65KLWOchc53KcNMRqeTYX4rLmr/XID4lE2I2cNyIjZApSG9D0JWR1jUzoo3t53alPsL
the code I am using is:

#!/usr/local/bin/perl -w # # this is an attempt to make a cleaner read of the Ford-WSL cookie use strict; use CGI qw/:standard/; use CGI::Carp qw(fatalsToBrowser); use MIME::Base64; use CGI::Cookie; my $query = new CGI; my %cookies = fetch CGI::Cookie; my $cookie = $cookies{'Cookie-Name'}->value; print $query->header; print $query->start_html; print "<h1>Cookie</h1><br>\n"; print "Straight cookie: $cookie\n<br><br>\n"; my $decoded = decode_base64($cookie); #write_file($decoded); print "and Base64 decoded: $decoded <br><br>\n"; print $query->end_html;


What does this little button do . .<Click>; "USER HAS SIGNED OFF FOR THE DAY"

Edit: chipmunk 2001-03-16

Edit: chipmunk 2001-03-16


In reply to Base64 Encoded cookie is giving me headaches! by tame1

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.