3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $key = 'password to (en/de)crypt'; $string = ' {login:"admin", password:"12311231!"} '; // note the spaces $iv = mcrypt_create_iv( mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC), MCRYPT_DEV_URANDOM ); $encrypted = base64_encode( $iv . mcrypt_encrypt( MCRYPT_RIJNDAEL_128, hash('sha256', $key, true), $string, MCRYPT_MODE_CBC, $iv ) ); $data = base64_decode($encrypted); $iv = substr($data, 0, mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC)); $decrypted = rtrim( mcrypt_decrypt( MCRYPT_RIJNDAEL_128, hash('sha256', $key, true), substr($data, mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC)), MCRYPT_MODE_CBC, $iv ), "\0" ); echo 'Encrypted:' . "\n"; var_dump($encrypted); echo "\n"; echo 'Decrypted:' . "\n"; var_dump($decrypted);
based on 5MHtd
Output for 7.0.6 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function mcrypt_create_iv() in /in/FApRf:8 Stack trace: #0 {main} thrown in /in/FApRf on line 8
Process exited with code 255.
Output for 7.0.5
Encrypted: string(88) "N81h9BvH67y/jOPOm4k22cLc9i/bEFwCr2mbU1+WBkFKT/OUto0mXfgrbTlVxA23+bU7OYGFb65AY4eo5AgGwQ==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 7.0.4
Encrypted: string(88) "J8C6J9eI75SF6iXDB104i4f9o2j70q2nI4ZbOCTX9PCf4JcugQPfbuZaAfJiZZOrExBj7jxuKugJAfwVZnYAsg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 7.0.3
Encrypted: string(88) "RC78WQuDjyVeloEey8Cygj1QndakkEmFPzP8ewonz2/55ziEtlsy4Ly+Tg6IbcYKRmsgbQZJI0xNk2Cjyv8McA==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 7.0.2
Encrypted: string(88) "4GymeQy+KjkJwcjGaTRO3ImOoBBvLw+svAFwbdS67LDL19ZbsubC29V1e6U3b4Qqnb4h9oetx8nq29o8HjYHFQ==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 7.0.1
Encrypted: string(88) "Ttb6ijf9YEXzNd8XrpPouBmbwAUasvuNgnj5WsAE2tQbjAPFsSlPcRC+sBf4fd1uNj5gLcrpwuBuA8CyJz26Xg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 7.0.0
Encrypted: string(88) "+UZEgQ6zsa1IV/gnvAq+LnQYnpVXOWaKha+rtMrksWFHUXIrmJS9src/YDNAzyr5SGpRjICyYkGQAlkD/be27w==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.3.21 - 5.3.29, 5.5.35, 5.6.21 - 5.6.28
Fatal error: Call to undefined function mcrypt_create_iv() in /in/FApRf on line 8
Process exited with code 255.
Output for 5.6.20
Encrypted: string(88) "VVsQidcAW/H9uE4C96TG+/DF0Eq24jQgiwiVIvBAGv9WjeslzyX+LnzSvubwwJRBpGDfPYcRYiIqc3V+MWOJYw==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.6.19
Encrypted: string(88) "VMb4Ibf3gVNNSlBtBP9QFgWat+hBUgLpDpu8jJB3Mh6/LJwsev12kehV+gDRGWsstBmpzXTa/m05qVsYLOCX0w==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.6.18
Encrypted: string(88) "VPxdvExc1cuvqte5+TH6d4z4COTfNpQzaGzAeU+UAn02Ebieo2boYYvau7jA4IpZSSZmPvtk7WboNx2eMvTx6w==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.6.17
Encrypted: string(88) "10r+vhOKydTZWqe/U5CmhVW0aeROkobBL5addd/67Httvw2mzru1mhsNqLHdmTDLK+mEQ+eyd5uFcXb+YBc7LQ==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.6.16
Encrypted: string(88) "9ZWN8mJTsNUrzlrRjiopVHc+WOGqE62giY4PXKKOD3+fc2R8lI03ypLqPS5cN603nBzRzBfJjM72JbxmkZHRMw==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.6.15
Encrypted: string(88) "JRfkUZxrAOxUkf4lwtAliCJHrD2bF3bf/BlgZFlonk2m2IrhrGksbIE9Nwibr0QmzTE44K3LZAPYn/LQe0lN3w==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.6.14
Encrypted: string(88) "4QTM9Ge7Rk8pscKWK5DzF8VBHPLhBvlOvFKrBxdETZWbkfygjKN0nLqi4LBL6/CZp9VpgBrptj4TO1Qyhfz/Qg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.6.13
Encrypted: string(88) "d+tvpZ3vzelCqyt3LdSwlhO7Bx8FOY268V+v70cbmdxYEyoF307piWY5zFwIYtOsdXkfULosg+eRLfUrubhhZw==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.6.12
Encrypted: string(88) "xC/FnvwWKnDeZ6G5lL9fu8i+QgeE/MKUE9mbG5aOcgSyyVzJKLlVDwIYuNoEVKi3Rv62eeqAaJ2+8BwiGxKYnQ==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.6.11
Encrypted: string(88) "aJt6P7NDVRbmgyMjVVXJqb+B2lZlV2QyKqkf5udNgH5lghVO/ge+Rt1RsCEKHZb6XB0rrijb/uF2pWoT70vcrg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.6.10
Encrypted: string(88) "WVCqUZj6fV4JxoZ4rNhe0bwevTh3OefMWL4X/NRUXvG6q+gm5R7UbnBdDel/ihqj8kqsjl69+8EMk90GkOgQ1w==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.6.9
Encrypted: string(88) "l1QtFL8tQzt6YfoRxe4Bbjp9PiFehM22FZPIcPSzqnyzhj0OBQGqI9U21QyAYd1EFwwOmZJklSSBr6MDPDyl6A==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.6.8
Encrypted: string(88) "/4qkGMNcWVEN2wbu3uiVhokysViYiU/42UDh7DkSPk5nUOXACLbZ/LVgOmLsB5Vm3ZlCRcX40jhckabuT6Pt1A==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.5.34
Encrypted: string(88) "FV+BJMgZ8vnawr5eHKy9fLnkBsF+LZ2EyWicFKZc0LKuXI1zngMUp3s2YvYSZ+G/NW6M2r0eHKBVS9PJvWBNKw==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.5.33
Encrypted: string(88) "Yda1UnlN51ddwZYtosp/sLTW5q2R0I6AoBNbeJ4erYjW2SShOkaBreCEocjF0TJ9cxtNrEHgoCA0dTQh6D/plA==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.5.32
Encrypted: string(88) "AqvLdCFXHZRns0xCDzx5bI9cHlZrwO9lyK0Wu8xZjUdnspWJbJe3pjVZvPW7WFD+iKSyjg4N7/B4dKqe3dI9XQ==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.5.31
Encrypted: string(88) "RVlY9jq1fwXL8qhke2TRiA+e02SA6AxvRge6YfWygu5N+Nf16JOuBaWLjI28wgjVO9o/67zJwRZ3W3K3wQpUjg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.5.30
Encrypted: string(88) "6dr+EMlMbwDPhG3jgN8NTsz5pBHIRrbgtBJ8onFdrKKqisnRg/s3+oMbz0o/KeLytkTPBH4qvOIAGlCE1nzNAQ==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.5.29
Encrypted: string(88) "E9c8PfDmDi2xd4Ns3pUmdHiQUdbYyZzyzBMciHifltvsUwN1ffGZpQYwxMzwSFhGGUJR8Co9EN6aXiYp1Dy2NQ==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.5.28
Encrypted: string(88) "h2hSLrye7DAPzudCUAKnJshXovGjPlU0I7cgfL4MqFyJzLzysisJPJLT5Kbfz5flcd83XE2lmqADjll6UTpr6g==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.5.27
Encrypted: string(88) "3MaqRPKSzKzWVgXpXEZwReZovtk10yc5+ZgdwNT/PQ/qHPBI7kixDznXahLOTkemJhTAME8AdPvtfZjj/WCr6w==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.5.26
Encrypted: string(88) "0VTEU5kZLiqQ9/HqPAwbqrEhEvpqXCns87oyDHPRhsFobe8k6M0kGwGEOBLQ/Fo0OVuK0oEQBSwnAyYvkN3ZEg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.5.25
Encrypted: string(88) "3pZY2iKAVFoULd33lJ1wQ07PX52p6y3DPYFpT6r7A8maNt7Bn5ApaTESwwedjYhMXem3V6/zS00PcW8alxukoQ==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.5.24
Encrypted: string(88) "MuL1j04bfW22uxYwXDwPVGz4kTZNGqvdUNSF+x7W1Ya1etCTk0x9Z10Awl8GgUr0bO+2+ZLX1Xy0IsVK6iC9LQ==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.45
Encrypted: string(88) "fGk3IBYJ+G/6S/iVsJlhC2dS4uV/jzaOaWAzPs5i2hPfh+cOsS/x6qDALTehzZWHUyWGXOLi7iTYoTWlMHzEpg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.44
Encrypted: string(88) "o9CbCa9ttUU0tHWqidiA/aAP/CP03WuhjO9UewcYw/HsYfsnjMR4M2YfA/jeSSrmG/Oi1fOAfGaxhUGhyD1Nzw==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.43
Encrypted: string(88) "51IH3ToFBjZ/1Klovyyg4AmkYqAVfNXwuukHqa0i7Dde4jKLg/WwzveJ+6XG9gFre5hqb4/T3sPIrQUi6Yzxhg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.42
Encrypted: string(88) "FyxlCaWKP69ifIudbwUuFMQFa4MXDwnAD6IGKG5MWfNZl46Wmmeir2vrTstZfoNf5IykCwz8fakNctVTNXat9Q==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.41
Encrypted: string(88) "yG6KsuG3l++tLbL79gixCdzmSHv0y9CTF7vjFh9TYDz7VwyQM0jrQlAAbRBo5np9SHZAGDyhiP73wUNKA8kXcQ==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.40
Encrypted: string(88) "+xKfQMM0RHAi7QjER8aCPjShuX/HtIwyieZlgEREBkTvQ+g88xvewmIYFh3HsFqKpflSF/J+v7n1j7ILsMBU2Q==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.39
Encrypted: string(88) "n0CG1picIzoK8rH5XEwAbzB3A9x3wu1znT/d2KUTUblTuPX5jUL+TG0vZvm7ohj1FhtWiSo6cH3SK9AlzrZwCw==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.38
Encrypted: string(88) "5LF4r+DN08hpXjV7ULcFkojBWsPwzeBb/Jcnm4xkjRXF0UdqSv3nE61gr+KfXSlJHTWz9ql4jLC0VBqHqg27jA==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.37
Encrypted: string(88) "tr3+2dlcSKOTutqxv/KfjJr9CGCrEUiG5Ij4YKqsiMkpRt61WoceiwrxIuKzin1Qv5YwkH1S0yJDbSdAOxTnjw==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.36
Encrypted: string(88) "WtdEqIL8WkoQmXxPgA3HNCaf3zgmiWtg4AUbvyLwNplJYZzwvXqlkZdybaLuBaQnAgOurgY/OlAfacCvMhI3Cg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.35
Encrypted: string(88) "7hzdNB3vsTEhypJcSO5ijvvubuxRicSgrZ814ohtgneqo8vqI4Zt8MlZdy3S1CHv8yeKsEP/Jq/1ZFqTcvHygw==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.34
Encrypted: string(88) "3NjSESy3F9VrfQ8S7VhGn4p1r5LlWeACmY6xUQnGxGALiet+CsJSqtOvPtnxKlnsa732co2VsrSe0zaSkpQVLQ==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.32
Encrypted: string(88) "gkhqhEg8ZxBtiKB7BbphH4LDgMYRaiyG3S+VeCSM4nVMPtleZG+/cGkDAh+iaP5oCcpvjsLednSIhvMxYzYd8Q==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.31
Encrypted: string(88) "0HA98fW7VzZhP95D9Bi3CR8M0BnQ8mp842OkTX2bluecGTNw6zZ76CSqC7BfIpqm+MfcXUnQk9ifI0Hgs6esDg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.30
Encrypted: string(88) "pnr5EfVum7+OjqYK4YxolVFVuAGph8cCYxNNYeeB/yMfqryzkkrdz2ql0K2y+mIhIxG6sipzgdPlXEV8RCmfmw==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.29
Encrypted: string(88) "0pjKU6R2Njk7g6TnVd5qpkKP+TH/L1rT+y7tH5Wq15d6JFPZ4E83HR5uLetTG0X8807ubb/Miip0twwabNRvvQ==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.28
Encrypted: string(88) "U2qyenhogNJrEwnoAVjpcul/YR194ane25330kx7S0ZvoFR+HlvP+29Rm4qsnSkBOsGKxBAklXDD6JiGWU5bTQ==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.27
Encrypted: string(88) "5XjUefeJ2+utHe9T1dphdcXIaUsq2UgLUBi2B7N3ggcjTE+9StYwC3ukXyIqt0/ZZiJmfxITsZSURVMwcCnibw==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.26
Encrypted: string(88) "Bihuj4wVfBdbNelcgh1FLmacgeibkO9QiMic4k8jvz3Ogwngw8qRJxiE2Sv90xiTOTLVcaf1tVL3QZUQXHSZhw==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.25
Encrypted: string(88) "bFvexjciSZ86AvX9SPzN5mEYxOlHj+cvrqwuNEo6lmXzDoc8UHBs6H4iILlRinlL1xcum0fk4IrANdR6tXdwKg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.24
Encrypted: string(88) "Ui1aClE1N2fgs1CP7f4Uuxtf07qfT0atlBDbOBjgNYfY/4Wrm69jc/FrIs7iCgr3B7cR2lC0qczq8+ZE0fZz7w==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.23
Encrypted: string(88) "CkV2AR2P5mi6mgs25SYjTfJ7qIJkZ26XOkNfe90t1Kl6XJC7RAs2Mmyi9iIlIEAtYf6nlamx+LLgVAhDC6T+IQ==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.22
Encrypted: string(88) "fPnV8hfItwnuiIaxOoHwCe5bZZ89Y6hBZwIrznU0XExrRRDz2n0Plld2FcaoMrKQBXO8xkV/9Lk4Y/cLaQBVMA==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.21
Encrypted: string(88) "CUboZSUY97tpdWdR8K8lKuFrRg92tFA0HSWzVzxRKW7CwNsazsYarKhddHqqJDfzuUB2fqjYaNodVtb4Uui1Sw==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.20
Encrypted: string(88) "8p1psJDxWhY9584a3ECdGhrDI4k3S6RyLx0pEX1UCGrRRi2nb1ZM0u+lhV4e+bLJgXddHmO4lnruJH3YItnpQA==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.19
Encrypted: string(88) "2pGfuEDrLxySg1EwfqYKP7PGkX8qd8bKEaCSFYZPL9uqb3RbpkL57Zuc8bLroQx6fiFbuQRJzFnUF5wDeyJqxQ==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.18
Encrypted: string(88) "TbW0w/nFtxe/6893UFpfgJ3R95vkIvBNch6ZNmylbmLmAVywZNSyManWb6IqCp1trH6161bLHR7Q+YKtEXzSRA==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.17
Encrypted: string(88) "xrPt+zR5dUpbfsU44yyXF6sL1lTdupbd96VEB8TN0YtK5FmmM2FqJ1UDcVeaeUEMnjPbu1xeIkutZYiQr37s2Q==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.16
Encrypted: string(88) "1cem8dOMwxGY586hg+rZ+MCAxXeOAspp4VZdh3APzry53zlOPAkC+t8efdTDmQxdHHMtVkWtuBGxaArkcyTAcw==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.15
Encrypted: string(88) "yUQr3d83eLUfcrhcgAfs3+RZYtTRdbfkEp869DhgJAjlJoS8VbyqdnxhE7aHcnVjGt5ElaKnkntn+mmnMTVwzg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.14
Encrypted: string(88) "vHIL5B7wCsStkdCLACb+doaAlDMCF2Mztcl+njsx0GtzMg7gPfPGof/LbaehD80sWzesKVF4Fn9pQYSWNvbJrQ==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.13
Encrypted: string(88) "QkPk3TXnufCTlsxk/9Cu4Pk7fO8ZJlP4zR8/FT+Eae604XtSOv7SIx5LaSRih/A4CChdzovSiZ7LakuIZ/lhrw==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.12
Encrypted: string(88) "ZAw7qWjAYrWh8cwkb2khH0eZxcslmkC0XcWRg9+t0Obolsk9uTZEFbAxqutEx8BFr1yUAAgYi+9ER5d52ubN+w==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.11
Encrypted: string(88) "NG7XLrrxfSqSEvmwdmqDAkNpzGKvWj5m3zXpZeLKiAeBPCAfW8vcdaS3MtuhKIMpylFzV/jmc7crAhelaZBoAg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "