View Single Post
  #2 (permalink)  
Old 10-29-2007, 12:30 PM
ragavraj ragavraj is offline
D-Web Programmer
 
Join Date: Feb 2007
Posts: 92
ragavraj is on a distinguished road
Default Re: Perl encrypt programs

Lot of Encryption method avialble in perl

like md5,ARC4 Base64 etc

i have given AES String Encryption

PHP Code:
use chilkat;
$crypt = new chilkat::CkCrypt2();
$success $crypt->UnlockComponent("Anything for 30-day trial");
if (
$success != 1) {
    print 
"Crypt component unlock failed" "\n";
    exit;
}

$password "secretPassPhrase";
$crypt->put_CryptAlgorithm("aes");
$crypt->put_CipherMode("cbc");
$crypt->put_KeyLength(128);
$hexKey $crypt->genEncodedSecretKey($password,"hex");
$crypt->SetEncodedKey($hexKey,"hex");
$crypt->put_EncodingMode("base64");
$text "The quick brown fox jumped over the lazy dog.";
$encText $crypt->encryptStringENC($text);
print 
$encText "\r\n";
$decryptedText $crypt->decryptStringENC($encText);
print 
$decryptedText "\r\n"
Reply With Quote