BE_CipherEncrypt ( cipher ; data ; key ; iv {; padding ; fileNameWithExtension } )


Encrypt data using cipher.


Version : 4.0


Parameters :

cipher : The cipher name to use. If the value is empty, "AES-256-CBC" will be used.
data : The data to encrypt. It can be HEX encoded text or container field.
key : The key to encrypt with. It can be HEX encoded text or container field.
iv : The IV (initialization vector). It can be HEX encoded text or container field.
padding (optional) : Set false to disable padding. Padding is enabled if the parameter is true, empty or not specified.
fileNameWithExtension (optional) : The filename and extension for the encrypted data.


Notes : Be careful, there is no undo.  Modes that require authenticated encryption (e.g. GCM) are not supported. These ciphers return 'authentication tag' in addition to encrypted data.
The max data length is limited to 2GB.

The code uses OpenSSL for it's base library, so the list of ciphers and their details are here :

Not all possible ciphers will work, and thorough testing on Encryption and Decryption should be done before putting code into production.


Result : Container content if fileNameWithExtension is specified. Otherwise, HEX encoded text.

Example :

BE_CipherEncrypt ( "aes-256-cbc" ; HexEncode ( "Plain text" ) ; "603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4" ; "000102030405060708090a0b0c0d0e0f" )


Have more questions? Submit a request


Please sign in to leave a comment.