Encr_DecryptAES (function reference)

By February 1, 2019 February 12th, 2019 Online Help, Troi Encryptor Plug-in
Troi Encryptor Plug-in for FileMaker Pro


Decrypts text using the AES algorithm and the password.

SyntaxFunction badge

Encr_DecryptAES ( switches ; password ; text )


switchesmodifies the behavior of the function
passwordthe password to use
textthe text to decrypt


-OpenSSLCompatibledecrypt OpenSSL encrypted data
-KeySize=256tells the plug-in a 256 bit key was used during encryption (for OpenSSL)
-HashIterationCount=nspecify the hash iteration count used to generate the key and initialization vector (for OpenSSL)
-DontInterpretAsUTF8don’t interpret the text as UTF-8 (for OpenSSL)

Returned Result

Data type returned



the decrypted text or container data or an error code.

Returned error codes can be:

$$-4244no password was given

Originated in

Troi Encryptor Plug-in 1.2


FileMaker Pro 14 to 17


NOTE The Encr_DecryptAES function was called Encr_DecryptRijndaelAES in older versions of the plug-in.

– Be sure to remember the password (case sensitive!): without it you can not retrieve the original text.
– The result field should be the same type as the original field that was encrypted.
See Encr_EncryptAES for more technical information on the AES implementation.

About OpenSSL compatibility (introduced with Troi Encryptor 5.0):

When you use the -OpenSSLCompatible switch, the text to decrypt will be interpreted as formatted as OpenSSL compatible (Base64) text.

You can encrypt it for example with the OpenSSL functions of PHP 7. Specify the hash iteration count used to generate the key and initialization vector with the optional -HashIterationCount=n switch. Use for example -HashIterationCount=10000.

Note that the default for -OpenSSLCompatible is 1.
You can also decrypt encrypted text created by the openssl command in a command line interface (for example the macOS terminal). Use the switch -OpenSSLCompatible, but don’t use the -HashIterationCount=n switch as the openssl command uses the (default) iteration count of 1.

See the OpenSSL.fmp12 example in the download for more detailed information.


Encr_DecryptAES ( "-Unused" ; "mypassword" ; 
          </TROI_AES_STD_ENCR10>" )

This will gives this result:

Example 2

In a database you have defined a text field named “encryptedPatientData” which contains encrypted illness data. Then define a calculation field:

patientDataCalc    calculation   Unstored  = Encr_DecryptAES ( "-Unused" ; 
							gPasswordField ; patientData )

the calculation field will contain the decrypted text, but only if the password is correct.

Related functionsFunction badge


Related topics

Troi Encryptor Plug-in online help (overview)

Online Help Page for Troi Encryptor Plug-in for 14 to 17 –> Encr_DecryptAES (encrp4260) 2019-0212 17:49:27