Language: PHP Highlight Mode: PHP Last Modified: February 19th, 2010
$string="Mary had a little lamb.";$key="My Secret Key";// Encryption Algorithm$alg= MCRYPT_RIJNDAEL_256;// Create the initialization vector for increased security.$iv= mcrypt_create_iv(mcrypt_get_iv_size($alg, MCRYPT_MODE_ECB), MCRYPT_RAND);// Output the original stringPRINT"The original string is: $string <p>";// Encrypt $string$encrypted_string= mcrypt_encrypt($alg,$key,$string, MCRYPT_MODE_CBC,$iv);// Convert to hexadecimal and output to browserPRINT"The encrypted string is: ".BIN2HEX($encrypted_string)."<p>";$decrypted_string= mcrypt_decrypt($alg,$key,$encrypted_string, MCRYPT_MODE_CBC,$iv);PRINT"The decrypted string is: $decrypted_string";
SQL University.net courses meet the most demanding needs of the business world for advanced education
in a cost-effective manner. SQL University.net courses are available immediately for IT professionals
and can be taken without disruption of your workplace schedule or processes.
Compared to traditional travel-based training, SQL University.net saves time and valuable corporate
resources, allowing companies to do more with less. That's our mission, and that's what we deliver.