FileEncrypt (Encrypt File)

The FileEncrypt function is used to encrypt a file stored on the datalogger so that it cannot be read.

Syntax

FileEncrypt ( "Device:FileName" )

Remarks

FileEncrypt creates a binary encrypted file that is the same size as the original file. The encrypted file is decoded automatically at compile time if it is used in a CRBasic program. This function allow distribution of CRBasic files without exposing the source code.

FileEncrypt returns true if the file is successfully encrypted. If the file is already encrypted, is not found, or cannot be opened, the function returns false.

The contents of a variable can be encrypted (and subsequently decrypted) using the Encryption function.

NOTE: Ideally, file encryption is done by CRBasic's Save and Encrypt functionality (see File Menu for more information). If using a datalogger program to encrypt a file, a "run once" program should be created that encrypts the file and then stops execution. Putting FileEncrypt in a running program will slow down program execution time and possibly cause erratic behavior.

Parameter

"Device:FileName" (Name of File to be Encrypted)

A string, enclosed in quotes, that contains the name of the file to be encrypted. The Device on which the file is stored is specified as CPU, CRD (memory card), USR (user-defined drive), or USB (SC115)

Type: String