I wring a small routine to encrypt databases using the Unidac SQLite components.
Basically a utility to encrypt read only DB's as an when required.
1) Before attempting to encrypt a database - or even read from it - how does one determine if the database has already been encrypted before proceeding with encryption?
2) If a DB has already been encrypted, what happens if an attempt is made to encrypt the database a second time - given the same encryption method and password.
I assume nothing untoward but thought I should just check!
Lastly, just for my records, what characters can be used in an encryption password (Blowfish, AES etc)? Only 'Printing Characters', ASCII 0 - 127, or the extended ASCII 0 - 255?
Many thanks!
Tony
PS. Using the same code as per the Devart documentation.
How to confirm a DB has been encrypted - SQLite?
Re: How to confirm a DB has been encrypted - SQLite?
1. The structure of SQLite database file does not provide any indication that it would be possible to unambiguously determine whether the database is encrypted or not. However, you can specify this indirectly. It is enough to try to connect to the encrypted database using UniDAC, without specifying an encryption algorithm or password for TUniConnection. If you receive the message 'database disk image is malformed', you can assume that this database is encrypted.
2. You cannot encrypt the same SQLite database twice using UniDAC. After connecting to the encrypted database, you can either change the existing encryption key, or decrypt the database:
https://www.devart.com/unidac/docs/?dat ... yption.htm
3. You can use ASCII characters 0 - 255 when specifying an encryption key
2. You cannot encrypt the same SQLite database twice using UniDAC. After connecting to the encrypted database, you can either change the existing encryption key, or decrypt the database:
https://www.devart.com/unidac/docs/?dat ... yption.htm
3. You can use ASCII characters 0 - 255 when specifying an encryption key
Re: How to confirm a DB has been encrypted - SQLite?
Thank you for your swift reply.
Highly appreciated!
I should add that having this encryption facility for SQLite adds great value to the UNIDAC suite
Highly appreciated!
I should add that having this encryption facility for SQLite adds great value to the UNIDAC suite

Re: How to confirm a DB has been encrypted - SQLite?
Thank you for the feedback. We try to make our products functionality useful for solution of a wide range of issues. Contact us on any questions regarding our products work