First Coldfusion Encrypt:
<cfset message = '1447841550'> <cfset key = 'Mk9m98IfEblmPfrpsawt7BmxObt98Jev'> <cfset ciphertext = Encrypt(#message#, #key#, "desede", "base64")> <cfoutput>#ciphertext#</cfoutput>
Then PHP mcrypt:
$message = "1447841550"; $key = 'Mk9m98IfEblmPfrpsawt7BmxObt98Jev'; $key = base64_decode($key); $bytes = array(0,0,0,0,0,0,0,0); //byte [] IV = {0, 0, 0, 0, 0, 0, 0, 0} $iv = implode(array_map("chr", $bytes)); $ciphertext = mcrypt_encrypt(MCRYPT_3DES, $key, $message, MCRYPT_MODE_CBC, $iv); echo base64_encode($ciphertext);
Problem.
On the same line, the same algorithm and the same encoding.
There is still a small part of the result that does not match.
The real output is shown below.
Why is Coldfusion distinguished by results?
How can I do the same results in Coldfusion provided I don't modify the PHP code. PHP output is the right conclusion for me.
Is it possible to get the correct result (PHP) using javascript? This solution is also good.
I'm sad.
Thanks in advanced