UltraLite databases can be created with one of the following choices for data security: obfuscation or encryption. By default, UltraLite databases are created without any specific measures to obscure the data in the database. Utilities that examine the file which contains an UltraLite database and can display raw disk data could reveal character data stored in the database. The format of the actual database file is proprietary, but the contents are able to be viewed.
Obfuscation and encryption are creation-time configuration options. Although the actual encryption key can be changed, the choice to obfuscate or encrypt the data in the database cannot be changed without unloading the database, creating a new database, and reloading the data.
To create a database with encryption, you must specify the encryption key when the database is created.
To open a connection to an encrypted database, you use the ULConnectionParms.EncryptionKey property to supply the encryption key string used when the database was created.
For more information about the EncryptionKey property, see UltraLite DBKEY connection parameter.
You can change the encryption key by specifying a new encryption key on the Connection object. An application must first connect using the existing encryption key and then specify a new encryption key. In the following example, "apricot" is the new encryption key:
See ChangeEncryptionKey method.
After the database is encrypted, all connections to the database must specify the correct encryption key. Otherwise, the connection fails. If the encryption key is not known, the data in the database cannot be retrieved.
To obfuscate the database, set the obfuscation option when you create the database. Obfuscation is a simple masking of the contents of the database that is meant to prevent utility programs from revealing the raw contents of the database file. Databases created with obfuscation operate transparently to the user and the application program; there are no additional programming considerations.
For more information about database encryption, see UltraLite obfuscate property and UltraLite security considerations.