3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $env = array( 'token' => 'generickey', 'brand' => 'conversant360', 'macMethod' => 'sha256', 'expire' => '+30 minutes', 'primaryURL' => 'https://new.qualtrics.com/ControlPanel/ssoTest.php?ssotoken=%s', 'secondaryURL' => 'https://new.qualtrics.com/ControlPanel/ssoTest.php?ssotoken=%s', ); $token = "timestamp=2015-11-09T14:30:42&expiration=2015-11-09T14:30:42&id=a75f1ed5-dc40-e511-9990-005056bf0569&memberId=100353&firstName=John&lastName=Smith&email=john.smith@gmail.com&mac=54229f9a6d50f70454bb6c8331e4691bac2c809525b7481aa4f999e67eaa413d"; echo hash_hmac($env['macMethod'], $token, $env['token'], true); $hash = base64_encode( hash_hmac($env['macMethod'], $token, $env['token'], true) ); echo $hash; $token .= '&mac='.$hash; //encrypt the token $ivSize = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB); $iv = mcrypt_create_iv($ivSize, MCRYPT_RAND); echo base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $env['token'], $token, MCRYPT_MODE_ECB,$iv));
based on njjRe
Output for 7.0.6 - 7.2.0
H���a |ۧ�� �_#9����$��SBusA8fmgv1hDXwa26e0rQvnXyM5E7q/DpzcJJXwr5k= Fatal error: Uncaught Error: Call to undefined function mcrypt_get_iv_size() in /in/97H9S:16 Stack trace: #0 {main} thrown in /in/97H9S on line 16
Process exited with code 255.
Output for 5.6.7 - 5.6.20, 7.0.0 - 7.0.5
H���a |ۧ�� �_#9����$��SBusA8fmgv1hDXwa26e0rQvnXyM5E7q/DpzcJJXwr5k= Warning: mcrypt_encrypt(): Key of size 10 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported in /in/97H9S on line 18
Output for 5.3.19 - 5.3.29, 5.5.35, 5.6.21 - 5.6.28
H���a |ۧ�� �_#9����$��SBusA8fmgv1hDXwa26e0rQvnXyM5E7q/DpzcJJXwr5k= Fatal error: Call to undefined function mcrypt_get_iv_size() in /in/97H9S on line 16
Process exited with code 255.
Output for 5.4.0 - 5.5.34
H���a |ۧ�� �_#9����$��SBusA8fmgv1hDXwa26e0rQvnXyM5E7q/DpzcJJXwr5k=HiGSwQuHoziukaEXEIIBvjWNFvNgfYWoiPofZCseJraa3bRrem7Id0f7a5NK+C7E12+klmjZOIMX8rvZEU/H+tdvvuZFESi7LBDGG2akvSi7gsy72sNXfqLA/6hL6pyztws/LML3vVtLvAywa0haZSrIp6dQu8ppqha7e6Phlllpi7hDAL4UuaD5oN5njjQZhspIWTiM7F8jc8H+Aml4TsIOAMRFuavczoEU8b/5OjOe73N9Sn1u6NNB1b/EbJimhZAoo7DLZ/rjZXv8/w7pVk7nxJZ4WsOxGfsYT8jsw6htzuTi/1YMTCQd8bexF1rVXtXYoTyBDjm1vPKdla27c4lM7FURf/eW42UNp/mqekqRA6Fp4bowMi2PygZ4lkdD8CK1BYSx/k4GhkTe/fPo5w==