3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $key = 'password to (en/de)crypt'; $string = '76521'; // 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 6k67Z
Output for 7.0.6 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function mcrypt_create_iv() in /in/LO1os:8 Stack trace: #0 {main} thrown in /in/LO1os on line 8
Process exited with code 255.
Output for 7.0.5
Encrypted: string(44) "V7yit4QaWHtR5bnTPInTAhnMSskTQ2i+UF2Tg1XtSZk=" Decrypted: string(5) "76521"
Output for 7.0.4
Encrypted: string(44) "pjUpkvA1mELkBDU32VAqWE5qj3OmJ4XoOc6Fu/7i9uQ=" Decrypted: string(5) "76521"
Output for 7.0.3
Encrypted: string(44) "z0iO71q3L4ggj+Iyh6xFjW//KN9WhZ5saAkzwOly9kU=" Decrypted: string(5) "76521"
Output for 7.0.2
Encrypted: string(44) "tZvjSPQhp49f3FtlBi6P2t/nge+RdCQl/TsFIY5IKZE=" Decrypted: string(5) "76521"
Output for 7.0.1
Encrypted: string(44) "PCdwBF3Id5/oxPZ1gWn5SaC/tsc4864mEz4I3JzB3wc=" Decrypted: string(5) "76521"
Output for 7.0.0
Encrypted: string(44) "eoEKH/w6PZosF8yEIgoM3m4aNu9UYNXys8b+Wih6XrA=" Decrypted: string(5) "76521"
Output for 5.3.19 - 5.3.29, 5.5.35, 5.6.21 - 5.6.28
Fatal error: Call to undefined function mcrypt_create_iv() in /in/LO1os on line 8
Process exited with code 255.
Output for 5.6.20
Encrypted: string(44) "IPqET/Ef7W8tdJo/wTPIW80353NpBT4j5sMuz0qLb6k=" Decrypted: string(5) "76521"
Output for 5.6.19
Encrypted: string(44) "HS6Ht5o9P/eKzwbNe4zbF7I6ySPSyDQopsc8wWRoCaI=" Decrypted: string(5) "76521"
Output for 5.6.18
Encrypted: string(44) "HtL6mK+RoEXPRdtVw6XZZY/WsUg3CfGM+jJfh79VoUs=" Decrypted: string(5) "76521"
Output for 5.6.17
Encrypted: string(44) "86QA7w3J0z5VbAPET21HfcVUxZ7AO3xqV8r/KltU/TU=" Decrypted: string(5) "76521"
Output for 5.6.16
Encrypted: string(44) "k35cwm9IbjT875kwPg1Hl9M3Pl9oypz4EDR+reiW10A=" Decrypted: string(5) "76521"
Output for 5.6.15
Encrypted: string(44) "U5Pon/rKtt3vAHqUdll88Awo26BB618XrrnM/p1+vRo=" Decrypted: string(5) "76521"
Output for 5.6.14
Encrypted: string(44) "qT3f2gLW+saFZB4t/Tcc0cy+JC8w4YPgH2/G06O7Ejg=" Decrypted: string(5) "76521"
Output for 5.6.13
Encrypted: string(44) "zpUB62rtXbhabXW8NaukMg/pNKRELn2Xn1BiCXwkozc=" Decrypted: string(5) "76521"
Output for 5.6.12
Encrypted: string(44) "Ml7JfNJb+Vt/F7WrdE5mfNWqYRx1nRAuwR7CPdyz/Oo=" Decrypted: string(5) "76521"
Output for 5.6.11
Encrypted: string(44) "KL2ReBCK1rdG+x6sP+Od6rmp1LODzksWb5RheOCqxTA=" Decrypted: string(5) "76521"
Output for 5.6.10
Encrypted: string(44) "DrVAhnBCny67p4rwoD76qY82YQeKCkkbJFfpIWGRJ+8=" Decrypted: string(5) "76521"
Output for 5.6.9
Encrypted: string(44) "uQD42Fi2evU8h+U/0JRwaYfOhPbQgYGLv11cD/F3jmo=" Decrypted: string(5) "76521"
Output for 5.6.8
Encrypted: string(44) "OVTChCbWoz2rhAvZI+2zZlSjw4pueg0VKYF3Tsdoisc=" Decrypted: string(5) "76521"
Output for 5.5.34
Encrypted: string(44) "dyMOSawk+78P/0tpWV/ajD6/wGY5R3SKCdspZzRswks=" Decrypted: string(5) "76521"
Output for 5.5.33
Encrypted: string(44) "8RH2vUCGp4hWlO0Ou1Tv2624PA1Ujtnd03yZ8bHPGxg=" Decrypted: string(5) "76521"
Output for 5.5.32
Encrypted: string(44) "jTB/tvwGpKGQSHOc+gTemEmcI28lHJy1fxwwiyqYmac=" Decrypted: string(5) "76521"
Output for 5.5.31
Encrypted: string(44) "Rz/bdHtKocygmnJkhwDZOQhjbxnjquoqFOpB71gTxpU=" Decrypted: string(5) "76521"
Output for 5.5.30
Encrypted: string(44) "ncLEYV/I/2CN8qWLeXYd1H/ohu0ls5pshq7NiVAl75k=" Decrypted: string(5) "76521"
Output for 5.5.29
Encrypted: string(44) "3/tltftQtLY44uFqOUox75jXLwBK9GTtqR1GU//bnDc=" Decrypted: string(5) "76521"
Output for 5.5.28
Encrypted: string(44) "IGxD0B/DIfGtOdaDWZ1HRhWWHJicbgtwsyNp4dHbdLk=" Decrypted: string(5) "76521"
Output for 5.5.27
Encrypted: string(44) "ujmxPTQLBwcyicsHUQ+uYn0U4YROoiaPR4ErG6brgfw=" Decrypted: string(5) "76521"
Output for 5.5.26
Encrypted: string(44) "Lt/Hmxd07QMiICCLil5IT+x98YsYfS2HY6L3Qku4hw0=" Decrypted: string(5) "76521"
Output for 5.5.25
Encrypted: string(44) "5nbKqlE3sDaQdKmHNenPs1FPjVn1XOloB6Um9caJvZ8=" Decrypted: string(5) "76521"
Output for 5.5.24
Encrypted: string(44) "UgBRTjqbsbC5vHCAdKUz+xYQDoTAYU5ufyFDUqQaa0E=" Decrypted: string(5) "76521"
Output for 5.4.45
Encrypted: string(44) "5gKB5JG6epVkJLXiG2Qf8wkHcruuxjZn8IbMN9foXuc=" Decrypted: string(5) "76521"
Output for 5.4.44
Encrypted: string(44) "ui71CcLZWq75aoHEUT5u33nfNRY10DQFAWJlbuxxMd4=" Decrypted: string(5) "76521"
Output for 5.4.43
Encrypted: string(44) "iU9DI5wQ17cwSDAQPiVngzMpYXahHKxidM6fpnVoQhM=" Decrypted: string(5) "76521"
Output for 5.4.42
Encrypted: string(44) "oy9pz1mu0fTA1J1sKf3BNN1ZogODx/KqBuJJaGoULv4=" Decrypted: string(5) "76521"
Output for 5.4.41
Encrypted: string(44) "95nE6de3rcaAqqvvvL7r1u/47OBo+kVO8TXviwJHamE=" Decrypted: string(5) "76521"
Output for 5.4.40
Encrypted: string(44) "RO/d+MZmcfnd4AugzkQEnKUuvlWXGfWsJhkZGi4Oehc=" Decrypted: string(5) "76521"
Output for 5.4.39
Encrypted: string(44) "6n33bOzFcO33xgdw0vlGWm5nzUxvbqQ339lGdiZmMcc=" Decrypted: string(5) "76521"
Output for 5.4.38
Encrypted: string(44) "EMWsjM7aLM16xKj6Qq+9/otOLtdgwCeF3ZGW1cnLzks=" Decrypted: string(5) "76521"
Output for 5.4.37
Encrypted: string(44) "0EMXaAv3RkciBEybpBbLBNnrR1SACu71am3dqCxjujg=" Decrypted: string(5) "76521"
Output for 5.4.36
Encrypted: string(44) "UU0C5UTgRTLfU5ycWXk+8b/FEqwoJhMAKsgxcS86CMo=" Decrypted: string(5) "76521"
Output for 5.4.35
Encrypted: string(44) "+rBtXQ849VMeyP/R2LJf4dusNTdcv6gjk3qZMitZ+A4=" Decrypted: string(5) "76521"
Output for 5.4.34
Encrypted: string(44) "qPnlTboXOHKgIe8tCTPdebhLWjnU5rU6q/BtH12Yr4o=" Decrypted: string(5) "76521"
Output for 5.4.32
Encrypted: string(44) "KB7gmzZ+rp9HZIjHejzUQRiB2F6kVCg2TeFDwUjSUaU=" Decrypted: string(5) "76521"
Output for 5.4.31
Encrypted: string(44) "rQI4MKLB408OfUgEQ+ScfPIs3quaqQ1N8jI6wsyvLiY=" Decrypted: string(5) "76521"
Output for 5.4.30
Encrypted: string(44) "NUIgg45uJBBbAreRTGKXFULFuT3pmqdEzAxCU3d9TvY=" Decrypted: string(5) "76521"
Output for 5.4.29
Encrypted: string(44) "imCO9qAnBtxvPpXv138OErNhk/QXdtT2z4/6L89QQec=" Decrypted: string(5) "76521"
Output for 5.4.28
Encrypted: string(44) "ED73/zXQICWxiZxwU8hm2EBbakUZUF2XxiKFLMeVyYY=" Decrypted: string(5) "76521"
Output for 5.4.27
Encrypted: string(44) "PwsTUNw3HUcCXr3dFPGdM67RYIEz6T36bOfQup5z9yw=" Decrypted: string(5) "76521"
Output for 5.4.26
Encrypted: string(44) "KZTkD83yRRVA5yGNlRb/IOgiz50nUtBnFDPHkNk0kkk=" Decrypted: string(5) "76521"
Output for 5.4.25
Encrypted: string(44) "p+Jy5hJTK2g35Fjauj7bFgpDKXMUPsGsJYSoXTJqWRA=" Decrypted: string(5) "76521"
Output for 5.4.24
Encrypted: string(44) "uWTElhEuepgG0O/7EW5SH9G7xxpEeivEzE/hWl5kkH8=" Decrypted: string(5) "76521"
Output for 5.4.23
Encrypted: string(44) "uVL7RHh0ktNABryyfY6cCuzHBgAJPHiyjh2YgpRb9zA=" Decrypted: string(5) "76521"
Output for 5.4.22
Encrypted: string(44) "pwSLd8e/et4vu2adHSbp8GrBW4p58yAk/GLLWeuwwds=" Decrypted: string(5) "76521"
Output for 5.4.21
Encrypted: string(44) "NaUZQvZR5s/M6LdxF7NIROKueVOYbricS7Op91bE/DE=" Decrypted: string(5) "76521"
Output for 5.4.20
Encrypted: string(44) "UHfR4fdlms5xrMJp3dhQUq6eiCCaOYwGKx4pcPgACwY=" Decrypted: string(5) "76521"
Output for 5.4.19
Encrypted: string(44) "uUaIc8vep7HR+wCfisNRyPdwc1MfFjgVtv2GCCSLxJE=" Decrypted: string(5) "76521"
Output for 5.4.18
Encrypted: string(44) "41ecW9e4woxeJXouimlqYyYqJWT1QmMPciUABZ9X09Q=" Decrypted: string(5) "76521"
Output for 5.4.17
Encrypted: string(44) "c4bwUFfLsnveYsbmqHN/k9qUpke19ZFO3Sj55NF8F44=" Decrypted: string(5) "76521"
Output for 5.4.16
Encrypted: string(44) "4yILgUuH8oFamkTCIWVbSCzKTct40DCW5vBEKTiEsVI=" Decrypted: string(5) "76521"
Output for 5.4.15
Encrypted: string(44) "lNmLuQzKaJMo95jdZExClAHRkMAJWrDYEziHc2CfUSE=" Decrypted: string(5) "76521"
Output for 5.4.14
Encrypted: string(44) "8AEJgWzmjCVbuh1qrvoN9BpdE/68dunT9VGMDkuG5KE=" Decrypted: string(5) "76521"
Output for 5.4.13
Encrypted: string(44) "i5SK35/mbB9PyyKnCraAen4yRKz4qZXKfYL6F+MYGis=" Decrypted: string(5) "76521"
Output for 5.4.12
Encrypted: string(44) "4ZZ1O4ThZ6aTq/Cp/mQjWKS8GM3/RJDhk6oqQPSOg9E=" Decrypted: string(5) "76521"
Output for 5.4.11
Encrypted: string(44) "3k821booukSqleU06iKH6wIiOa0M3CnO7oQ5HLhf3bw=" Decrypted: string(5) "76521"
Output for 5.4.10
Encrypted: string(44) "T8rZ7uLkPseOXLBgYPGStIVv4gCz+bqsshW2ZiNsBoM=" Decrypted: string(5) "76521"
Output for 5.4.9
Encrypted: string(44) "JW9VYCo4YT+vSN5/3lN6AirCc4PtjYL10eYyuApcatM=" Decrypted: string(5) "76521"
Output for 5.4.8
Encrypted: string(44) "SlPZfoV1VedU/j4e6Qq7aCstFGv6qxozddFkcjDIsbo=" Decrypted: string(5) "76521"
Output for 5.4.7
Encrypted: string(44) "QCxqS6liNIMTo2SBa9ofeBBbBJMXVpwT9w/0STQik7Q=" Decrypted: string(5) "76521"
Output for 5.4.6
Encrypted: string(44) "QjT9OHJcEjhAZLT2a0ahonh8B24tnJ7n7U0Rh3JELL4=" Decrypted: string(5) "76521"
Output for 5.4.5
Encrypted: string(44) "qe1bGDt3Bb5Ev5AgZPUqFoRiit5igYyZPRgC6ta/6uI=" Decrypted: string(5) "76521"
Output for 5.4.4
Encrypted: string(44) "fPSqksloQRDpbr+rl4ypHOEWRln6TJTEsyldsyE4QPE=" Decrypted: string(5) "76521"
Output for 5.4.3
Encrypted: string(44) "s1tiOmyUlvg+aEmhaZZBUlZuQ5Vu5w2uBj4nZHt/awc=" Decrypted: string(5) "76521"
Output for 5.4.2
Encrypted: string(44) "DnKRgAdta4uo1wI5weT1iyqIoNOcFaKMlr+ZrMfAmgg=" Decrypted: string(5) "76521"
Output for 5.4.1
Encrypted: string(44) "/vzcVwPkkxbQUNnO5t+HyJq+cLZh6D8lqrmcL4afx5Y=" Decrypted: string(5) "76521"
Output for 5.4.0
Encrypted: string(44) "fyIMNCQ1WtEFJ07Aua/Fl7JksRIKPeTG42hAPEl0R/o=" Decrypted: string(5) "76521"