Does sqlcipher windows supports encryption for memory table?

Hello @rajendradewani

When you have a connection to a :memory: database, that means that specific database is ephemeral, and will not be written to disk. You are attaching a SQLCipher encrypted database with a key to the :memory: database. In order to access any of your data on the encrypted database, it must first be decrypted. When you create the in memory table and select all the data from then encrypted database, all the physical data must be decrypted. The first step in this process is to turn your password into a key using PBKDF2 which is a slow process by design. We don’t know whether your former database product is using key derivation, but if not this could easily account for a significant performance difference (key derivation can take up to a couple seconds depending on the device, but is usually less). From that point accessing the data from the memory database would not involve any further encryption. However, if you are comparing start to finish times for the load and query process, SQLCipher would appear slower because of the key derivation step - that is to say that your process of loading data into memory does not make the process faster (all the data still needs to be decrypted).

We would still recommend tracking down any performance issues with our suggestions here - PRAGMA cipher_profile; might be particularly helpful to find exactly where the slowdown is occuring. If you’d like additional support with this it would really be neccessary to see the exact code or have a reproducilbe test case; for that we would strongly suggest commercial support. Thanks!