Method CryptFile():encrypt() Professional

Encrypts a file.

Syntax
:encrypt(<cSourceFile>, <cTargetFile>) --> lSuccess 
Parameters
<cSourceFile>
The file name of the source file.
<cTargetFile>
The file name of the target file.
Return

If encryption was succesfull, .T. is returned. Otherwise .F. is returned, and the error code can be retrieved by calling FError().

Description

The method :encrypt() is used to encrypt a file. The target file includes a 32-byte header containing the file encryption type and version, the used file-i/o buffer length, the block size of the CryptProvider, and the size of the following data block. The header is not encrypted. The first data block is encrypted and contains the original file size, the key used for encryption in a hashed form, and the name of the source file. This information is used by :decrypt() to validate the correctness of the decryption.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.