Thanks for the replies. I guess this is more of a general question because my encryption/decryption scripts work (they encrypt the data and I'm able to decrypt until this one). But here is the code doing the work:
ENCRYPT SCRIPT #!/usr/bin/perl use DBI; use Crypt::Rijndael; $iv = 'same_16_character_string'; $cipher = Crypt::Rijndael->new( "a" x 32, Crypt::Rijndael::MODE_CBC ); $cipher->set_iv($iv); $data = $cipher->encrypt($some_data); ** $data is then inserted into a blob field in mysql (data in the acco +unts table) DECRYPT SCRIPT #!/usr/bin/perl use DBI; use Crypt::Rijndael; $iv = 'same_16_character_string'; $cipher = Crypt::Rijndael->new( "a" x 32, Crypt::Rijndael::MODE_CBC ); $cipher->set_iv($iv); $sql_data = "SELECT data FROM accounts WHERE account_id = '237' LIMIT +1"; $qry_data = $dbh->prepare($sql_data); $qry_data->execute(); $data = $qry_data->fetchrow_hashref(); $data = $data->{data}; print $cipher->decrypt($data) . "\n\n";
So as you can see I do no extra work on the data before it is inserted into the blob field...just a simple encrypt. The problem now is I have a piece of data encrypted this way that won't decrypt. I get that error on the $cipher->decrypt($data) line, but only with this specific piece of data.

In reply to Re: decrypt problems with Crypt::Rijndael (datasize not multiple of blocksize) by by88
in thread decrypt problems with Crypt::Rijndael (datasize not multiple of blocksize) by by88

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.