3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $key = '1234512345'; $string = '64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED'; // 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 l4J2f
Output for 7.0.0 - 7.2.11
Fatal error: Uncaught Error: Call to undefined function mcrypt_create_iv() in /in/B9X5C:8 Stack trace: #0 {main} thrown in /in/B9X5C on line 8
Process exited with code 255.
Output for hhvm-3.22.0
encrypted: string(108) "rPFjT3o6YEYlHh4M0N/MPcDrqLdoXWNhwHcsnw6TfqQhd2u6sNk+9UwqKgFDN7KVs8HspzIEE2ZzHFW6rWI1EaFUvmtgOglsEiY00NGD4ZI=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for hhvm-3.21.3
encrypted: string(108) "AsYdWMZs0LNr39t553Ed4JciWQDtDDD8OgugTxvyDREtpjCjmarWdUovasZzcMKXLs1roeAhKz8olnYb9w/9NdrBR5n/6MNNUUJmSqn7nPk=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for hhvm-3.21.0
encrypted: string(108) "mo6fbHsV7qOetFzWZaLiC2Hwxbq4DwN2HJYblWtYi7U0a4Wocy7iDl6O4IvrygzabZdChhhtq1krOLX5sNgV6AU2iE7Gqf15SHnkh7mx6Go=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for hhvm-3.20.2
encrypted: string(108) "7Ts9yNrHABv4uxTdQGuzhv+rh23MIibJtz2dtfzePBFK157zWnhKJDzKZ93nM7Bv/c2vH1TU6P9L4XqXxFfC7ZZYz9Bxzg8YeB3l5+IG4EU=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for hhvm-3.19.2
encrypted: string(108) "S1weXTo/jcZrivgimoofCwD5ORSG76Fgh27Z6TzEpgTv1/aFIwdbk0bWPApTsno8nIZTNgiFcGr0IUe/bfQFQ8TKyM2ulcCKN/OlefjxZj0=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for hhvm-3.18.5
encrypted: string(108) "SKWlrINzngId2hh5k5EwDd8hqTgEMbHpnjSzwyO+e4dqMNoBP6F/UbPTFuz89T6dUuKIBEkl7sjEM/gzBqkduA3vteai9PDPI+MmKcqCOyQ=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for hhvm-3.18.4
encrypted: string(108) "wd60oU4epBiR5+wi7Bp4sYOMIF3KC9W8zpCjmgi936Dyndk7jEfIfDxLGwa+8Ax3/o35aCrLT5pcW+Xzvf+1nca2SCNEL3akEpQIVPG58Ec=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for hhvm-3.17.3
encrypted: string(108) "l5FfatO9dAE/b07dr9VEyb48d7Hy4ebxRdrZpkpcWWJj+Rx2RJa8y2yyr77VfNwI5OyWnTuioPvU1x1V/OyfcCPILQPyL9vY8R4O89761tM=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for hhvm-3.15.4
encrypted: string(108) "Uhw4heetEyFZQ1X6nRKELqxakZ3f1t0qTXUkIv4j4flJ6rLgXIplPt3QabUjEiyI7u9d9h7MNy+dynBasCSbvVW3dF8v/2lYJe4bDv7vlzs=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for hhvm-3.13.2
encrypted: string(108) "Q6olemOIa9P7yy1ZcTS8+3aO+STX5OWbRg/lmV2iX190B/146g8lB9r7Kn/PLTy8d0K5LcPR6dvPTKxJ8e8uWI4fJFJBrQK247eklVpyCA4=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for hhvm-3.12.14
encrypted: string(108) "bt+HKdvfvFKh3exjjQ9Qb+CkP1nGlBhF/d6zpsU/u/6jnfp/0RnoQZ6twCX9bhOLuoq4dmUmapswoVd1yFnsWkbfTW/AscQAhMIUhRR/zXc=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for hhvm-3.11.1
encrypted: string(108) "4CWZyEUGW6P03PLomoyxWcxKRAm7lc1QUoKVM3btqmib+h+3Pi1zMH2QLt9JPhmKJ99CgyxZs+GfLFnzYULnckeI+APbFz9oBuOkL7GuA6g=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.3.22 - 5.3.29, 5.5.0 - 5.6.38
Fatal error: Call to undefined function mcrypt_create_iv() in /in/B9X5C on line 8
Process exited with code 255.
Output for 5.4.45
encrypted: string(108) "i+1gZUPU6FJBk986lb/IUZuTe8LLHluh28NvIF4mpRn+AIFQJrpZIXwQUSi/unENbSrK50T8Mf3w6mjxAyWS1TJfi/8mRbRKrMsPceBst4U=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.44
encrypted: string(108) "DJlGxoHWIFs+nNGMNQ2G/pDWpZveyrrlvIJk4eMm4eoh+hVeWJWFa4sfMHSeDwF/6tiHUeQ8GYVIEVVapr77v9W2rTD+b1BFeOD4hUS0qGg=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.43
encrypted: string(108) "Qmw1j48iGZsop4Cv/Q/kgybwRJuQ2SWXsA2wIKA2Iv+/bgzh3xFIe/NMNqogO9XKTUQj0F9I/cED1FaIKcE0fYGbSbS4vWge32ODoMvVZqU=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.42
encrypted: string(108) "wkAsOE4NGjDRmqrrPsJhcI8qMYKPTMSMQoLn1zMWgK/RIKdpJMhoWecZABTx9iEoWgJSOPx9YydbzFENQamZJ638Zr/VoQabKbfpUEZybG4=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.41
encrypted: string(108) "RoqdEirl3v3kHUZ3if9d9D0T2Fua2vnPHQIrWALC6aKYzJXxj9ub0FC8DVJFxXMHW+PxcuaCpzoYR/5I//LQsM7QLce3iWRYM8WBYzABvZY=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.40
encrypted: string(108) "2rc7AfooHJYBxCEr3MLMmsxoqOjOcgJ9TIBQDuZ53rzBziH+qwYGZBY4jhTV0NGEFtWk4fL1s4jlGC6zMePApmJUVmUi3oAJZc/D+nBedGQ=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.39
encrypted: string(108) "UjdC30ixfo+dnEo8xxMgizKHAyoXMCbltwV24zwpq1nYKOMN3r31n1VvQGHfXWaGmPH9M8SvbkPW8JmBM5AKCbOrjFORj2f75SlISdDBzv4=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.38
encrypted: string(108) "NTrqSeDf1GdjVyZqnbYfsea6qdnMOd8jZNLqpqRJLLMlka8GHR/1MVZcwhYAvGWm/HfKjKuttqaXZ2gRq1MNU5z10s6L5qDN5AFKpLdMW9Y=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.37
encrypted: string(108) "994sqnMDj877xQz2zf2uxHSFDVryq0rfmuAK8jZ4aYYc6SRcqRoRW4QfbER6eJe2yzq/C9cgRGz/Qx8loSaWydJq4W05R8KT8E7QDGIXpuk=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.36
encrypted: string(108) "cHnKdFzzZVovwZrrXRj0nlKZwEgF3xM7xuGF6S/3jWbGlagkfxLKwFC+v2A9ngfDqENxAzSLZHErMEyi1LNrx4hpWIbjha1TFt0Ier05xyo=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.35
encrypted: string(108) "uIiyRzwhXjuhrw3pXilKX0BntxgEFdxXbLSKB/imSGFvwQ+T15/ut/7mPdnupNzBDw7Wo4gimzFn3dcPjQXDWwlvCrAi1aXL8CJOrCeY0Pg=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.34
encrypted: string(108) "CuSGjFd7yQusNRCok8zA21K1HhhM4f/BEO1N6h3X/HvUlFsknkmt2suH5Z+EfauwZVt1PzDS8gRsy0s/djKQgKV0f/rpB8xpjxxy6duBCs0=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.32
encrypted: string(108) "rzaX/mW9CcYPMLWxF6+jbK7u/sBOM205U5i38Scs/ltlUHgLfjYMfG+Hq611iId7i+XlL3MLnAhAigJDGvp6zGswCMdsrJ5ZT0BV91mcGpA=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.31
encrypted: string(108) "xRjMpLciKcPRhVrL2nw8qy9OhurQS8FWHGQVDrVKeDjWeHHcZEeynlV77mQef+h0zE2pvaPspESFuhNbhZA5VoN36NpJkQp0Fcm8GAAqu3E=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.30
encrypted: string(108) "4TxFfFoviJ9svbCfQK8BAlCr8yjDIyn0V959RuzEaR7ecYCaaTqZN8YjITg9ngyx/jnNkL5wpiAp0J4dw0QuHS+7R+jLisuti4VZlhv6E90=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.29
encrypted: string(108) "Ym35d5tVn3Kf/TW4QYjAmswzsw1tg2ExrcUa+VRRy7ChZBCJxY7oCh7jj96yt9VC46/9OJgAq0LRjRiBZYo9UjDBRFj3HybofLU5wqHAEmg=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.28
encrypted: string(108) "nnk+iTOk/Cz+VqYAZ/uzXnLNViH24erOzs7OjJ+QPnQjff/xPAj3wVLm3ejz7pRPStUfzRAN62p4R1JOWFQsB5YCLa1JowXwiYYa4uARFjo=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.27
encrypted: string(108) "ACx1RLPjA1zbPphLOBlcc9g3aT9PQE9HtRssTTjVVu+Y45jbQ0/uWGLk7NO4YPTKeIUSf/3G2EGZx8sS+qE/2BLqeUqg7w+84u9zrCb11rA=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.26
encrypted: string(108) "pUyNBn8TGTf68CejVL4jfsajyva8O9VmulcwSI9ickhZVXmdNDwTjrodco1B5vK4FBL11c3BXrPbMWUpQGkzNEkXFBdV/xj/sh7VvFDR7E0=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.25
encrypted: string(108) "KsqnwxCGy14PtUpWwUqXkLjp906O/8ZN8E8rs3T/0sSMiEa4v0cVYh9hX7Aqr8bxjtJgiKyqMUQpbtXmbzV5JwDC4Ry8SeU21DG+oIC0r6M=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.24
encrypted: string(108) "zY/lFEGc9OkDx2jGiK9BCnnNffOXIM2FJ/sbfFo6JplANuwYgCUOYEchnut6EU8yygaQ2D/tGvQnrzMO3A6q6fjcbR1zcb20/U4ZJnijEI0=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.23
encrypted: string(108) "0xboX8EEcmFmxpHWVUr1sIhtZFcWOdXWvmg5M/Wf5aTkTcZuQEFuInZZ41PkLAOf1z3frwHl1PkOlBq6W0a/P3rSwQ5uOv7xiLOWd4RQp38=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.22
encrypted: string(108) "/b+A2lsx/UOM6Ft/cN8t4qfYj2Y0ETT2iLCH2bLddnQSNcYd8YPNcVg3B22rvQfkzbuj/+y+LR8KdgEn+lb3iCIw/ZcqZyy1aIfq10OFLrk=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.21
encrypted: string(108) "UIfD0kCIHUpURDa3q0dygGaROxC76XGQE4iS1WBzTOwSL4Dd3vAORX8fuSk5Xo3rvtGkfX1Yv2blWzbrQBB8VXl0+G7eB/b3S/CXMBoo2Fw=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.20
encrypted: string(108) "4okU+ySNH6vT5cEKU8eHR2Hy6QDT/5z7Nk1AhR0waXOujZHB3qe0s0AavT91wD19xvW4Ew/a7QL0DrJ7yCMsoUIPBaWr1MRdJkvSJm7KZp8=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.19
encrypted: string(108) "9hHg+KKKkNUDtDn+wq1vhhwx0+/W3TpWGL9dLlE8vSqXfzDFX6hjAtPblag1LLjzYqRJCZUVKLRrLjX/eKXg0eruwlToKUm3UIflcdeMXiE=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.18
encrypted: string(108) "qt4A/GNVVMau4807cBlMsti0/Q0GRatlYq6wLWmVC1UQRWs80LbrasYRrPQ37fw86gQs9+HWZpxbPDXs2XILc7A8wAMhT4kMwa/rWbAc2lE=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.17
encrypted: string(108) "nfTxXjFtuN1CY89pq9taVYPBHOEg1SBREWf82RaO548vy3lj/RoSYKmSPolfpknYMpH2OCQEON80By2UTdyhA9LqxmmLDRS0KHZmv8aas4Y=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.16
encrypted: string(108) "c2HtqjWEzLMl5mrFJNJo0kZHwzqh6WgroxPpOmpQpkeUfHQP/4M/4PDMF95+O/h8kYFI110Qom8Zl2bZ0npbXdMy5YycgdV3mfEGUVSbR2I=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.15
encrypted: string(108) "egOhHPgRJmudyc78TCpGetqtuIIHm0R3j4I0dXNZCyPuJ+4+DnXNeki26cOh5R0qWi4q7JAW5XlYVt0ffkv/7WXjkwGqofhX5klRq8rFxB4=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.14
encrypted: string(108) "IBfLj1ukLQdjDQq+2yZxruBcw3gYK9iQb53E0mr41zymhXlBC2uQ08LtyVKeUJ6wP12XtZryQ9a0qHk5RTIqvoCUr7a3/3cAALPckgHmvG0=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.13
encrypted: string(108) "Mzx9snp/PbXDVHmEKHTzrX7TqAx7k1tphkC0IVtso2AP7jmPRjpQ1tBaZF/FtYU3rkVtrLRKmJRsEYLd64LftF9TdY4djl3sffvuczevD9U=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"
Output for 5.4.12
encrypted: string(108) "FNxNfU4UrLmfJx2Cv4Z13VJI7NRxmngFi7PAfbGp09NdKUC1yKuyPCyrPDYmI9p8KvCA8vPH75lSgLkiLchB2kBAhFJPC94moWWHSuAj0LI=" Decrypted: string(58) "64D97DF8-3277-4578-A00D-CD7CC621A874-7238-00001ABFCD554FED"