19 The Paradox Driver : Password Protection

Password Protection
Paradox supports two types of passwords: master and auxiliary. The Paradox driver supports master passwords only and can manage a maximum of 50 passwords.
Paradox database files can be encrypted to provide limited access to users who do not know the password. The driver maintains a list of passwords for each connection. The driver can access only encrypted database files for which a password appears in this list. You can supply a password in three ways: by typing it in the Password dialog box (which appears when the driver does not have the password to open an encrypted database file), by including it in a connection string (with the Passwords attribute), or by using the Add Password statement.
Paradox provides five statements that manage passwords for Paradox database files. These statements are specific to the Paradox driver:
ENCRYPT filename USING PASSWORD password
ADD PASSWORD password
DECRYPT filename USING PASSWORD password
REMOVE PASSWORD password
REMOVE ALL PASSWORDS
filename can be a simple file name or a full path name. If a simple file name is given, the file must be in the directory specified with the Database connection string attribute. The .DB extension is not required.
password is a case-sensitive text string and its maximum length is 15 characters, including blanks. If your password includes lowercase letters or nonalphanumeric characters, enclose it in single quotation marks (').
Encrypting a Paradox Database File
The Encrypt statement associates a password with a database file. For example:
ENCRYPT emp USING PASSWORD test
Accessing an Encrypted Paradox Database File
To access an encrypted Paradox database file, add the password to the list of passwords Paradox maintains for that connection. To do so, you can:
n
ADD PASSWORD test
SELECT * FROM emp
n
If you do not add the password, the driver prompts you for it when you access the database file.
Decrypting a Paradox Database File
The Decrypt statement disassociates a password from a database file. You do not need to enter the password to open the database file. For example:
DECRYPT emp USING PASSWORD test
Removing a Password from Paradox
The Remove Password statement removes a password from the list Paradox maintains for the connection. For example:
REMOVE PASSWORD test
Removing All Passwords from Paradox
The Remove All Passwords statement removes the list of passwords Paradox maintains.
If you remove a password from Paradox and do not decrypt the database file, you must continue entering the password to open the database file.