ENCRYPT.FILE

Top  Previous  Next

 

The ENCRYPT.FILE command sets the data encryption key for specific fields or the entire record.

 

 

Format

 

ENCRYPT.FILE filename field, keyname ...

ENCRYPT.FILE filename keyname

 

where

 

filenameis the name of the file to which encryption is to be applied.

 

fieldis the name or field number of the field to which encryption is to be applied.

 

keynameis the name of the encryption key to be used. This is case insensitive.

 

 

The first form of the ENCRYPT.FILE command sets the encryption key for one or more fields within a file that uses field level encryption. Encryption cannot be applied to a field that is used for an alternate key index.

 

The second form of the ENCRYPT.FILE command sets the encryption key for record level encryption. Alternate key indices can be defined in files that use record level encryption but, because the index itself is not encrypted, the indexed fields have reduced security.

 

If the file contains data records when this command is used, the file is processed to apply the encryption. A system failure or other process abort during this update will leave the file in a partially encrypted state and hence render it unusable. Always back up a file before using this command if the file contains data.

 

 

Examples

 

ENCRYPT.FILE CUSTOMERS CCARD,CARDNO

 

The above command encrypts the CCARD field of the CUSTOMERS file using the CARDNO encryption key.

 

 

ENCRYPT.FILE CUSTOMERS CKEY

 

The above command encrypts the CUSTOMERS file using the CKEY encryption key for record level encryption.

 

 

See also:

Data encryption, CREATE.FILE, CREATE.KEY, DELETE.KEY, GRANT.KEY, LIST.KEYS, RESET.MASTER.KEY, REVOKE.KEY, SET.ENCRYPTION.KEY.NAME