package Config::Confmanager; use warnings; use strict; require Exporter; our @ISA = 'Exporter'; our @EXPORT=qw(Encrypt Decrypt); use Crypt::CBC; #CPAN Module For Encryption And Decryption { my $crypto = Crypt::CBC->new( {'key' => 'passport', 'cipher' => 'DES', 'iv' => '$KJh#(}q', 'regenerate_key' => 0, # default true 'padding' => 'space', 'prepend_iv' => 0 }); sub Encrypt { my($encryptstring) = @_; my $cipherencryptstring = $crypto->encrypt($encryptstring); die "Could not Encrypt requested string" unless $cipherencryptstring; return $cipherencryptstring; } sub Decrypt { my($decryptstring) = @_; my $cipherdecryptstring = $crypto->decrypt($decryptstring); die "Could not Decrypt requested string" unless $cipherdecryptstring; return $cipherdecryptstring; } } 1;