3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $key = 'password to (en/de)crypt'; $string = ' {login:"user_test", 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 FApRf
Output for 7.0.6 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function mcrypt_create_iv() in /in/WZC9p:8 Stack trace: #0 {main} thrown in /in/WZC9p on line 8
Process exited with code 255.
Output for 7.0.5
Encrypted: string(88) "Yb6N91CZesHuXt9+qc/G/Gqu9gAHI7lTLoNsIHq+4WjstRiay232jiiwsLFADlb2URhFZqP6XLuwM+lMWKHGbg==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 7.0.4
Encrypted: string(88) "wnOAHJ6v5LA6dRM90leYrFvHi2PpcNNK1B5J7dW3ai55tI+wVrXZU3kdggmRpKvR4/VJ5C8D5sGufwJtEu1Vaw==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 7.0.3
Encrypted: string(88) "J5ZVvc9aDH4pL4wMpNYBJJdGJY+VtPTM9dvtkiWdgN4jdW1Q9IT18INNra7xPaZI5+Z8q1L4wI7aMB5szEdc+A==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 7.0.2
Encrypted: string(88) "T7lOkpVe30sRJK2EVrnlV88kIuXaF6NwAc94Y2MHS5yR3sKgKXhpEuwpuCREXbHsNZbCPE9uWePKGav1L6HeBg==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 7.0.1
Encrypted: string(88) "5EVs9G8n/mK330+RQ4/ucqYvZ2sAP2glPJ1uMR/l1PqAuYiZ4vd/p1emba6DR9J/H6LV/M3XozB/dbQExZgNfg==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 7.0.0
Encrypted: string(88) "PVDp5fXiz7CbFKdqApnZHItiGFS2NlyfuP5aYhCEkLQFx47jwdWsFKAKxSSwithR0+8Q2Y0AkP7JSA5JDh87sw==" Decrypted: string(43) " {login:"user_test", 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/WZC9p on line 8
Process exited with code 255.
Output for 5.6.20
Encrypted: string(88) "RTQn9zdDTuh+N8pzZDrxT24NjSyyhgG7I7oOCM3RI+kEqIaM0NGZvfK54PXAzUmNz6/6RNCb0OkRrNsvi3FAIQ==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.6.19
Encrypted: string(88) "pCpL5jA0qtXj0bnzsbSVLk4qU7+0VbmZYDWIV1VCq3SLrn3oZdc97BCngD/o5/3ffNgEpr2t82ypqtW2ijwGIQ==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.6.18
Encrypted: string(88) "QbQ/PtFsgX9cmvPs7XJ/Qyaqg+jgS9qws+6VcdOpP1OhYtW/7HT7hNizhM7EEsx1L1etu+glNLVBL0Ww61yq/Q==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.6.17
Encrypted: string(88) "k4SnjoNVkmaQIciLHebGcMt0haPpTne/++jA38shC1wtEo+YWTvD6mbS/SMjupbNLFJj1Fu7LTy0AGiz+mcpQw==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.6.16
Encrypted: string(88) "U7sudkutXTlmgvAkurgCbSpLpBR8UCxpZHcpHaWVuTnElwTunTl2i+V9nlLW4u4mrREAINM+/Yug/H9uLcG+wA==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.6.15
Encrypted: string(88) "s2EyeZByDwiGcAWrN9AUL2vMeLyJtsFYSjxcCwZf4T2gUlhbtoZxX2d7B93LsA/93Q+ItrflWtkvJ5MN+ZKX2A==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.6.14
Encrypted: string(88) "DAMZOQZERUO9jggI6b/HzEe/cfrJ/0Rz+DWMw88iO9qfOCSe35EvcbRSwUqsuy08XCZgvS+TIrXX6+tN0lBKDw==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.6.13
Encrypted: string(88) "r1fjRX0d1OT239SvRY3D6mop9nu6QTAxNiujYXVWGboP+/MfjUBu2Cffn9RmQvfQVCmLzFfONrDl/CvU6b6DJg==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.6.12
Encrypted: string(88) "VoNnKEuZarf2Q9IJ7u1gldgCF9y/JmXh3X/jNP9s2YdwQ/mtZ1owIjV3bFJ2+Kr2MFBXbB2K8BkwGYCKMf2rNQ==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.6.11
Encrypted: string(88) "S+4VEDQRabZrSMmjVJIkuw5T4iS7FJD3trO/41J1whPUD+iDJhu6pgm2cVMrD9ppnU6ztVd0oVa5wS6XF/x27A==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.6.10
Encrypted: string(88) "98tAePN654tn/B7vyYo2Sbhr1bI8JuX8SDmXaFVADbCBAZEmPVH5wZkgijAQ8pAD4md6bKnknSevhHSRwoZTGA==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.6.9
Encrypted: string(88) "iJvHmRUJmUiRvcPcQRxVT5YU/GsH+nkXSOz4hpKjmaFeocosfDugKHf6bZhsC5nV/u6gKQ1iE1q9aXdrHJ6ZPQ==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.6.8
Encrypted: string(88) "gcPezsh5R02Gyf4PrjpM3DHPbMZ2DCXvMdUmOI9WhaH/MnJIQoNHy6zdouyf6rerW2Wxxcjx+ge+OlcKdvtxog==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.5.34
Encrypted: string(88) "a8pkvgTTus6FFTEu5NLXNpzfbYalWm2Nz4tjDEquTR+fyEyRIAP/y6p8HQe/OEPEyF4b6gMEMZgKcUrccm8upg==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.5.33
Encrypted: string(88) "HMu0hasNmdMUtV8mgHVBhGB4JoKyScE6cNzYKqqVXOE0FvphCjKyGBTJMA2oVLLWnSPBXLhRgYpgO50fCxrWKg==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.5.32
Encrypted: string(88) "JkPPISiRd27K3CTRgvF5YkMknc2y/Deq7OwtGbnRd2GBqY+BhfKTfYCzf4ZwUaEgDyV3nB4lLWJDuSxzWY/97A==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.5.31
Encrypted: string(88) "xiGAwdsuQQeedZIHZbobcac07peZe4bSsTQKkEwi1tlRVXdkvBNMI2PFhjlevqykhKk5dMleZxdLITpng21GNw==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.5.30
Encrypted: string(88) "dNqrZ1C8EsWwkvXc/7zcziqnapr/flLBNLoCqMz1/lkHZIB7DqWgNRvSYfQ23EMtPvTkvku+Ru64TN33//s1lg==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.5.29
Encrypted: string(88) "Qojbp4fgbhoXmsddHjphf+z70V4TxnEwSd28WDaPosmqfYXM8PkYTL9dqy11C2qj3oyVQsBSRPXwV89YxpoOoA==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.5.28
Encrypted: string(88) "QC9RmY6KOLwXRiLQS1xvkujle0dYgJ3lSEUhkRRcow0IXVT45Glgm9paPUmg/7/zaCPb99lUa9vS36SYU3aEOg==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.5.27
Encrypted: string(88) "RkSMLbx9EziNzPHjOdNnccIdcc6YTqlPktxf+kAwrYZDximC5CGUyL6m4zEmIJwy8OyyAxK1tQrcfecWLB9amQ==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.5.26
Encrypted: string(88) "HJzbzYL9ISWSLvwr0mxyIDGre40BPaeJ4sgg47lW2E96CfkfUfiKOG3dZYpN5vI26gC2+P5mdKxwCohP20dF4g==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.5.25
Encrypted: string(88) "gvmNCTMsKs9QamQ1hRcY/OttDmGcQMV29QtPFdVzOrmxP/dTFh9yJf41p/WhBIJvULwNwKTManH8UyIceGtk2Q==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.5.24
Encrypted: string(88) "7KDVLA0/W/GAcpd1XYzc/OBuxWXGNIx94VAmChqCnYZV7Dt2JlJcxRFznvriNVYf92rAnYRlHgPO85LP3W937w==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.45
Encrypted: string(88) "y0wsy42UDMkvKz5I6xAqbCLf+S0LRbeTGNaygtzp0rwX4l5UX9AvY5Jagsqy++TCMcOJeBTPInlmXSf13AU1FA==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.44
Encrypted: string(88) "3YHLwYnOEDTJ/7jYHsGqIDe91GrhX551CDX88A5j2RuLEVY0NT6nr5zs/97LbXf/Y7heg0+SIUvnon2xpEF1pA==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.43
Encrypted: string(88) "sw30afaiqtSjc3mZeMREjb6oDtEGf8i1SLCmTWko19t3JQ1pQVKvKnOuvVHYPDEasB5xoEyEdtu6Tku7W0vGtg==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.42
Encrypted: string(88) "qP0pUTWy+HnRQgVURJM6Uy4bzI3HCT4z3R5EOFqxhQXCzFtlPPHJqnmr6rVXlzXQJGgh8otuwmbsKFU3ZJbtlw==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.41
Encrypted: string(88) "V8NTwoL+gpo8FlQx/kt5WCIx0PzGTC99WMwh5ozTao0WNyG5reIFlHBTyoGvo/Yz8wJg8fGCkriIwc8Jh3nHAg==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.40
Encrypted: string(88) "XtW1iU7QexmGI0KT8HkhzEUHXci3sCYoAjJePQaek9ytTjgVocadZ6R5rTTwjpWLE/2TV9CEeiEmwWJi+7bv1g==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.39
Encrypted: string(88) "mjZfJhN+70jSoiWZt0K2TbDu/tOUQIxAprN3VjloyycsVNDAgJudzPppl8MXEuKb3R4BrYdYpKPzc+C+NzVIjA==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.38
Encrypted: string(88) "BbZrbjrFnCtQezsecsRmqOnJWCWQumVX8wbwRdJZv7LiiaWe8PLjdhrWeQX89JHEC5C6O+GbxyAi6/ZOpUD+CA==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.37
Encrypted: string(88) "mheRM9X8QEGJxMJnpKs9TefEAzkDgmOE6khC97En6WAWA24gZnEf48MGquZBSh1PJW8rAVgL9WttvRJY4llEHA==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.36
Encrypted: string(88) "c/nwU4nm1hRcD0yB83zsaYDBVa5+mb251OpYj3zimRSDSlGG9gH7kw0/Flfoa+zM4fLFBdGdPtoclWlKzX66Ow==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.35
Encrypted: string(88) "QYokOx44KDPZLVARqK6Ywh2R2hd/Pi/WycoETjCfs1Rs6IsAZNrdYzozmlG1EuKxopL7t5wvunlSfjDiiBdjWQ==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.34
Encrypted: string(88) "3pPwM+C3gSeBd9Skco04YIvnpJrFp0qPtmCVBYmnzBa+LNhEY0MuiS450mcmCW+fFbM2a5FiwFuN6n0mq8rBzg==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.32
Encrypted: string(88) "XioupXY43w9gS7qkLPWfOcxhrYfg5sU+Qe2cuMZEOoe/T1pGTTY5EPFdJlV5epbP1CtSeB2vtsuXP9GpyaN2pA==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.31
Encrypted: string(88) "A2aXKfcF3/Y+TlvWavenhTf3jgWOGrVpR7PtyZbFg5k0JLP+aSpHIrPzGsWAdGMciZ6/L2afOldm2SafjHRdbw==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.30
Encrypted: string(88) "OD6u+3strTU7VQkwG/g9PoSK155+qIhj26ElCIwZ3ny4naobbsEXu1budz1+smpimeQN0oeioWzmrbF0AMBLuw==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.29
Encrypted: string(88) "g8PkI3UsFdyaocGQe+VTzXXrJzaiLLsFzA/FBe7KRoXZpGBC5T+V6lP40dkHwUYBdtnG3hBYn9eU5ApK6gYJiA==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.28
Encrypted: string(88) "mPWbv0qHyWRxkTXFT21jbv/UJXl7pYoSW3FJMmuXt4sDQDKiT6dHQXAmEffe1mlPAz6an76Hp/qsnZBVGJGNng==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.27
Encrypted: string(88) "QiG1mnVAK2FNR34C/PVD/CUPd9eu4gzh8rzmeOcS+prOZm41eoMjT5VsMIhSbrcCw2gwgw0T4TEQn2QqRRwgIQ==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.26
Encrypted: string(88) "cQA1QD6087k9+s9V8NVRkfG7nKZltvn1l00IfHSUyGmcoB8uX9EHxFi4t7S0/xc8DsbIpW5gz0l9jBPu21Q73g==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.25
Encrypted: string(88) "5CuZkKnoMHL2wh5SonOyR9DhFWqYJda1EqGjZNMBMftPSPPgCvxtNGrmwFLpeutsnFqrZx4x6vKfcHlcsw2qRA==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.24
Encrypted: string(88) "JwcNiJwAPB+WZM8qAD0QUpi/7/ik2j+D2rLqFcoViMwaFvdEmeipqrIRUpcaCyFn4HPxxks66vNW0l8d+ASq1Q==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.23
Encrypted: string(88) "hUss046NMThDoXAsIqsL2bNF+SSv9PFSagj5z4Z4QnHIOQkA2V7dLLvnXtfF9o2Ctb+xLidT00fIWlCNIT3V/A==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.22
Encrypted: string(88) "70BdtNGirA+KhuB8mya0X93BwQEFp9OCmKhU7rU2fnCe3wDtkt2ZLlIPneDIO8v3J0Sq/7GLJZvy0ZYF2MF4Tw==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.21
Encrypted: string(88) "rS4EaqOB4/sX4N04dXiVkaj+fayC/0as7vRWd5BJoTqRb/R+T5hl/8EJib9jbNTi1QZxeqiCxLNie7Y+ecYNfA==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.20
Encrypted: string(88) "hgFX+JdMTus4LkEQ9FAulPI44TfBBIy7ac1BcOdeQdL2nijm3/Av5ox5ebpBNOuN9Kod9S7SqcD0zqxWkyKrpg==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.19
Encrypted: string(88) "G/5SR4MP9lXetdntCi83j/+c9wprvkWBxjuwAARjBZgWYm0i1XLRu4ISnQvzSGeqdRRMbJr4nhqSEq6JQb2b+Q==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.18
Encrypted: string(88) "at9S8btx9wsK8y+wRnOZ8HpcRzuX5mYlgqBhtzzOA+C+97GxhDDv8Roy4rDD0+nydxpGo02XbFm6APiFC7vIWA==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.17
Encrypted: string(88) "o1rCiasu53mEVAIocbDlPx+2l1352i30qRenB+uAYpSttYpDbTryP6BCkRVBzyVNfxNznGhTTBej+/XIuY8e/Q==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.16
Encrypted: string(88) "ZS2TmFRPM9YWl8ACRlJ3dDr9VZU8dkFhbmxclpgZV6y+e+pMsWwje3XOzU83RS/KVugbQ9S2Nq1VV6g6O58Zng==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.15
Encrypted: string(88) "5M1Xrho1oPji5rHGCIF1zudv78N7YBoOrZpLimyJI4kSSE8G+jiDwID7XSXIaXwxMPb9BgVx7JzAAEvpVZJuyw==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.14
Encrypted: string(88) "M87c3dRBtZmOgY7X9mag7HgrKqDOmhIwWyuKLqvDJz2KCdECBR6bK51H4a8slzZVFJlga9FSejCYuRAALY4b9g==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.13
Encrypted: string(88) "/ecSHdH3Hhwt596nawQFcXY33dDasCIBfv0WsMF6BiYEvkuuqboanConmzPLHsphi88zVBdt9wGQnueJ/EM20Q==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.12
Encrypted: string(88) "YjHN1/+XqY4x6EUCp75DeNSp5WJZXrMJXmPw6/OYcolKBxr7U5+GVP2BFFtYB2WVjtW7hH0NOiXgmXdJ28ErHA==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "
Output for 5.4.11
Encrypted: string(88) "j6t3fFJchIGV2tMWQny8CIYWP9aNjdRvuMRWJ8DF/v+kgLblyAFi95yefJFvRZ8xxmDI1ZQNfLFGRll/dmA7YA==" Decrypted: string(43) " {login:"user_test", password:"12311231!"} "