saysuri has asked for the wisdom of the Perl Monks concerning the following question:
once Again back with one more question.
can some one please help me how to use aes-128-cbc in perl.I got the information like:/
URL="https://metacpan.org/module/Crypt::OpenToken::Cipher::AES128"
but How can i use this in encrypting in perl. I got some data,key and iv values and i need to encrypt it using the aes-128-cbc. Here is some more additional information:
use Crypt::Mode::CBC; my $key = '(32bit key value)'; my $iv = '(32bit iv value)'; my $cbc = Crypt::Mode::CBC->new('AES'); my $ciphertext = $cbc->encrypt("secret data", $key, $iv); print $ciphertext;
after executing the above code it is showing the error message as : Uncaught exception from user code: Can't locate loadable object for module CryptX in @INC (@INC contains: C :/Dwimperl/perl/site/lib C:/Dwimperl/perl/vendor/lib C:/Dwimperl/perl/lib .) at C:/Dwimperl/perl/site/lib/Crypt/Cipher.pm line 5 Compilation failed in require at C:/Dwimperl/perl/site/lib/Crypt/Cipher.pm line 5. BEGIN failed--compilation aborted at C:/Dwimperl/perl/site/lib/Crypt/Cipher.pm l ine 5. Compilation failed in require at C:/Dwimperl/perl/site/lib/Crypt/Mode/CBC.pm lin e 8. BEGIN failed--compilation aborted at C:/Dwimperl/perl/site/lib/Crypt/Mode/CBC.pm line 8. Compilation failed in require at cipher1.pl line 1. BEGIN failed--compilation aborted at cipher1.pl line 1. at cipher1.pl line 1 Press any key to continue . . . -----------------------------------------------------
oruse Crypt::CBC; use Crypt::Cipher::AES; my $key = '(32bit key value)'; my $iv = '(32bit iv value)'; my $cbc = Crypt::CBC->new( -cipher=>'Cipher::AES', -key=>$key, -iv=>$i +v ); my $ciphertext = $cbc->encrypt("secret data"); print $ciphertext;
after executing the above code it is showing the error message as : Uncaught exception from user code: Can't locate loadable object for module CryptX in @INC (@INC contains: C :/Dwimperl/perl/site/lib C:/Dwimperl/perl/vendor/lib C:/Dwimperl/perl/lib .) at C:/Dwimperl/perl/site/lib/Crypt/Cipher/AES.pm line 8 Compilation failed in require at C:/Dwimperl/perl/site/lib/Crypt/Cipher/AES.pm l ine 8. BEGIN failed--compilation aborted at C:/Dwimperl/perl/site/lib/Crypt/Cipher/AES. pm line 8. Compilation failed in require at cipher2.pl line 2. BEGIN failed--compilation aborted at cipher2.pl line 2. at cipher2.pl line 2 Press any key to continue . . . ------------------------------------------------------- In this case can some one please do let me know how can i check if 'CryptX' and (related modules) are installed properly in my machine.
Thanks in adv...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to do encryption in perl with aes-128-cbc
by Corion (Patriarch) on Aug 29, 2013 at 10:42 UTC | |
by saysuri (Initiate) on Aug 30, 2013 at 09:03 UTC | |
by Corion (Patriarch) on Aug 30, 2013 at 09:05 UTC | |
by saysuri (Initiate) on Aug 30, 2013 at 10:03 UTC | |
by Corion (Patriarch) on Aug 30, 2013 at 10:56 UTC | |
|