Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: perl aes-256-cbc

by haukex (Archbishop)
on May 14, 2020 at 12:27 UTC ( [id://11116784]=note: print w/replies, xml ) Need Help??


in reply to perl aes-256-cbc

Works for me...

use warnings; use strict; use Test::More tests=>2; use Crypt::CBC; my $cipher = Crypt::CBC->new( -cipher => 'Crypt::Cipher::AES', -key => pack('H*','01F0E0D0C0B0A090807060504030201001F0E0D +0C0B0A0908070605040302010'), -iv => pack('H*','8006e3b6dbdb4865e079d0543c6007bc'), -padding => 'none', -header => 'none', -keylength => '256' , -literal_key => 1 ); # Test cases from http://aes.online-domain-tools.com/ is $cipher->encrypt(pack('H*','313233343536373839303132333435363237383 +2343634303031305468697320697320612074657374206D657373616765FFFFFFFFFF +FFFFFFFFFFFFFFFFFFFF')), pack('H*','d899b35ce2b37036de3885227d8ca6b8ecc82c3f21ae89123b6d149 +67301b3bf08596e32df12de93621f15f90e6ea4b969a752c3f50fb771b8821eb0e606 +cf6c'); is $cipher->decrypt(pack('H*','313233343536373839303132333435363237383 +2343634303031305468697320697320612074657374206D657373616765FFFFFFFFFF +FFFFFFFFFFFFFFFFFFFF')), pack('H*','d97548a7925ff9d1f3a5fd4dac00c120a3faa51c931c203ec8cbad0 +25e3574299d1043fb51865a47469100a15e96203621396b7ec86d8202869b4fb1039f +aa8e');

Replies are listed 'Best First'.
Re^2: perl aes-256-cbc
by perlmdl (Initiate) on May 14, 2020 at 13:39 UTC
    Thank you sir! i wasn't packing the Hex values, my stupidity NOOB

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11116784]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-26 06:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found