How to unset encryption?

The sqlite3_rekey_v2 function allows to change the key used to encrypt the database. However, the documentation doesn’t quite explain what happens if the new key is empty or null. From what I read, a null pointer wouldn’t mean to decrypt the database and remove the password support.

Is there a way to achieve such a feature? Thanks!

Hello @phaazon - correct, rekey will not decrypt a database when passed a null or empty string. Instead, if you are looking to convert back and forth between encrypted to plaintext databases, then the sqlcipher_export() convenience function is the recommended approach.

1 Like