TLiteUtils.EncryptDatabase Examples
TLiteUtils.EncryptDatabase Examples
Where can I find examples on how to use TLiteUtils.EncryptDatabase method? There is no examples in the documentation.
Re: TLiteUtils.EncryptDatabase Examples
Hello,
The TLiteUtils.EncryptDatabase method allows database encryption or modifying of an existent password.
The following example shows how to encrypt an existing database:
To change the encryption key in the encrypted database, you must perform the following:
The TLiteUtils.EncryptDatabase method allows database encryption or modifying of an existent password.
The following example shows how to encrypt an existing database:
Code: Select all
UniConnection1.ProviderName := 'SQLite';
UniConnection1.Database := 'C:\sqlite.db3'; // the name of the database to be encrypted
UniConnection1.SpecificOptions.Values['Direct'] := 'True';
UniConnection1.SpecificOptions.Values['EncryptionAlgorithm'] := 'laBlowfish';// the database will be encrypted with the Blowfish encryption algorithm
UniConnection1.SpecificOptions.Values['EncryptionKey'] := ''; // no encryption key specified, because the database is not encrypted yet
UniConnection1.Open; // connect to the database
TLiteUtils.EncryptDatabase(UniConnection1, '11111'); // encrypt the database using the "11111" encryption keyCode: Select all
UniConnection1.ProviderName := 'SQLite';
UniConnection1.Database : = 'C:\sqlite_encoded.db3'; // the name of the database to connect to
UniConnection1.SpecificOptions.Values['Direct'] := 'True';
UniConnection1.SpecificOptions.Values['EncryptionAlgorithm'] := 'laBlowfish'; // the encryption algorithm of the database
UniConnection1.SpecificOptions.Values['EncryptionKey'] := '11111'; // the encryption key for the database
UniConnection1.Open; // connect to the database
TLiteUtils.EncryptDatabase(UniConnection1, '22222'); // change the database encryption key to '22222'Re: TLiteUtils.EncryptDatabase Examples
Thank you Devart Support Team!