- hex2bin: documentation ( source)
- bin2hex: documentation ( source)
<?php
$td = mcrypt_module_open('rijndael-128', '', 'cbc', '');
mcrypt_generic_init($td, hex2bin("a6bf4df0f3edeb67763adbb23942c793"), hex2bin("0a2a7127c3918f5e"));
$encrypted = mcrypt_generic($td, "application/epub+zip");
mcrypt_generic_deinit($td);
mcrypt_module_close($td);
echo bin2hex($encrypted);
?>