3v4l.org

run code in 300+ PHP versions simultaneously
<?php //require_once('./blowfish.php'); //$myfile = fopen("serial.txt", "r") or die("Unable to open file!"); $data='14700902370|0006|Renato Tarabella|renato@tarabella.it|||||'; $iv = '00000000'; // Show not be used anyway. $key = "0123456789ABCDEFF0E1D2C3B4A59687"; $encrypted=mcrypt_encrypt(MCRYPT_BLOWFISH, $key, $data, MCRYPT_MODE_CBC, $iv); $hex=str2hex($encrypted); //fclose($myfile); echo $hex; function crypted($plainText){ $cipher = mcrypt_module_open(MCRYPT_BLOWFISH, '', MCRYPT_MODE_ECB, ''); $iv = 'FEDCBA9876543210'; // Show not be used anyway. $key = "0123456789ABCDEFF0E1D2C3B4A59687"; $cipherText = ""; if (mcrypt_generic_init($cipher, $key, $iv) != -1) { $cipherText = mcrypt_generic($cipher, $plainText); mcrypt_generic_deinit($cipher); } echo str2hex($cipherText); } function str2hex($func_string) { $func_retVal = ''; $func_length = strlen($func_string); for($func_index = 0; $func_index < $func_length; ++$func_index) $func_retVal .= ((($c = dechex(ord($func_string{$func_index}))) && strlen($c) & 2) ? $c : "0{$c}"); return strtoupper($func_retVal); } function String2Hex($string){ $hex=''; for ($i=0; $i < strlen($string); $i++){ $hex .= dechex(ord($string[$i])); } return $hex; } function Hex2String($hex){ $string=''; for ($i=0; $i < strlen($hex)-1; $i+=2){ $string .= chr(hexdec($hex[$i].$hex[$i+1])); } return $string; }

preferences:
51.76 ms | 402 KiB | 5 Q