in reply to Re: same encrypt word ?
in thread same encrypt word ?

hi it works fine !!
I am make a little adaptation of your code to use with variable
sub chiffrer_string { my ($a_chiffrer,$cle) = @_; my $key = $cle; $key .= "\0" x (16 - length($key)); my $plain_text = $a_chiffrer; $plain_text .= "\0" x (32 - length($a_chiffrer)); my $cipher = Mcrypt->new( algorithm => 'rijndael-256', mode => + 'ecb' ); $cipher->init($key, ' 'x32); my $encrypted = $cipher->encrypt($plain_text); print unpack('H*', $encrypted), $/; $cipher->end(); }
Very thank for your help :)