<?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 =
$hash = base64_encode( hash_hmac($env['macMethod'], $token, $env['token'], true) );
$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));
preferences:
50.34 ms | 402 KiB | 5 Q