Patent ID: 7904732

Claim:
A computer implemented method, comprising: providing encryption metadata for a database file in a computer readable storage device having fields, wherein the encryption metadata indicates at least one of: record level encryption information indicating a record level encryption key to use for all fields in records in the database file; and for each of a plurality of fields in the database file, field level encryption information indicating a field level encryption key and a field identifier identifying the field to which the field level encryption key applies; receiving a request to perform a read or write operation with respect to a record including the fields for the database file; determining from the encryption metadata whether record level or field level encryption is indicated; in response to determining that the encryption metadata indicates record level encryption, performing: determining from the record level encryption information in the encryption metadata the record level encryption key to use with respect to all fields; and using the determined record level encryption key to encrypt or decrypt for the read or write operation with respect to the fields in the database file; and in response to determining that the encryption metadata indicates field level encryption and not record level encryption, performing: for each field in the record, determining whether there is field level encryption information in the encryption metadata for the field having the field level encryption key to use with respect to the field; and using the determined field level encryption key for each field for which the field level encryption key is provided to encrypt or decrypt for the read or write operation with respect to the field.