Table encryption must be enabled and configured at database creation time. You must re-create the database with table encryption enabled if your database does not have table encryption enabled, or if you have database encryption in effect.
Create a database using the CREATE DATABASE statement, but do not include key or algorithm settings.
The following command creates the database new.db with simple encryption enabled for tables:
CREATE DATABASE new.db ENCRYPTED TABLE;
Later, when you encrypt a table in this database, the simple encryption algorithm is used.
Create a database with the CREATE DATABASE statement, and specify a key and an encryption algorithm.
The following command creates the database new.db with strong encryption enabled for tables using the key abc, and the AES_FIPS encryption algorithm:
CREATE DATABASE new.db ENCRYPTED TABLE KEY abc ALGORITHM AES_FIPS;
Later, when you encrypt a table in this database, the AES_FIPS algorithm is used, as well as the key abc.
Create a database with the dbinit -et option, but do not include a key or encryption algorithm.
The following command creates the database new.db with simple encryption enabled for tables:
dbinit new.db -et
Later, when you encrypt a table in this database, the simple encryption algorithm is used.
Create a database with the dbinit -et and -ek options, and specifying a key and an encryption algorithm.
The following command creates the database new.db with strong encryption enabled for tables that use the key abc, and the AES_FIPS encryption algorithm:
dbinit new.db -et -ek abc -ea AES_FIPS
Later, when you encrypt a table in this database, the AES_FIPS algorithm is used, as well as the key abc.