3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class EPDDecryptor { private $key; private $cipher; private $mode; private $iv; private $ipnData; public function __construct($securityCode) { $this->key = $securityCode; $this->iv = 'payza'; $this->cipher = MCRYPT_3DES; $this->mode = MCRYPT_MODE_CBC; } public function decrypt($cypherText) { //Decode the base64 encoded text $cypherText = base64_decode($cypherText); //Complete the key $key_add = 24-strlen($this->key); $this->key .= substr($this->key,0,$key_add); // use mcrypt library for encryption $decryptedText = mcrypt_decrypt($this->cipher, $this->key, $cypherText, $this->mode, $this->iv); parse_str(trim($decryptedText,"\x00..\x1F"),$this->ipnData); return $this->ipnData; } } $a = new EPDDecryptor('Q3pCYA8MoKfGDrO1'); var_dump($a->decrypt('KJq6A9FdFIQTUE8h0zWnE3s7EN%2bENguiZvQ2bzpm2yOl9gKSEwjPM0gb8ugblKYYm3GqTN1eWXuZNsuZV8NPpmtwsum5gDbFjyDruNQcAtCGcL3ZGdElB2HEyrkQZx%2bXVrEyJlgNTHoEKh3aQhnwxZm5q0Kld%2biQA86JIhny77RAEXrOR86dO8fTZcB3D2rNk96rMOIc1w%2fGL%2f5CzjLobi%2fGC8rf%2bJNL9JD92Ja5Ji49XR%2fQ6jP2xU33qjZ2f7ZJiBJ5RG82XqlfhiS4TxLXox5xdUIm1tkYGCTndNvArgiwTVhzLvG4mgEJgC8EBAYbJr4Q9oI683KsQJyvtoRxbezzY7vdOByJgutOCPxue2%2fg6DpOds3EjbZgWyLVKsDU6FIDIgVL9l7ErQ0P%2bj3u%2fVH7jnVHC7syJeHE5gzEnGJ0sY4oWbW9GpA56F1V49RirWBONDUELftvf1upTk3%2fneCPPLvv%2bg6LG2z%2fPIAPTh45gxDdgnrE99xT54qoaWZGnWlkOI7OyDrrAfC3yTtKm00n7Y4pLlLvGjYJTa2NBsHcvXcKjs4cyhKj4zKyAkoINWfmgJya%2fCW1DNw6guv%2fdbmMiIqX%2fQ7uqJEd8qQkhS8VnDylMoc%2bAvsxrkO%2fkoF6RIvXCqSAjsEfKuX9t3900ugKNODjfTBiuymQjRaGP%2fu6e9%2f77JYK%2fJmVqbipahF62rda074qxTIFpeX21syQYoGfbA4y7hTiAHR1CSIF1qU5eppsqeKjJ%2b3iJz1zwfP%2fzIRnEz5d0nrseeA%2b2vDlk%2fFI%2fn6bBAFWxCzTQIYZjQvNQg%2f0W141DoVXCmtweivRADo41LEwobZmR9YJ5rQqS7vrLZ2gnqRv1r2uY8Z6jlJYBDLKdBOwYswNu7k%2bzrOMyM6RsFDz2wicH5FSBpMc45XkuQkB5vgF8NBMhzfoDM0NHAjsRTGDe7a074JgqYDonP%2bZu3TVT01RFCXwNBJ8L%2b1Va4fDrvOkHZnq1uHFAZT9SUrJpkDa2Mtt5WrJ8iM6U0mupQjgCMcZGDIpWBULiq7Bplt2JSykfiNCOe9Y0qg%3d'));
based on k4uWU
Output for 7.2.0
Warning: Use of undefined constant MCRYPT_3DES - assumed 'MCRYPT_3DES' (this will throw an Error in a future version of PHP) in /in/4LvcA on line 14 Warning: Use of undefined constant MCRYPT_MODE_CBC - assumed 'MCRYPT_MODE_CBC' (this will throw an Error in a future version of PHP) in /in/4LvcA on line 15 Fatal error: Uncaught Error: Call to undefined function mcrypt_decrypt() in /in/4LvcA:28 Stack trace: #0 /in/4LvcA(36): EPDDecryptor->decrypt('(\x9A\xBA\x03\xD1]\x14\x84\x13PO!\xD35\xA7...') #1 {main} thrown in /in/4LvcA on line 28
Process exited with code 255.
Output for 7.0.6 - 7.1.10
Notice: Use of undefined constant MCRYPT_3DES - assumed 'MCRYPT_3DES' in /in/4LvcA on line 14 Notice: Use of undefined constant MCRYPT_MODE_CBC - assumed 'MCRYPT_MODE_CBC' in /in/4LvcA on line 15 Fatal error: Uncaught Error: Call to undefined function mcrypt_decrypt() in /in/4LvcA:28 Stack trace: #0 /in/4LvcA(36): EPDDecryptor->decrypt('(\x9A\xBA\x03\xD1]\x14\x84\x13PO!\xD35\xA7...') #1 {main} thrown in /in/4LvcA on line 28
Process exited with code 255.
Output for 5.6.8 - 5.6.20, 7.0.0 - 7.0.5
Warning: mcrypt_decrypt(): Received initialization vector of size 5, but size 8 is required for this encryption mode in /in/4LvcA on line 28 array(0) { }
Output for 5.3.19 - 5.3.29, 5.5.35, 5.6.21 - 5.6.28
Notice: Use of undefined constant MCRYPT_3DES - assumed 'MCRYPT_3DES' in /in/4LvcA on line 14 Notice: Use of undefined constant MCRYPT_MODE_CBC - assumed 'MCRYPT_MODE_CBC' in /in/4LvcA on line 15 Fatal error: Call to undefined function mcrypt_decrypt() in /in/4LvcA on line 28
Process exited with code 255.
Output for 5.4.0 - 5.5.34
Warning: mcrypt_decrypt(): The IV parameter must be as long as the blocksize in /in/4LvcA on line 28 array(7) { ["`����I�����EZH�-4�P���/LU8t��"]=> string(204) "�����*�� f��L���$�sFb�@v9�%��W�FQ�f���� ��k��� �Z bA�G�<�f�3�] � H��C���D@�LQ��:���J b�ʆ��p�l�xf���ƣz���r�f�b.�DQ��J���υ�.��|IB�3vφ��D���7�! Ī乽����t �(�$7M�k�K�|��y " ["��v�Ű���7�i�_Ȩ���w-:�EF�J� btK�D�-r��j�H���AYѱ�����|7óL����X3,��FY�7�11��a1�"]=> string(0) "" [")�,<'��hN�ì5����%_R0�%���VF�P���(MQ�D� �ϖ�"]=> string(68) "�ˆ�7qH�\�Di�g�l�oiT!i�=y��� �IyK�Ez� ��F'�5�R�a2����" ["��Eox��VDe�v�O���e����LO��L�E;�o�����Վ�����QFm����3\�?��)�,ǎb�7 "]=> string(0) "" ["�"]=> string(0) "" ["v@-�z��e�a�7ڲ�IΔ��r�{4��b��m`69���^�A�n�����c8�q���Wu��T��}�����t�4LÊ�_�H����d: Uu�'�c�9:��<��"]=> string(0) "" ["EǏd~A"]=> string(7) "�V�d�0C" }