Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Crypt CBC

by jfroebe (Parson)
on Jul 16, 2008 at 13:31 UTC ( #697970=note: print w/replies, xml ) Need Help??


in reply to Crypt CBC

The following works fine (make sure the data does NOT have a '0x' prefix)

our $cipher = Crypt::CBC->new( -key => 'lkasdjf34509340#@$JG', -cipher => 'Blowfish' ); #================================================== sub encrypt; sub decrypt; #================================================== #------------------- sub encrypt { my $text = shift; my $ciphertext = $cipher->encrypt_hex($text); return $ciphertext; } #------------------- sub decrypt { my $ciphertext = shift; return($cipher->decrypt( pack("H*", $ciphertext) )); }

Jason L. Froebe

Blog, Tech Blog

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2016-10-01 19:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?






    Results (6 votes). Check out past polls.