fionbarr has asked for the wisdom of the Perl Monks concerning the following question:

I am directed to use this PurePerl routine which codes/decodes perfectly well:
use Crypt::Rijndael_PP ':all'; $key = "1234567890ABCDEF" x 4; # 256bit hex number $cipher = Crypt::Rijndael_PP->new( pack('H*', $key), MODE_CBC ); $c_txt = $cipher->encrypt($data); $p_txt = $cipher->decrypt($c_txt); print "--> encoded text = $c_txt\n"; print "--> decoded text = $p_txt\n";
but I can't store the encrypted data in a string. help please

Replies are listed 'Best First'.
Re: usage of Crypt::Rijndael_PP
by choroba (Cardinal) on Aug 01, 2016 at 16:04 UTC
    What do you mean by "I can't store the encrypted data in a string"? $c_txt seems to keep the encrypted data. Do you have problems printing it? You might need to hexdump it (in a similar way you created the key), or MIME::Base64 it, or...

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
      I want to build a string like: $a = "$1,$2,$3,$encrypted_data" the encrypted_data variable doesn't display/concatenate

        Where is $1, $2 etc coming from? Those are special variables that contain contents of regex captures, which you aren't generating here.

        You also don't have a variable named $encrypted_data. Is this the code you're using? If not, please edit your post and include it.

        Also, add use warnings; and use strict; right above your other use line.