SQLCipher with qt6 hangs on queries against encrypted database

This is the result of key derivation. This occurs for the first operation that uses the database after it is opened. The key derivation is deliberately slow to provide protection against brute force and dictionary attacks. You can read more about it at the design page, and lean about optimization at the following two links

https://www.zetetic.net/sqlcipher/design/

The delay will be much more noticeable on older devices. Take a look at the performance optimization faq, and make sure you are reusing database connections to avoid multiple key derivations. Alternately, you can either use a RAW key to skip key derivation or adjust the number of iterations to speed things up but note that both these settings have security implications.

1 Like