If I'm not mistaken, the default CFMX_COMPAT function is just XOR.
So, in PHP, it will be as simple as:
$password_encrypted = base64_encode($text ^ $key);
Hope this helps.
Edit:
I was curious, so I wrote a little script for testing, and this can be undone, here is the encryption / decryption.
<?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; ?>
source share