I need to integrate an application on our site with a customer that is using a Trale Single Sever Signon utility that will pass me an AES encrypted string that I will decode by knowing the passphase and iv string.
The code is simple enough and seems to work just fine,
my $cipher = Crypt::CBC->new(
-key => $key,
-cipher => $cipher1,
-header => 'none',
-iv => $keyIV,
-literal_key => 1,
);
my $encrypted = $cipher->encrypt_hex($plaintext);
my $decrypted = $cipher->decrypt_hex($encrypted);
My problem is that while I can encode and decode, the sample from the customer does decode properly at all. What I get is a lot of crazy characters that look like encoded data that hasn't been hex encoded.
My encrypted string is also quite a bit shorter than the sample supplied, so I'm wondering if it's a 128 versus 256 bit encoding issue?
If so, how do I force Crypt::CBC to use 256 bit?
Here's a sample of the output:
http://cgi.audioasylum.com/util/testcbc.pl
Thanks
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.