Encrypts text using a DES algorithm and the current crypt key. Specify a key first with the function Encr_SetCryptKey.
Encr_EncryptNewDES ( switches ; text )
|switches||reserved for future use, leave empty or set to "-Unused"|
|text||the text to encrypt|
Data type returned
the encrypted text
Troi Encryptor Plug-in 1.2
FileMaker Pro 15 to 19
– The NewDES algorithm is not considered safe anymore.
– AES is a more secure algorithm than NewDES. See the function Encr_EncryptAES.
– Be sure to remember the key (case sensitive!): without it you can not retrieve the original text.
Use Encr_Code to encrypt without the need for a script.
– The result field should be a text field. If you encrypt into a date or number field it won’t work as FileMaker wants to interpret is as a (date) number.
Compatibility with Troi Coding Plug-in:
For backward compatibility, passwords are still Mac ASCII encoded except for chars not in the Mac ASCII set, these chars are now UTF8 encoded before the key is derived. For example:
“japan_显示” becomes “japan_0xE698BEE7A4BA” as password
“españa” becomes “españa” as password
Text is converted to the FileMaker Pro 6 character set. For other characters the UNICODE value is converted to a numeral reference. This ensures that fields with data from older FileMaker 6 databases will have the same encryption. The numeral references look like: À which is the Greek small letter pi.
Set Field [ gErrorCode ; Encr_SetCryptKey ( "-Unused" ; "mySecret" ) ] If [ gErrorCode = 0 ] Set Field [ result ; Encr_EncryptNewDES ( "-Unused" ; "Hello World" ) ] Set Field [ gErrorCode ; Encr_SetCryptKey ( "-Unused" ; "different Key" ) ] End If
gives this result: “l’ùé—JtO<=! Û¡\}0Óÿ„]˘¿Cºdè≈ˇ”
In a database you have defined a text field named “patientData” which contains illness data. Then define a calculation field:
encryptedDataCalc calculation Unstored = Encr_EncryptNewDES ( "-Unused" ; patientData )
this field will contain the encrypted text.
TIP Use the Encr_EncodeSafeAscii function for sending data safely over internet.