Mcrypt can be used to encrypt and decrypt using the above
mentioned ciphers. If you linked against libmcrypt-2.2.x, the
four important mcrypt commands (mcrypt_cfb(),
mcrypt_cbc(), mcrypt_ecb(),
and mcrypt_ofb()) can operate in both modes
which are named MCRYPT_ENCRYPT and MCRYPT_DECRYPT, respectively.
Example #1 Encrypt an input value with TripleDES under 2.2.x in ECB mode
<?php $key = "this is a secret key"; $input = "Let us meet at 9 o'clock at the secret place.";