setSqlCipherKey

internal fun DatabaseConnection.setSqlCipherKey(key: String)

Keys a connection with key, see requireSqlCipherKey. On iOS, also keeps the first PLAINTEXT_HEADER_SIZE bytes of the database unencrypted.

iOS terminates a suspended app that holds a lock on a file in a shared (App Group) container, unless it recognizes the file by its header as a SQLite database in WAL mode. SQLCipher encrypts that header, where it otherwise keeps the salt, so the header stays readable and the salt comes with the key. Both have to be set on every connection before it reads the database: https://www.zetetic.net/sqlcipher/sqlcipher-api/#cipher_plaintext_header_size