Actually this looks like a problem with decoding your cipher text.

usually what happens is the plain text is padded with \x00 THEN encrypted, therefore the cipher text length is ALWAYS a multiple of 8 (or whatever the block size is)

In the other post you made about decoding MIME characters, you said that it was MIME encoded UTF-16, but that uses 2 bytes per character, here you are decoding the multi-byte characters into a single byte. eg %u0160 should be something like "\x00\xBF"(note. NOT THE CORRECT SEQUENCE).

Looking at your sample decrypted string which I read as "50\t1\tYell=" the '=' looks like the location where the decryption starts going wrong, it is ALSO the location of the first encoded utf-16 character ('%u2030') which it's too much of a coincidence.

Solution: decode the encoded strings to the correct byte sequence, not the characters. :)

as a side note, if that is the correct first few characters then the encryption is running in ECB mode and so Crypt::CBC won't help you. Tedrek


In reply to Re: Blowfish decryption problem by tedrek
in thread Blowfish decryption problem by richard_mortimer

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.