3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $key = 'ABXDEF'; $string = '00:00:00:00:00:00'; // 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/j7v4L:8 Stack trace: #0 {main} thrown in /in/j7v4L on line 8
Process exited with code 255.
Output for 7.0.5
Encrypted: string(64) "5NTfROmARvuOhm4Fu82l8hidrqUZLXo7xHaWNPkbznKZ8S6zp+snDpt3suuw1fTJ" Decrypted: string(17) "00:00:00:00:00:00"
Output for 7.0.4
Encrypted: string(64) "Cuw5l7saMttTevC3cJBUcwkp1s1e11oeeY8d+vKudw1qwEEv1tF+Y0GgUKejFVDe" Decrypted: string(17) "00:00:00:00:00:00"
Output for 7.0.3
Encrypted: string(64) "w2q+WmbMF4jP4WIWakF/0IQGC+8SBeDth0quOyVwMSnotMlyyYzsqY8Jvyvv+2Vy" Decrypted: string(17) "00:00:00:00:00:00"
Output for 7.0.2
Encrypted: string(64) "cjQYi5VPvsv31N7WJrhyEzT4KYCF1wT9TxjZeEqd2lwhtDFnO8GIVpJ0YtQh6RRt" Decrypted: string(17) "00:00:00:00:00:00"
Output for 7.0.1
Encrypted: string(64) "IfQZVMRWjcc4kbWcfFOdk5CjzpDl1oLIK4jkB4ONG6qkkdBDdoHDusNelUNHP1NU" Decrypted: string(17) "00:00:00:00:00:00"
Output for 7.0.0
Encrypted: string(64) "j3n3o48wpnl052sZIR90Os4UWWAUTAz3qwJD4bLj5UhqO0cB/eC+Lgd5hZKz/3fA" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.3.18 - 5.3.29, 5.5.35, 5.6.21 - 5.6.28
Fatal error: Call to undefined function mcrypt_create_iv() in /in/j7v4L on line 8
Process exited with code 255.
Output for 5.6.20
Encrypted: string(64) "9OuG/0Qqt5s9/axyVK7zOpBbNBnXrF0wRzpmttBOUjh88Sz2Pcqs21BMaocVANUv" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.6.19
Encrypted: string(64) "CA9jNAfIqqKNvCs8iuVq6QSs70NoLJuIwmJaHwajpjBFFcAaPo016K3FoiB+QAtH" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.6.18
Encrypted: string(64) "kUT3KT6E80L5iOFgN6jOALkp45wPfWZYdUVnTCrPMMlowJQwq1UycB3HYTM8F90R" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.6.17
Encrypted: string(64) "lkf+trTzX+ZMYJg8JAZVXNwbmtbUx2J2odJ/x+3zZEMtzFAT2+6enGUue7/IN7wi" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.6.16
Encrypted: string(64) "pzGn20BzddGC0uTHRqFPqvVu/srO12S2ij7Du3cRpgAaW9+wea8fp0ZfYcQdoZFo" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.6.15
Encrypted: string(64) "whI7BiZwYwpQD17D/lnpF4Dud6u2u9GgGICKLFnnF80bN9d/OOoyunLrmdwrzrsJ" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.6.14
Encrypted: string(64) "t/3qAKnZ0opmtiLkU1JGVrZZvtKH3RSWxWgw+rBOZjx8n4qxyOaxUdf/71RBuuX8" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.6.13
Encrypted: string(64) "CEyq2iTtK1OdEi9swoXGWMcXkRyCtaz2uRI/hjQBzI5KUsBTH29cJm5K0lEbTot9" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.6.12
Encrypted: string(64) "ALikC/G2YQV1NJU+0/qOb9VE0TQ6688wbCbC3s5xZ97A+ptM6qaJZjKL/zvnWk9Y" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.6.11
Encrypted: string(64) "ald/5VPxBxRVK34ytqaWvmKS1FrrbPMmUbFFURVM+5Y7J0vScggmSxo4n51O7gC1" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.6.10
Encrypted: string(64) "UZ3SOaUhDj6TCqciTPPVm2kJTmpGWOA+wK/JkTbnWYBYKkscQaBMh9o1WI4HuMgM" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.6.9
Encrypted: string(64) "I9nCg6G5M+BqU7x4soJ/LuQtuNm+tmQ6zEObFn9Cjw12sYOdVen15r13sHctF5CM" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.6.8
Encrypted: string(64) "mLryo9PztDsy9sE4AMLpkYQ/oxm2BGkfdL+tpqu60r4VfEHTM0m+fY/h98C65+h/" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.5.34
Encrypted: string(64) "peikoDcJgmgc5IOLLMXP+d4HfISjjeDNOFZ/WWMF2B5czF/3Eg2TrE96ayw7kJS/" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.5.33
Encrypted: string(64) "mwyYGBVcdK28IMVFPI9S+3UD+I0cIOhe7aInPftCqVh4bS+Uqvaca/cgg4PaLEtx" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.5.32
Encrypted: string(64) "eupEmr/NFBPOcEZNHWgtAC865Egf2dvK6WBb2zB4+/joSmaIHefm2bkB+79Esqbv" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.5.31
Encrypted: string(64) "edGqt6Ge2/AwccvD3i8gI/cbYkyd/swwdnkYjg8YI1CEp/lxwyG68Jg6da8wVpj6" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.5.30
Encrypted: string(64) "lVkr6vZFp4+e/hc6hhhGqv07pe8nrtK9W0NT1e72ZnX5WzUQVBNCYZW9LyztYpTW" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.5.29
Encrypted: string(64) "2z8BCYSdsifGq/dASJFbqAP+9S7D/dacd6/HGUQ9YNPC98jSlU9Qz9EmGtAIKCeQ" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.5.28
Encrypted: string(64) "MGkYA+a8jeDIkcJ2cs0YN2zR4pqShCP4vQamaxQzTfLZZ5ts/v+ieOExN9O8wLFa" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.5.27
Encrypted: string(64) "aEHN+rvZt7Hp3sZq5GEB9k8V1oh3maqg1BOG3eGl7RWJwxrKwDxi6+dD7ZhD866j" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.5.26
Encrypted: string(64) "5cJcuS2lCySXA0nDBbgd1vXlgnucUuGXzliVKT6ZCILh1gaufnT5LbCAq1y79qOD" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.5.25
Encrypted: string(64) "pAm7/9gHW5tdJfCp0Bd7UvON3wZqBQ9c6tsa/STAkhwx/DxOTkOSXT9tUNOU+ujR" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.5.24
Encrypted: string(64) "QQOdIv6Mg030hRZvhn3VmTWXIkZiDERJwteLoBag+kIopP/b0G91KiBam+Y2oKVx" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.45
Encrypted: string(64) "DRbmozQcS1BFpgLhYFdISua6wYBuQwAnajQg95ht8wDYIgzToGEnQoPaE6oZ+c0g" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.44
Encrypted: string(64) "KQ0zqwOmu17P2wyJ+Uy4GG/A/YyG2NqX5VfKAuC2bQiT6pATjQNRWosyGfhoCSn5" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.43
Encrypted: string(64) "zbfkUk4CjrmMZ4Z0q1zam/KbhnLXb6FRpmy0jhBqeBjCBAW12Vy+TCWHJ/XaU8CR" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.42
Encrypted: string(64) "TQWgU0JIXHhkydX9qyjhmmXAqPFUkLlnZccxA+m60nFb+o1/YoTbzb9KXHAYh9FE" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.41
Encrypted: string(64) "/8q3wZJ4q1/tFfzy9C/Gm/mjeWvRGPa7JEYpDhi/R7rxB7+E2hguJlN6PEsPNt82" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.40
Encrypted: string(64) "RXyYhtNSPpfAyhFVCINjW3DQhcSkB9H5TMRI9vPswNxW4/boor7Iowh4G7nacLIS" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.39
Encrypted: string(64) "Vj3pHHjtQJcHlEkz2P2ICVN9z9+Z3Px1Z7ywKEk+NH3rAbwkFD9YVb1eZZBpBh8T" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.38
Encrypted: string(64) "Scy7RESdum5r4ZU12pbiW8nM0TRe7KHi8oVigK3kMXMo4APxvOfMcVTpMGNTeEKe" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.37
Encrypted: string(64) "q6BrDb23r4SWxpVAKB4d5qVup7giv1xJCvDWJqwzMmTIlckjFYDuaAWkA/bHq9zo" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.36
Encrypted: string(64) "YntarweFlXxabYRx2ABbHd+mQHMvT6+V5auoEodcGGFEt6f/OWzJbBlUqEV+vT5+" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.35
Encrypted: string(64) "qIJHOqM+LhsMSRhMKnrJBsLbWpErTjgv2HYT+tLfrP+8whdNXALjUZ5oFq6dsKq9" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.34
Encrypted: string(64) "MS7leMkGHohYD3TjsfOGEjiLZr1CRtVP09jpwqVW8dw+k3d+tSA357TZK+1UVmO5" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.32
Encrypted: string(64) "U5yWbSOf3JyEKfcCzK8vSGxvlVXs2j6r5CvZQnY093gtAbl2G0Sr5/7AHYmA34CH" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.31
Encrypted: string(64) "l0hPD4F9SA7Qe1Rpb/rORTNvA74Ss2W1lHJOWCVNDcSwHJbyimUw519dX348mD+l" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.30
Encrypted: string(64) "gLKzN91A1ElVzyd99Vf48qIMjNEnyucMrRPYyMFryuIp8C5B4aV8jOi9VEmZSXPf" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.29
Encrypted: string(64) "/lRovxqowvgHKhK/zPr4RkpA++XTboTab8gkZDjjmiR6JzmaY8gnPaA8vdfT8sfh" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.28
Encrypted: string(64) "/5vafxpu69HDRIrv3xRy92QW1+RqxIFitgXDXnP1ZTqOgfY4VAvbSzK86JlJATkR" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.27
Encrypted: string(64) "Qz2GO+5wrwDjmqpxg8vSKnFLrtViGCyadV0pg64lerhyoEY7undM0GZUobn3gLYC" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.26
Encrypted: string(64) "Cg3hxX2xkQ5VdZ9vL+eiQRNCKsYLXs3vQsJhSJSta0l7+RIlYM7MEdB+dBfM7V2J" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.25
Encrypted: string(64) "F+Lx43JbxY2iy/+j3hs47cjUiCoU6t9apfeRGoRnz8LOjJ1bAd4N48lsl0jjQ+om" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.24
Encrypted: string(64) "JCRxcN1iTCTDaycTc4eYJNxkr5k/qn+vqGsjcb/aigvDDluexn88otG/h6+qFW4n" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.23
Encrypted: string(64) "JQMmuybINYHdOmoWntSSxzcp7aWiwFJmD3xQdZ8HYA5jDon3Btb6towM5mviStGx" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.22
Encrypted: string(64) "Erf9VapX3fnhHPtyc8kcJl81jl6i+/nlRXOrhYf3s6qWnAva5KciuZlGD+zeshej" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.21
Encrypted: string(64) "S1tloJprXRDViexin4cBvnPUAj2/qMar5Q4ZSbGr70qM/ue6LndyPjz/zSRSfu2N" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.20
Encrypted: string(64) "79UWkNAeg2kAViOGA3bGxbRUrqudvNtL8R3gvkZJ66wS/RYNcBq2LdOtTGhBC36/" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.19
Encrypted: string(64) "GkkmLgKWSlr9VeGoOWsSW/4nwPxc0EUBQ+qiTQW8TMMN8tto/ieqhjs8jpGgusu7" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.18
Encrypted: string(64) "9azGZnK4dVUbLHiwcRXH87e6wKc2oBayNU9BooeYDpwzSgrY2/88VV+jAU52m/yj" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.17
Encrypted: string(64) "+vKxBSOwrj7hCc/3rPB8QOdJJbhsL9EYdFIUBZavUJviK30+0ew4pP3wg6mq6rfd" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.16
Encrypted: string(64) "SywyypHBK6oFlp44jTwIy41jIjLOy7YjL3M+uqfbSXhhAwgm3yueUJM/CxyM4flP" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.15
Encrypted: string(64) "JBSg8OSqlY8wPVZhTPyA6hmIolyVgHGLd4X99JsC8Y51BSIoB4kK+FyxdiixR0iR" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.14
Encrypted: string(64) "GK8/IcMKUxkRZlr+33Xhinj+gk8GThPbboa69mLHJLwYAk9YQNNwD7qS1x0ixKOT" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.13
Encrypted: string(64) "84v8L6w90C+7IkTDxH+ASHEoL4CKF9pLas5AKxWA1w7EsDsLgNUT/+acqN7n45fU" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.12
Encrypted: string(64) "caJj2opdH7J0lwIblqAAEt/VY8hn8PvhHRQtd7G4siASoE8r3LTxYbVJMpkE5SjR" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.11
Encrypted: string(64) "Gkz7DEbA1oBZYJAc3DEk2sWeijhn29Da53/yo6gEgngeDtRc4YAANi7+/L8rifuu" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.10
Encrypted: string(64) "Ipq2anjgYb4M2JoW+tIPS0WjSZMbl5R02ppdF7BA2v+d/KKGh+KtFULj9S4u0e0o" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.9
Encrypted: string(64) "sdPY4OnsjF4qnARzkhJdr8hQLZKTKz+Kbc6r34xpVCtVTBjVCuFVIhDbDSlg3gBb" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.8
Encrypted: string(64) "u2ZDp4WHC7IdpgFV56GEGr7BcbbJMR5ibKZ9VjNgtnlLodSsbRdGd2+asW+pi9za" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.7
Encrypted: string(64) "BIY/+cVA2g9UXQLgQVlCUPoVbF4XCnWkEBQaP5tn5oE1NIeEJFDkwS1oIfh59ord" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.6
Encrypted: string(64) "56Abe0j6h4huzYOyFa+Lpd47EmTDuxakLk1owoY5Wq9/ypWoQyMJCkKJNBdFpa2i" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.5
Encrypted: string(64) "btZ1vGgyicb6EflM4OBIwRLXpDbscuBf042rbQKPfW59Gz5/KgeeN2oVi905HUhp" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.4
Encrypted: string(64) "IRX8dhOozGUqYNZSELyl6IGEPjfnQ8JdeltVZeHhBTauMm+KPOeixBFaPH8Ogwhs" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.3
Encrypted: string(64) "winwPt7ZusWBIxt/JycmpDTHvqu2DvjFvFMP3NE4QMwfgwk4f0e8sNQFnHOPSHFz" Decrypted: string(17) "00:00:00:00:00:00"
Output for 5.4.2
Encrypted: string(64) "uY74isNyQezBap0PtyLMQQsL/TTgfW/S1m57vcK/NWxe8eqYxQ7EWUTF9fXBmCtq" Decrypted: string(17) "00:00:00:00:00:00"