# SQLCipher with qt6 hangs on queries against encrypted database

**URL:** <https://discuss.zetetic.net/t/sqlcipher-with-qt6-hangs-on-queries-against-encrypted-database/5885>\
**Category:** SQLCipher\
**Created:** [April 25, 2023, 12:13pm UTC](https://discuss.zetetic.net/t/sqlcipher-with-qt6-hangs-on-queries-against-encrypted-database/5885 "2023-04-25T12:13:03Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![sjlombardo](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/sjlombardo/32/3_2.png) [@sjlombardo](https://discuss.zetetic.net/u/sjlombardo)\
**Post date:** [April 26, 2023, 3:29pm UTC](https://discuss.zetetic.net/t/sqlcipher-with-qt6-hangs-on-queries-against-encrypted-database/5885/2 "2023-04-26T15:29:08Z")

</div>

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

> **[SQLCipher Design - Security Approach and Features](https://www.zetetic.net/sqlcipher/design/)**

> [@SQLCipher Performance Optimization](https://discuss.zetetic.net/t/sqlcipher-performance-optimization/14):
>
> Optimization Guidelines The latest guidance has been moved to the [SQLCipher Performance Optimization](https://www.zetetic.net/sqlcipher/performance/) documentation. This topic has been archived to preserve discussion.

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](https://www.zetetic.net/sqlcipher/sqlcipher-api/#PRAGMA_key) or [adjust the number of iterations](https://www.zetetic.net/sqlcipher/sqlcipher-api/#kdf_iter) to speed things up but note that both these settings have security implications.

---

_[View the full topic](https://discuss.zetetic.net/t/sqlcipher-with-qt6-hangs-on-queries-against-encrypted-database/5885)._
