Skip to content

Instantly share code, notes, and snippets.

View cfmitrah's full-sized avatar
🤓
Looking for new projects

Saravanamuthu Aka CF Mitrah cfmitrah

🤓
Looking for new projects
View GitHub Profile
<cfscript>
/* ColdFusion 11 dropped the undocumented cfusion_encrypt & decrypt functions while Railo 4.2 still officially supports it.
This script will reestablish the built-in function. You can also use fusion_encrypt/decrypt (without the "c").
Based on 2005 blog post: http://www.barneyb.com/barneyblog/2005/10/28/cfusion_encryptcfusion_decrypt-udfs/ */
function fusion_binaryXOR(n1, n2){
n1 = formatBaseN(n1, 2);
n2 = formatBaseN(n2, 2);
return inputBaseN(replace(n1 + n2, 2, 0, "all"), 2);
}
function fusion_encrypt(string, key){