in reply to decrypt problems with Crypt::Rijndael (datasize not multiple of blocksize)
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.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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: decrypt problems with Crypt::Rijndael (datasize not multiple of blocksize)
by ikegami (Patriarch) on Sep 29, 2008 at 19:12 UTC | |
|
Re^2: decrypt problems with Crypt::Rijndael (datasize not multiple of blocksize)
by Illuminatus (Curate) on Sep 28, 2008 at 19:16 UTC | |
by by88 (Initiate) on Sep 29, 2008 at 14:38 UTC | |
by ikegami (Patriarch) on Sep 29, 2008 at 19:14 UTC |