in reply to any alternative modules for asymmetric encryption besides Crypt::RSA?

Try this. Ascii armor included at no cost. :-)

Rijndael is also widely recommended as an accepted standard. I think it's aka is AES, for Advanced Encryption Standard.

#!/usr/bin/perl use warnings; use strict; use Crypt::CBC; use MIME::Base64; my $KEY = 'secret_foo'; my $string = 'yadda yadda yadda yadda'; print "input: $string\n"; my $enc = encryptString( $string ); print "encrypted binary: $enc\n"; my $mime = encode_base64($enc); print "MIME: $mime\n"; my $mime_decode = decode_base64($mime); print "MIME_decode: $mime_decode\n"; my $dec = decryptString( $enc ); print "decrypted: $dec\n"; my $mime_dec = decryptString( decode_base64($mime) ); print "decrypted_mime: $mime_dec\n"; ############################################################ sub encryptString { my $string = shift; my $cipher = Crypt::CBC->new( -key => $KEY, -cipher => 'Blowfish', -padding => 'space', -add_header => 1 ); my $enc = $cipher->encrypt( $string ); return $enc; } ################################################################### sub decryptString { my $string = shift; my $cipher = Crypt::CBC->new( -key => $KEY, -cipher => 'Blowfish', -padding => 'space', -add_header => 1 ); my $dec = $cipher->decrypt( $string ); return $dec; } #############################################################3

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh
  • Comment on Re: any alternative modules for asymmetric encryption besides Crypt::RSA?
  • Download Code

Replies are listed 'Best First'.
Re^2: any alternative modules for asymmetric encryption besides Crypt::RSA?
by khandielas (Sexton) on Jul 14, 2014 at 18:37 UTC
    Thanks, but it seems to me Crypt::CBC does not count as a module for 'Asymmetric Cryptography'?