I'm not English speaker, sorry in advance.
I have a ColdFusion 6.1 application, and now I'm trying to migrate to another environment. In the ColdFusion application, the passwords of my users are crypted with a ColdFusion function:
password_encrypted=toBase64(encrypt(text,key));
Does anyone know how can I decrypt it in PHP? I don't know what the cypher algorithm used in CFMX 6.1 is. I think that the name of the algorithm is CFMX_COMPAT
, but I don't know if it has an equivalent in PHP.
Thanks!!!
If I'm not mistaken, the default CFMX_COMPAT function is simply a XOR.
So in PHP this would be as simple as:
$password_encrypted = base64_encode($text ^ $key);
Hope this helps.
Edit:
I was curious so I wrote a little script to test, and this might be reversed, here is the encrypt/decrypt.
<?php
$text = 'test';
$key = 'asdf';
$password_encrypted = base64_encode($key ^ $text);
echo $password_encrypted . "<br>\n";
$password_decrypted = base64_decode($password_encrypted) ^ $key;
echo $password_decrypted;
?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With