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 CJfSn
Output for 7.0.6 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function mcrypt_create_iv() in /in/5MHtd:8 Stack trace: #0 {main} thrown in /in/5MHtd on line 8
Process exited with code 255.
Output for 7.0.5
Encrypted: string(88) "HWMeqmT8wtBxnYYMxY18bXi38aQksTXGRvED1204hqgIeFFQmxuPdCZ7lMuP1nisT31dAsuPwjw2kLCLgeHYLg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 7.0.4
Encrypted: string(88) "jn8eqJe29xwiWhOkqnKNi8nyg5EDIucp1HyTpvi7hYrwN5IT/lFlGjtWFQH6a8JLjpZAQ9NBGbutQZ3WAJKfRg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 7.0.3
Encrypted: string(88) "V6ukAcm9MxsZdeKWWGaws8z7Tr4b46BnkBUiZIA/sxVdrxHV+kIEeZ7N5imsqnIZwLQw+rP/UGnTrGu1xpQ+UQ==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 7.0.2
Encrypted: string(88) "XbNzS4p8ZGGXD1GErBmtAmAlTsQmPmVFs/02bCjfU5NvGxLNLnCGLbG6OXu/F4s6+4GG5CnjC7bxqmVXS77WXg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 7.0.1
Encrypted: string(88) "AOPfK9MgsRgRWtDCwtxvDZA9qJz6BwV4KTMG3FDUaz54MfGyuDI6UGGsB3+eTXr0OotTO9x79Gt1YA/x14VCcA==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 7.0.0
Encrypted: string(88) "dmwRQQmlpgoNOBWTmimDnu2zwGIxao1kSdxEVb5WLa1kEVGWTlETYYjKljE0ns9TCgmKxaVPnUipVfAvlhRXDw==" 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/5MHtd on line 8
Process exited with code 255.
Output for 5.6.20
Encrypted: string(88) "iL6+2HiAocFAsCN7GGGw2tkfIb5wXq+XDtV6r2XyaABlepu7VGIcmL/JmXZyaPMN2gs1J0e+DU/Q8fA35U6KYQ==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.6.19
Encrypted: string(88) "N90xH+2eZ16slp4QKZk9b4MWe7B5JyJ8F7ZinFadFU4IMTk+xeS6N/goFPOHCoZXqbNYCM/8qKD+pGtfcl9N3w==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.6.18
Encrypted: string(88) "2MaW2D08c0LTgWS0yrgoUJruGS/z3leHwmxD6Gsve5pSba822oP2/ffYz/gsjXHiQM16KO9UjCeltoSBqk1W1g==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.6.17
Encrypted: string(88) "VqGEZGj5yKRguKmI2ChWgyA83bUaFiJ+9JJFiopND7d1CCV9jZjcNjm5QLRbpoHGdER9ahBH6/I2YmphzksX3A==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.6.16
Encrypted: string(88) "sIYff1tj9Ju3htG79/TcetKajXfXVbtONL3VtGZqyptOveyAccmiugjL26K7X/8CMj6xutxqSCG1TcxQvTisaQ==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.6.15
Encrypted: string(88) "sHbOjGSPPH2mlWWAipfRgjmax1ofKTYYfiqPUYSmlQ2CF588k8lWHBe4ESAfKZZ/c/OWuU0I5poH4AdPxT/VNg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.6.14
Encrypted: string(88) "Krcm6qdWAqyAoy9TTUyJfRkcTxrXo3CVUvtw6lWi0XI1n9gO5kMWgNDLDNurdrgz136Izf/ZhoGNEjY8nJoJWg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.6.13
Encrypted: string(88) "KXJ20TDzTeDH53DOoTGsKBXmUKRHQacg74Z6gCXRSfXlNRXw9wSdhW5LM6PRTI0zM7nmdvd6NbIKu0YAZB3rUw==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.6.12
Encrypted: string(88) "DnJnojDANQy1D7mb+Df2rdaoaANL6CqdaYbQuxYs42gb6I+UHGIUbxFJ7+/1cs/K7+1py7kOhVnceDcm5NQheA==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.6.11
Encrypted: string(88) "O5qvGrpzmWRN3svstGiVPwMzdQYKRbcIJ90DEVQx65J5VO6giU7edHtHwzoT6jH00pPCtsxTYTWTX8gEz3iscQ==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.6.10
Encrypted: string(88) "40xCpETsHQOLi75PBWpT0PRRsGUPbEccLFlyiBiz2zGUf/XaYDCoGxu7sPtTzOQyb/IGS+Pd1MPNkzqF3M48Hw==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.6.9
Encrypted: string(88) "jJdjVukk70jtXatqESl8MGrQfsZuif7dUiPk1/LI+IGSJtzwCkI1XRhx5Flo/I6yK0ulw1sa0SaGB5yLh4pAvA==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.6.8
Encrypted: string(88) "eqUlK1i/2V8T5NzSbcq8rIcFwahsS50j+tvxbb4L0QSOstWuOfM+z90Ue17Jg6/rfkpm8Dp1MUI7DmUr3eydvA==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.5.34
Encrypted: string(88) "NDywo9oOeXs7wat88qeYvvRVEX3oq1fmsGpfFokn7zgx5c6iWSs4st6qqGLloBpIUIXBveOHAUcWEVWwkGS6wQ==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.5.33
Encrypted: string(88) "+W/pYrOTOqfj3cglHsEeXX8C83qab24ivICTl1PHWWLtqoqDJhnhXV9nTBF+nx+wrc9f+pi2Cgx7Btk5Ei3ARA==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.5.32
Encrypted: string(88) "/0TJUKaupRQTuwAvCxhgcn8t+VcaJojEOU3dX/uSEGg8jrkIBumLwM5ZETXyGYGROBeJvMDpdLy4qRm7jX80sA==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.5.31
Encrypted: string(88) "cSyWQXRe5jqkvO3f4wNxSeCg6MVlDFO6cQ3bQ9U1o5cPUPc57ApKSRtj4KckSWG6xqSQ4FEPEScrQ3errBPrAA==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.5.30
Encrypted: string(88) "izSaV3Fj8JrSLQjwiy+djyqUGd9Q8UT/Q35ocj8G9uDK87c1SnpZEUckACrI83KfYWxp/V7Z6ZajVz8jKSdV6A==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.5.29
Encrypted: string(88) "tGnbMWQJ2unm5tCInGqeKVVliUFcD50hvXHqNugYGl673+48SataN5DqWsseRrV5YG3OUWE6vvp/PE0T/J1KMg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.5.28
Encrypted: string(88) "Cl0SL7Pj2K8GNeEEP4x1+xOuUW2XQKzQ0L6eqkl3mfNHPhc5cwcANJ6OC+c1cVmcQ/zWAC0DUWWKDvqwW8+dGg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.5.27
Encrypted: string(88) "ju39Cx8Q4tHRFBRcyw3lBTyJcEapb2dB4pekCdUFcB4rZzf28dZ3LeNKUpn05zt4BIeHsvo5DIm9chiBvlBy2A==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.5.26
Encrypted: string(88) "hCSc6966DnEMsYhG8PfmzD+FcVFBN+iaNAVnL1e9ZtObgjRacmPYbvwVTzECbWjy3I/dibWqrFV7pl07MBwK0Q==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.5.25
Encrypted: string(88) "hP5hT9L86jInnt93YKw2lYj8dRqV8idY8FREPa2OwERrUvDLl3EAbHxkA2FLCjawEtO/8oPcbrBrm3/LVk/I5w==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.5.24
Encrypted: string(88) "ufxxKYFOZdOKA8Mb0oF+KG7m4tuMR0Evxjp2GUtewCdRUChm2e7Y/7GJphPAIrIAtVucXJ3s46KFtb+5k2+LjQ==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.45
Encrypted: string(88) "/74Jm4ZRkndsLlOxMH7aTNNF6+JB5F3MW/LxxiQYbn5OBrley3Ano2YjMfXtJ++84KJ+WPgPRugdmvhwlh42VA==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.44
Encrypted: string(88) "qp3uNOnmfoqWGxMdkkNcihVSZyJtbu+PozcHjL61tgF+aIDKGGhPTHBysE7R5zHFdESFd7w6Ezv8zWD5ArPA4A==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.43
Encrypted: string(88) "2oNMknVImAIHzjah6GEig1AQFobNsjk+wqCvG2iqIZ0ziP6r2ioYEPt+Jhwb1rL/28F81IuYqjh/qC8gr3r2Sw==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.42
Encrypted: string(88) "R3Bv9KnAP4S1KZ6dvGslSwFNrrM0t4l/RSFk1xqd2Sd3nkd4rIS2mnntkzKjXR5xwHnZ7jv81Ak5UjQu3+qsUQ==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.41
Encrypted: string(88) "QWPAMjKmUUqnD2uztDvaFwWkKkt+Aq2DZ3NObquAfXUlI9l6yNkcLnuT8MLzXdpv9CIch2R/otJoOkrHfdvtDw==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.40
Encrypted: string(88) "Flqvh519fFD/qG8weH0blrfIR3ogoLkHPfskt3/NyKm9V6fHW5sUsIU796oAArxwtMgoC/1X96lp/8/as1ykmw==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.39
Encrypted: string(88) "93NRToeFedWcXe66poN+t+rAS6Rqt+tCGfLQhaOSGssR/W4BKOImz7Hki+nxWcf6ghjh4zwgImGtvlkpC3NDJA==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.38
Encrypted: string(88) "Xw0fcpTKEJgxLSk5zI4XK8IE1WK5mN2NKeg2+5tLCYzUmEVdUYkcQk3WeRtimKj0JvRS92hIt5OttD26ihbHwA==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.37
Encrypted: string(88) "nbc8VgFyOoEm54VaxJy8rCcI1O6woky+S7xUrg9qJZWyjkpx5R/Kpjd/bDZzwFtQ6+ayvuwqjgmtTylKwMZ4/A==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.36
Encrypted: string(88) "NnU1HnnLJPU9KMT7lZie9T3ca+tmiQcHbgHkqBUTk/74TmjzLJZ4+1yoOZe/GArzsaJFCAj6Y9RekD3PrkV/Lg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.35
Encrypted: string(88) "9P+wSvF7uQe3GxEcVb106uFw5gDSRZGurQeNMcIfmiTh+iQawwsaxlVClQG+ExLU+wxE+DfbRPtYZtULmjYs2w==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.34
Encrypted: string(88) "WE51t4+7F426TJmA04iB0GCBVPpNha7eTORNQgKO3kRu8uGcrBDqL6N+6LO6WyuFMzOhnM4Qrqp+ECv/ZK58Lw==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.32
Encrypted: string(88) "HuByjij67tAjFW4n0ue/O+GrZwn/C1g/O1r6V1vPfLk353c6p11zrqKviKfsqQhpSN3PA985Ms1IdxDsm24O/g==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.31
Encrypted: string(88) "SJ+qe4av/wPYailrMxRGAUwLjlslUGrEjHk2yYWGrASBwVcp1eYW5j2GpfAAw4qxP7WshuYP+pzGJ5VSEb+25Q==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.30
Encrypted: string(88) "2K4cczPzsih2S2L80OySrP+LI5a5ME96p9OvYzLrCnEucnLsnAbDbEBv/+Nco6IDPwmykfT9JNqCcirmPsCBUg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.29
Encrypted: string(88) "qMtb66ORZF6cLdwuFLZQfQXq2nc64XePsbd6wQPJVN3Fe1q+BWV++BpavfTu/AnTsYbHWddhMsDw3IJuTgFyPw==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.28
Encrypted: string(88) "50RUjFhkF6W+ZyOQvmE74qkxaqMp8FAM4TnoFQo2KrFSANFuYNGlG+ggXMvMr0Rz5jWA0x0YDhuXAisprEcKKQ==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.27
Encrypted: string(88) "7I8vqLQ6QO+Y61wBTBi/SO8Bx527lHN2g0nk64gxoUrxhINI+cN3PJP/bZ5aoKWYEV2rd8puACUT7qr70m29Rg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.26
Encrypted: string(88) "SVuJ9OZ3LIILtOI7sV6FDm088lQD5HsXvPXFmlmUKvgv1kTFWhjyjb9NVE69rUlsCOUbqo3Hte19ySTYyo2Lvw==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.25
Encrypted: string(88) "IMtqiGx+abcw66fWf8bAkJPTMUF+94q5c4zxvh4Z316JAnF6x3ArlsLQft+nfnpry0NjABTO0ppRCQlAJ0G/jg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.24
Encrypted: string(88) "fDNBtEUtE9ePyqKrFXcmmTcdQEMWj6LgZMGCARBjdYaN7nSVSp4bYvBK8JNz5JoDBsz/kCc9fPBgwuRngf3dWw==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.23
Encrypted: string(88) "bAq/gA1ZjQZPbR+u5zWqLDqcXJZX3W4LQlyNUDuyNO9u2YTwSNCebpTxdZlvjWhYXB2ezKPRXI93XS7JhGwJVg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.22
Encrypted: string(88) "dI1eGEjyjkWHG7j7T61GXiWc9tMExNE73CGUNAq+ICpmeZ3FMk14Plon3dUnh7PRq61AKRWbb7/tp8YfIklOPQ==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.21
Encrypted: string(88) "8kef9kkGcVvwcvUWDOahFN//mbaYDFBFEfgVZVkg4Zuu+Cs9wPfKkhXuKEm+WBDkMk+I+gS+AlIFuWzODRdfSw==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.20
Encrypted: string(88) "F+fwm/OS9ucpyW2QjbQq3IVDG4RkfvGwaoIbZIWbYWDMNVjejdJRxXKCJfQgSloDd69tTFLvoaB9MWLV0zewQg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.19
Encrypted: string(88) "/UbY8X6DkVH1rCObjp6OQCg3vD4y7lQvbYKnySY+4i3A6BSqyAi915ye/rL2ZCGg97ZRh0ALNag5v1GiU+dLJg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.18
Encrypted: string(88) "BzQBu52v4h426N6KXou9I2VoPMOd191GsY3nA0m8hPPf3HdY4NjQqJ/2om3IbfJ+fcuZXG9MA8Drnps8f0/TRQ==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.17
Encrypted: string(88) "eWMpY39aVMbfcxPwiG/zG6t6Y/wo4XxSLDxCETQKSm8HyhUeT4AHxev+u4VNV7rCruBSR7sCYC9jADtIVag7iw==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.16
Encrypted: string(88) "v6/bIWMU3JBMWOII1DSL1EoWbN1G/vQM7yzgG4ydaQvXEm0aPxCu5FaoxOVELsQ7WHpETpzZXhNZL577ImZINg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.15
Encrypted: string(88) "1zre0ouI+m1ZF/AAfDLbfRRH9/h+V4UzYBaN5u8GBJZRQ7D/9FcDsMa2iJFwsLcj1FNctg5EERMdeKs5EmO3wQ==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.14
Encrypted: string(88) "/D3tF/keiurlwOi1m9gnvSw/RXCmydfW6ejMw6SjMTgjgp2fc40kHS27+6ElNbEkK4Dy7MSDIwMRftdH1e6Gdw==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.13
Encrypted: string(88) "WOhSifgNqq2yScbh2uyV3tk+4Os1TnK3foBZvD4lUDHmGyAcvBgos7wKa++N7NcwzXbEWZMM+KqS7mTC1ZQQlQ==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.12
Encrypted: string(88) "X4gCiKl0lHXyC/QZDGUDc3jUFVHVoTeNkceQZI+UymiNkxt9vUojSOF3v3psFhI8tkRbyspQICY2WULK7YApJw==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "
Output for 5.4.11
Encrypted: string(88) "92nW8QBXDticJbAR7B7RCl+vkxOvvmq4xja5FuGE508iCVCQGBEJ0BEyvsMmYTmAhz8SL9J3+Jpw+InWS65Byg==" Decrypted: string(39) " {login:"admin", password:"12311231!"} "