mcrypt_encrypt.php : mcrypt_encrypt « Utility Function « PHP






mcrypt_encrypt.php

 
<?php
   $ivs = mcrypt_get_iv_size(MCRYPT_DES, MCRYPT_MODE_CBC);
   $iv = mcrypt_create_iv($ivs, MCRYPT_RAND);
   $key = "F925T";
   $message = "This is a test.";
   $enc = mcrypt_encrypt(MCRYPT_DES, $key, $message, MCRYPT_MODE_CBC, $iv);
   echo bin2hex($enc);
?>
  
  








Related examples in the same category

1.Stronger Encryption Algorithms