Performs an encryption or decryption of the data field, depending on switches.
Encr_Code ( switches ; password ; data )
|switches||specify what (de)coding action to perform|
|password||the password to use|
|data||the text (or container) to perform the action on|
Switches can be:
|-EncryptDES||encrypt using the newDES algorithm (and the password)|
|-DecryptDES||decrypt using the newDES algorithm (and the password)|
|-EncryptAES||encrypt using the (more secure) AES algorithm (and the password)|
|-DecryptAES||decrypt using the (more secure) AES algorithm (and the password)|
You can still use these two alternative names for the AES algorithm:
|-EncryptRijndaelAES||encrypt using the (more secure) AES algorithm (and the password)|
|-DecryptRijndaelAES||decrypt using the (more secure) AES algorithm (and the password)|
You can also use
|-DecodeSafeAsciiDecryptDESDecompress||first decode from SafeAscii, then decryptDES and then decompress|
For AES encryption you can also add one or more of these switches to retrieve extra information:
|-AddIntializationVectorInfo||add the used Intialization Vector at the end of the result (need not be kept secret)|
|-AddSaltInfo||add the used Salt at the end of the result (need not be kept secret)|
|-AddKeyInfo||add the derived Key (derived from the password) at the end of the result (keep secret!)|
|-OpenSSLCompatible||format as OpenSSL compatible result|
|-HashIterationCount=x||specify the hash iteration count used to generate the key and IV (for OpenSSL)|
Other switches are not (yet) possible.
Data type returned
the coded text. This can be encrypted text or decrypted text.
Troi Encryptor Plug-in 1.5
FileMaker Pro 16 to 19
– You can use this function to encrypt and decrypt without a script.
– For good security make sure the password is at least 10 characters long. Also be aware that the password is case sensitive.
– (Rijndael) AES is a more secure algorithm than unsecure NewDES.
See Encr_EncryptAES for more technical information on the AES implementation.
Version 7.0 added the -EncryptAES and -DecryptAES switches. These alternative switch names will encrypt and decrypt the data using the AES algorithm.
Version 2.5.2 added the switch “-DecodeSafeAsciiDecryptDESDecompress”. This will perform three actions in succession: first decode from SafeAscii, then decrypt the intermediate result (using decryptDES) and finally decompress it.
About OpenSSL compatibility (introduced with Troi Encryptor 5.0): see the Encr_EncryptAES and Encr_DecryptAES function for more information.
Set Field [ secretField ; Encr_Code ( "-EncryptDES" ; gEncryptionPassword ; textField ) ]
Set Field [ result ; Encr_Code ( "-DecryptDES" ; gDecryptionPassword ; secretField ) ]
gDecryptionPassword = a global text field where the user can type in the password that will be used to generate a key for the encryption or decryption.
Set Field [ secretField ; Encr_Code ( "-EncryptAES -AddSaltInfo" ; gEncryptionPassword ; textField ) ]
this will result in:
Used in example file