<?php
$tempToken = "0d3ea4b5-dac3-4bbe-a3e9-1a162593eb3f506d2b43-0580-4ec1-aa6f-979b9b1237d4";
$clearText = "AuthToken=0d3ea4b5-dac3-4bbe-a3e9-1a162593eb3f506d2b43-0580-4ec1-aa6f-979b9b1237d4&PayerId=3254183124469122&PaymentProcessType=CreditCard&ProcessMethod=None&PaymentMethodStorageOption=None&ReturnURL=https://il01addproc.propay.com:443/Return.aspx";
// $tempToken = "1f25d31c-e8fe-4d68-be73-f7b439bfa0a329e90de6-4e93-4374-8633-22cef77467f5";
// $clearText = "AuthToken=1f25d31c-e8fe-4d68-be73-f7b439bfa0a329e90de6-4e93-4374-8633-22cef77467f5&PayerID=2833955147881261&Amount=10.00&CurrencyCode=USD&ProcessMethod=Capture&PaymentMethodStorageOption=None&InvoiceNumber=Invoice123&Comment1=comment1&Comment2=comment2&echo=echotest&ReturnURL=https://il01addproc.propay.com:443/Return.aspx&ProfileId=3351&PaymentProcessType=CreditCard&StandardEntryClassCode=&DisplayMessage=True&Protected=False";
// Encode the TempToken string in UTF-8
$encodedTempToken = utf8_encode($tempToken);
// Get the MD5 hash of $encodedTempToken in raw binary format with a length of 16
$md5Hash = md5($encodedTempToken, TRUE);
// Encode the name value string in UTF-8
$encodedNameValueString = utf8_encode($clearText);
echo strlen($encodedNameValueString) . "\n";
// Pad the name value string using pkcs5_pad
$blocksize = mcrypt_get_block_size('rijndael_128', 'cbc');
$pad = $blocksize - (strlen($encodedNameValueString) % $blocksize);
$encodedNameValueString = $encodedNameValueString . str_repeat("X", $pad);
echo strlen($encodedNameValueString) . "\n";
echo $encodedNameValueString;
echo "\n";
// Use AES-128 encryption to encrypt the name value string with the key and IV both being equal to the MD5 hash of $encodedTempToken
$aes128 = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $md5Hash, $encodedNameValueString, MCRYPT_MODE_CBC, $md5Hash);
echo $aes128;
echo "\n";
// Use Base64 encoding to send the resulting bytes of the encrypted name value string
$settingsCipher = base64_encode($aes128);
echo $settingsCipher;
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Function utf8_encode() is deprecated in /in/JIEsY on line 13
Deprecated: Function utf8_encode() is deprecated in /in/JIEsY on line 19
256
Fatal error: Uncaught Error: Call to undefined function mcrypt_get_block_size() in /in/JIEsY:24
Stack trace:
#0 {main}
thrown in /in/JIEsY on line 24
Process exited with code 255.
This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.