Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Crypt CBC

by jfroebe (Vicar)
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


Comment on Re: Crypt CBC
Download Code

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 lurking in the Monastery: (6)
As of 2014-07-24 08:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (158 votes), past polls