Copyright: Visual Help Copyright® 1993 Firas Bushnaq


File Encryption Component

Properties

Methods

Encrypt sensitive files with the file encryption component.  Just set the password property and call the CryptFile method.  To decrypt the file, call the CryptFile again with the same password.


Properties

Filename

Password

Retaindate


Filename Property

Description

This is the name of the file you wish to encrypt/decrpyt.  It should contain a fully qualified path as well as the file name.

Example:

FileCrypt1.Filename := 'c:\data\mybooks.dat';


Password Property

Description

This is the password you wish to use to encrypt or decrypt a file.  When a file is encrypted with a password, it can only be recovered by decrypting with the same password is was encrypted with.  The password is case sensitive.  If a password is lost or forgotten, there is no way to recover the file contents, so - BE WARNED !!!  If a file has already been encrypted, calling the CryptFile method with the same password will result in the file being decrypted to its original state.

Example:

Cryptfile1.filename := 'c:\data\mydata.dat';
Cryptfile1.password := 'MYPASSWORD';
Cryptfile1.CryptFile;   {file is encrypted}
Cryptfile1.CryptFile;   {file is decrypted}

See Also:

CryptFile Method


Retaindate Property

Description

Retaindate is a boolean property that indicates whether you want the encrypted file to retain the same date and time stamp as the original file.
The default value is false.

Example:

Cryptfile1.filename := 'c:\test.dat';
Cryptfile1.password := 'MYPASSWORD';
Cryptfile1.retaindate := true;  {retain original date and time}
Cryptfile1.Cryptfile;


Methods

CryptFile


CryptFile Method

Description

Once you have supplied the filename and password properties, call the Cryptfile method to encrypt the file.  Calling this method a second time with the same password decrypts the file.

Example:

Cryptfile1.filename := 'c:\data\mydata.dat';
Cryptfile1.password := 'MYPASSWORD';
Cryptfile1.CryptFile;   {file is encrypted}
Cryptfile1.CryptFile;   {file is decrypted}