Decrypt Data
(Appendix C, Cryptography - Pg 101-102)
<?php
/* Retrieve $string. */
$string = base64_decode($string);
$iv_size = mcrypt_get_iv_size($algorithm, $mode);
$ciphertext = substr($string, $iv_size);
$iv = substr($string, 0, $iv_size);
$crypt = new crypt();
$crypt->iv = $iv;
$crypt->ciphertext = $ciphertext;
$crypt->decrypt();
$cleartext = $crypt->cleartext;
?>