Encryption prevents users from accessing .dbf files directly. It works by changing the file so it is not recognizable as a .dbf file. Visual FoxPro cannot use the .dbf file again until it is decrypted. Following are some of the ways you can encrypt .dbf files in Visual FoxPro.
Using Visual FoxPro to encrypt .dbfs
If a .dbf file does not need to be modified, you can add it to your project list and not mark it for exclusion. When you build an encrypted .exe file, the .dbf data will be included in it. You do not need to physically copy the .dbf file to the subdirectory where the .exe file will be found. When you run the .exe file, the .dbf information can be accessed, but it cannot be changed. Decryption of the .dbf file is automatic when the .exe file is run.
Beginning in Visual FoxPro 7.0, you can use the Crypt.vcx Visual FoxPro Foundation Class to encrypt data. The cryptapi class that is located in the ...\Ffc\_Crypt.vcx foundation class library provides access to the Windows Crypto API routines so you can encrypt strings, data, or files in your Visual FoxPro Applications. For more information on the _Crypt.vcx and the _crytapi class, see search the Help file for "_Crypt.vcx."
Third-party products to encrypt .dbf files
Cryptor
Xitech, Inc.
The third-party products that this article discusses are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of these products.
Writing a program to encrypt .dbf files
Many Visual FoxPro reference books contain sample code for different methods of encrypting and decrypting database files.
For examples, see these books:
"FoxPro 2.0 Power Tools," Malcolm C. Rubel, pages 938-942, Bantam Books, 1991, ISBN 0-553-35294-6
"Tom Rettig's FoxPro Handbook," Tom Rettig, pages 622-625, Bantam Books, 1990, ISBN 0-553-34937-6
"FoxPro 2.5 Advanced Developer's Handbook", Pat Adams and Jordan Powell, pages 222-228, Brady Publishing, 1993, ISBN 0-13-325341-4