Encrypting a file
The following code is used to encrypt a file. The password is entered in an edit control (EDT_Password). Priority is given to the encryption security (cryptSecure
constant). The file may contain non-printable characters (False
// Declare the variables
FileToEncrypt is string
EncryptedFile is string
ResEncrypt is boolean
// Select the file to encrypt
FileToEncrypt = "C:\MyDirectories\File.txt"
// Select the encrypted file
EncryptedFile = "C:\MyDirectories\EncryptedFile.txt"
// Encrypt the file
ResEncrypt = fEncrypt(FileToEncrypt, EncryptedFile, EDT_Password, cryptSecure, False)
// Display an error message if the encryption failed
IF ResEncrypt = False THEN
Info("The file was encrypted")