The key is a string that goes through hashing and the hash is used for
encryption, by default, in CBC. Have a look at -literal_key option
http://kobesearch.cpan.org/htdocs/Crypt-CBC/Crypt/CBC.html

Cheers,
Adel.

On Wed, Dec 17, 2008 at 4:08 AM, KundanN <kund...@synechron.com> wrote:
> Hi,
>
> I am working on some encryption and my code is
>
>
>
> use Crypt::CBC;
>
> use MIME::Base64;
>
> # use Crypt::OpenSSL::AES;
>
> use Crypt::Rijndael;
>
>
>
> my $iv = "\xc4\x37\xb4\x79\x2a\x85\x62\x33\xc1\x83\x99\x4a\xfe\x10\xa6\xb2";
>
> my $key =
> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
>
>
>
> my $cipher = Crypt::CBC->new(              -key    => $key,
>
>
> -cipher => 'Crypt::Rijndael',
>
>
> -header          => 'none',
>
>
> -iv                  => $iv,
>
>
> -blocksize => 16,
>
>
> -keylength => 128,
>
>
> -padding         => 0,
>
>                                                                         );
>
> ;
>
> my $ciphertext = $cipher->encrypt('dentsu001');
>
> my $encoded = encode_base64($ciphertext, '');
>
> print $encoded, "\n";
>
>
>
> then out put must be: T3FPTjQGXZk9XOkjyqrmfg==
>
> but its coming : OoO5e3rOVxoh7BQD74RU6A==
>
>
>
> I don't understand what is going wrong with my code.
>
>
>
> Please advice,
>
>
>
> Thanks,
>
> Kundan
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org
  • cbc-aes KundanN
    • Re: cbc-aes Adel Abushaev

Reply via email to