Encrypts binary data using a specific algorithm and encoding method.
encryptBinary(binaryData, key [, algorithm [, encoding] [, iv | salt [, iterations]]])
→ returns binary
CFMX_COMPAT algorithm, any combination of any number of characters; used as a seed used to generate a 32-bit encryption key.GenerateSecretKey function to generate the key.
CFMX_COMPATCFMX_COMPATAESBLOWFISHDESDESEDEDESXRC2RC4RC5PBEAES/GCM/NoPaddingsalt.algorithm parameter.
iv.algorithm parameter.
0algorithm parameter with a Password Based Encryption (PBE) algorithm.salt parameter. Do not specify this parameter for Block Encryption Algorithms.Encrypts binary data with a generated AES key and decrypts it again with the same key.
key = generateSecretKey( "AES" );
data = charsetDecode( "Hello World", "utf-8" );
encrypted = encryptBinary( data, key, "AES" );
decrypted = decryptBinary( encrypted, key, "AES" );
writeOutput( charsetEncode( decrypted, "utf-8" ) );
Expected Result: Hello World
Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.