How can i implement SQLCipher encryption - decryption for already created physically SQLite database with added populated row, also able alterable this database via coding in iOS?

I follow instruction https://www.zetetic.net/sqlcipher/sqlcipher-binaries-ios-and-osx/

It work fine when i create SQLite database via coding
But i have already created physically SQLite database & this db put into project,

This physically SQLite database have some data, Than add some table & data in this database using coding.

I need this SQLite database encrypt (which already created physically & data populated)

I many times try to encrypt this database using SQLCipher
But when i copy physically SQLite database (from xcode bundle) to iPhone app document directory

So, always log shows ““Incorrect password”” & than add table or data it crash and not able to add any data in this database.

Hello @Harsh_Mehta

Are you building SQLCipher yourself? Within your application you will need to include -DSQLITE_HAS_CODEC within your CFLAGS in order to have access to the keying API.

Hi,
I follow instruction https://www.zetetic.net/sqlcipher/sqlcipher-binaries-ios-and-osx/

It work fine when i create SQLite database via coding
But i have already created physically SQLite database & this db put into project,

This physically SQLite database have some data, Than add some table & data in this database using coding.

I need this SQLite database encrypt (which already created physically & data populated)

I many times try to encrypt this database using SQLCipher
But when i copy physically SQLite database (from xcode bundle) to iPhone app document directory

So, always log shows “Incorrect password” & than add table or data it crash and not able to add any data in this database.

How can i implement SQLCipher encryption - decryption for already created physically SQLite database & data populated, also alterable this database via coding ?

Thnx in advance for your help.
:grinning:

See screen shot :

Hi,
I follow instruction https://www.zetetic.net/sqlcipher/sqlcipher-binaries-ios-and-osx/

It work fine when i create SQLite database via coding
But i have already created physically SQLite database & this db put into project,

This physically SQLite database have some data, Than add some table & data in this database using coding.

I need this SQLite database encrypt (which already created physically & data populated)

I many times try to encrypt this database using SQLCipher
But when i copy physically SQLite database (from xcode bundle) to iPhone app document directory

So, always log shows “Incorrect password” & than add table or data it crash and not able to add any data in this database.

How can i implement SQLCipher encryption - decryption for already created physically SQLite database & data populated, also alterable this database via coding ?

Thnx in advance for your help.
:grinning:

See screen shot :

Just to close out this thread, SQLCipher does not rewrite standard SQLite databases with encryption using sqlite3_key. It is necessary for the application to use an attached database to copy data between standard and non-encrypted databases (e.g. with the sqlcipher_export() function). Please see this related post for more details: