3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $key = '123123'; $string = ' admin '; // 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/1SOhp:8 Stack trace: #0 {main} thrown in /in/1SOhp on line 8
Process exited with code 255.
Output for 7.0.5
Encrypted: string(44) "/8RGj4Gx95yy+tZGZtKo5uMgAaNhlnDP0s5TTJweOYU=" Decrypted: string(7) " admin "
Output for 7.0.4
Encrypted: string(44) "6qhXOXMKLFHJ+1bjslUuKoJhnpqmaZlOkUa5OPGl2iU=" Decrypted: string(7) " admin "
Output for 7.0.3
Encrypted: string(44) "RYdZVb1KWc0v2mn/QmW0YG2rOLsFb28ncWOGvb9tWtk=" Decrypted: string(7) " admin "
Output for 7.0.2
Encrypted: string(44) "N2L/l6F/uO8NXKkkU0k5GrDXnKAxbU66HjxzwRUxe3Y=" Decrypted: string(7) " admin "
Output for 7.0.1
Encrypted: string(44) "PwB/SrIx9F6A9+NGbkouJ5PQudvC7PqOh0gU1CpwLT0=" Decrypted: string(7) " admin "
Output for 7.0.0
Encrypted: string(44) "acD/wAvoj/2HAyMU4HaTYCsiGXtvm5VtZoe2Fg2UBnw=" Decrypted: string(7) " admin "
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/1SOhp on line 8
Process exited with code 255.
Output for 5.6.20
Encrypted: string(44) "YBYWd9smI8X/IrwTMu0yIYZqSHahXNJmmBL2MZOypVg=" Decrypted: string(7) " admin "
Output for 5.6.19
Encrypted: string(44) "tz4JOw/dhCRqwlvpIurTn1Xc+/hfllfqtUeYKSk97lI=" Decrypted: string(7) " admin "
Output for 5.6.18
Encrypted: string(44) "PvtXllUs+TCEYieB2TV+fXPmam+eUQ+FEzeMjKfEQ/E=" Decrypted: string(7) " admin "
Output for 5.6.17
Encrypted: string(44) "q1LflbDmEWPwXZESRDxJsV4hCbqQJlerQ1Tw1MTfRxI=" Decrypted: string(7) " admin "
Output for 5.6.16
Encrypted: string(44) "BwwFv8RBe89L8TmpVrUZQS/WHjb7v37zBrx1dtccLns=" Decrypted: string(7) " admin "
Output for 5.6.15
Encrypted: string(44) "fopNCHRvbDo6aMfbAlRvt8b72NntPXxlR8uAEHNTLrM=" Decrypted: string(7) " admin "
Output for 5.6.14
Encrypted: string(44) "udnI7fEt3cQmDed6Zxz61Yu8pPTI87X5q2ZwCND/pGM=" Decrypted: string(7) " admin "
Output for 5.6.13
Encrypted: string(44) "0A5cpvNLE+XZJQPG1o9faLZlcj0aBVzVEALlhbTdvlI=" Decrypted: string(7) " admin "
Output for 5.6.12
Encrypted: string(44) "5HnHSdtzjrr1YFCHk+ONJrrLPPjcY+rxlNzjnki8bbE=" Decrypted: string(7) " admin "
Output for 5.6.11
Encrypted: string(44) "SYxlUhzfH5AwzLN6V+6EbQF/GcfJ25NO6foDiRrvov0=" Decrypted: string(7) " admin "
Output for 5.6.10
Encrypted: string(44) "GS6A3WPe51gCI6a+bkLZRntuLQJCNbqJAqWbG6xT2FE=" Decrypted: string(7) " admin "
Output for 5.6.9
Encrypted: string(44) "PDyFR4kLJtlPRff4Prtzmr0AFgtUlzDaykkgHYx1v/c=" Decrypted: string(7) " admin "
Output for 5.6.8
Encrypted: string(44) "TmnXnaWDx4CILL060bzMrDRK+clgAk9VagZ9kmkGdHQ=" Decrypted: string(7) " admin "
Output for 5.5.34
Encrypted: string(44) "7C1adft2ZBFkm6cG7STXLkAroisirFvIo09RM8H7nkE=" Decrypted: string(7) " admin "
Output for 5.5.33
Encrypted: string(44) "pdV8+c+v5OLnArXogp1jyU9LC/6SJFGKVGhpZubg8pY=" Decrypted: string(7) " admin "
Output for 5.5.32
Encrypted: string(44) "GCkEVwDc3aC2NubHTFDAhr79O3JCqPAGgoNOiyDgwvI=" Decrypted: string(7) " admin "
Output for 5.5.31
Encrypted: string(44) "3HF4nxyMIMRfHSfOQACtaJmetgnaEcrWcr4ch/V7NXc=" Decrypted: string(7) " admin "
Output for 5.5.30
Encrypted: string(44) "UKzIyM4ZroiQNhPnUXtqyXUTI8ivdjrT6xLDADK5uoM=" Decrypted: string(7) " admin "
Output for 5.5.29
Encrypted: string(44) "1/ga8dFMsra7C9TMwbjqz92W4Ee33VSWo3gd4wsknwU=" Decrypted: string(7) " admin "
Output for 5.5.28
Encrypted: string(44) "qIDkDwlnkNDapNfDkc+Stn4jYIFq4tr4/bBE78orhQE=" Decrypted: string(7) " admin "
Output for 5.5.27
Encrypted: string(44) "Lu/jCH7srtO79ybdH62AlGnwVgnx+HsutedkX+izoB8=" Decrypted: string(7) " admin "
Output for 5.5.26
Encrypted: string(44) "ZoXHqcQIYblWB24xKcDMTdrYou4QOmuNU3IOXHr0Oc4=" Decrypted: string(7) " admin "
Output for 5.5.25
Encrypted: string(44) "sEQQqJoE/jFvhrieaORsDkGyrpB38crcQuDfnbQtZK4=" Decrypted: string(7) " admin "
Output for 5.5.24
Encrypted: string(44) "Z4Q1qVv64DWtV0ra1iSqG3yBKVQXD3gWcJz/bMcBr+g=" Decrypted: string(7) " admin "
Output for 5.4.45
Encrypted: string(44) "H0vrxorKpeAZtJEQl/g5vTtq/SvaKD7K7tSo156kaDA=" Decrypted: string(7) " admin "
Output for 5.4.44
Encrypted: string(44) "veN3xjm3Ws6q3rO7/zjcwjufrRPHaVvefOXxjcRC/MA=" Decrypted: string(7) " admin "
Output for 5.4.43
Encrypted: string(44) "mEz5SDxGAWTja6/ElRPC7pmqOpb+GZl+OYC4s8WbR/Y=" Decrypted: string(7) " admin "
Output for 5.4.42
Encrypted: string(44) "10r1sE8KVnXBIdSf8PEpXq9Gi+ve+ldnijOZlhYVoKA=" Decrypted: string(7) " admin "
Output for 5.4.41
Encrypted: string(44) "PL8DP/1RzRr0T9dnMv1LXgNq8NTYDptP3sZWX1sxATo=" Decrypted: string(7) " admin "
Output for 5.4.40
Encrypted: string(44) "uJx8KgfmTmZ9+D7L3ZPj29SuOjA76krz/mF1hfmJD1w=" Decrypted: string(7) " admin "
Output for 5.4.39
Encrypted: string(44) "ZHtWSlj7CrNNSeTNZYrnru3FuHXVPguwPUQcT4lxvh4=" Decrypted: string(7) " admin "
Output for 5.4.38
Encrypted: string(44) "3SBlAburHpA68rlhMpljd7mbRbsozhD8vfD8j8YEIfI=" Decrypted: string(7) " admin "
Output for 5.4.37
Encrypted: string(44) "RJpzHVmeXFETVONKAw9/3T0JDF9MYW8iAOiTk244+pc=" Decrypted: string(7) " admin "
Output for 5.4.36
Encrypted: string(44) "v5mZROtZcP72i+fLYohLsL+L1jldBjwGLQdb+IJlOZU=" Decrypted: string(7) " admin "
Output for 5.4.35
Encrypted: string(44) "OiSQ/W58jXe6TVmljTGop1ywFEciGrD2t8Xo7Z2QpcE=" Decrypted: string(7) " admin "
Output for 5.4.34
Encrypted: string(44) "YCRyXqmiMa4HPmltK8SOLoS/3wUJP+jUx//9zEdsvGk=" Decrypted: string(7) " admin "
Output for 5.4.32
Encrypted: string(44) "zcoVgwz5CH8bj/FgJ8wiz3x49XuH79E8F+hU1oBd8sc=" Decrypted: string(7) " admin "
Output for 5.4.31
Encrypted: string(44) "6SkuXW+ddCE6Nm6i2GmY22fkjAaBwFVLd7XIo4bdW8Y=" Decrypted: string(7) " admin "
Output for 5.4.30
Encrypted: string(44) "HoEQ69GMYUw9NNm04KI/h5MpQUqw98RuLjX+TKVYo+E=" Decrypted: string(7) " admin "
Output for 5.4.29
Encrypted: string(44) "M62vGih6WSEPtTfVteaX8Ek2VujMdW05TIhWtxvhedY=" Decrypted: string(7) " admin "
Output for 5.4.28
Encrypted: string(44) "DdIpIrkzhpLlpbUm69NUn+2MbZCem1b5VLVG1cTjMsM=" Decrypted: string(7) " admin "
Output for 5.4.27
Encrypted: string(44) "TqzWpskgdAaZ3wrxjr/QScaVdvLt/j//rp538eOmjDc=" Decrypted: string(7) " admin "
Output for 5.4.26
Encrypted: string(44) "TSbWXKfn8yZWOFRX9eoXoQOtkt6YAo6VDg5DX5dkn2s=" Decrypted: string(7) " admin "
Output for 5.4.25
Encrypted: string(44) "ZNmQr575xQSsUsATu2YTrGwR4Rkrg7ws0wXEFRevyEI=" Decrypted: string(7) " admin "
Output for 5.4.24
Encrypted: string(44) "5mfrscs9UnfrRhbELibPUssAH1Iil3efoCxsCmjavqI=" Decrypted: string(7) " admin "
Output for 5.4.23
Encrypted: string(44) "TLItn/itMMu/nkJkinqrMjMPRJWBCVjQ+tGC0Cl2Odw=" Decrypted: string(7) " admin "
Output for 5.4.22
Encrypted: string(44) "lk7KHgxRtzkXKhI8XFc+Y8VUJPIeHrPOh29YLfgU7JI=" Decrypted: string(7) " admin "
Output for 5.4.21
Encrypted: string(44) "HHDdtjcWPihMQNqP7Lm7nIw/pT9H6JSksO/11JRn0sA=" Decrypted: string(7) " admin "
Output for 5.4.20
Encrypted: string(44) "CLmM29xFT1MJ9B7P0TG1k3iZgdZT3Gtwc0uen/FIpZk=" Decrypted: string(7) " admin "
Output for 5.4.19
Encrypted: string(44) "Jghr21VAvNWPcHCYO/4FjXmP6xkBSlT9lQcy7K8Qs38=" Decrypted: string(7) " admin "
Output for 5.4.18
Encrypted: string(44) "+RhKv7CiE96zV5VXjY6kZHFObCA2/Mw5/zHbzBVE5Kg=" Decrypted: string(7) " admin "
Output for 5.4.17
Encrypted: string(44) "M9/WsZGiZfvqwAzL2E5UhDIInG+Hu/Ugy7caInQzZjQ=" Decrypted: string(7) " admin "
Output for 5.4.16
Encrypted: string(44) "IipZjmjLHxSOwGJP62YsvNKls5R9to4WR1e06OjJlz4=" Decrypted: string(7) " admin "
Output for 5.4.15
Encrypted: string(44) "ZgFmyFH6R6/Xs/Ziskb8rjYKuDsUbZpqbC4Bfu/0Oms=" Decrypted: string(7) " admin "
Output for 5.4.14
Encrypted: string(44) "4hfzIc2LHNtb61D5dJhzbR+BtpvBA7yZ6/JYDmUfD1I=" Decrypted: string(7) " admin "
Output for 5.4.13
Encrypted: string(44) "1Ps/FYxFXf5kc8RQdVXI9+juxn3iqmBfI8Y9X0t4f7I=" Decrypted: string(7) " admin "
Output for 5.4.12
Encrypted: string(44) "Yt5Em+tEWfocI4gNCCqOnHWVP3/4gcPn96EcdzSrNhg=" Decrypted: string(7) " admin "
Output for 5.4.11
Encrypted: string(44) "IurWVP4C8/PmrNPbqQJdRE3yP+uq4uy5IoBZ0WE9DyY=" Decrypted: string(7) " admin "
Output for 5.4.10
Encrypted: string(44) "kh4MG/X9svOzxA8mW14lErvjNHR+h9LGzppviN1llUE=" Decrypted: string(7) " admin "
Output for 5.4.9
Encrypted: string(44) "EEbPSCPKC+88+Md9L56JKCenchi6Nn9VBgda2qxt91o=" Decrypted: string(7) " admin "
Output for 5.4.8
Encrypted: string(44) "DabZCkZ7kAHL2a7YT5nApayBRR4M0uvBlqfJ0cnddW0=" Decrypted: string(7) " admin "
Output for 5.4.7
Encrypted: string(44) "Wo233Syuan3leDgIw6QnFMUBH2T7UTcVr/8ame2hFZ0=" Decrypted: string(7) " admin "
Output for 5.4.6
Encrypted: string(44) "drrqOrUAdZMQGfz4Ty5E4nS5gkJju6IBo7L0Tue3W6Y=" Decrypted: string(7) " admin "
Output for 5.4.5
Encrypted: string(44) "Nn53CzEZ1x4URPic4KGNTuPMK/l66wm0zp11n+YApGU=" Decrypted: string(7) " admin "
Output for 5.4.4
Encrypted: string(44) "dUL/oxWBi3yAMlGXivvFaHsrFTxT0DcZn8mPgrRAq4w=" Decrypted: string(7) " admin "
Output for 5.4.3
Encrypted: string(44) "P5vm/CpFS+jG9M5qf+yDumkJrC+jU8p577iy4PiFLQA=" Decrypted: string(7) " admin "
Output for 5.4.2
Encrypted: string(44) "RQMKTV9fTIBcYjV/ibLxRJtV2J7FxDbPxysO1gkeNII=" Decrypted: string(7) " admin "
Output for 5.4.1
Encrypted: string(44) "zqbBa7sJjjnMswkpvquXo7sFKn3KhgVD/cor9mxG2aU=" Decrypted: string(7) " admin "
Output for 5.4.0
Encrypted: string(44) "i8siZ7rvyZo+fJEV6/E/qO5AbbTKoY0Qzmn/ypO4Q04=" Decrypted: string(7) " admin "