Hello,
My initial thought is that SQLCipher is not properly integrated
somewhere within your project. As an experiment, could you run the
following command, it will return a single string that represents the
SQLCipher version:
PRAGMA cipher_version;
If you do not receive a result, there is likely a project configuration
issue at hand. Please let us know what it reports.
On 7/25/14 2:08 AM, Nico VZ wrote:
> Hi Nick,
>
> The database is already encrypted.
> I have tried two methods for encrypting and the database is succesfully
> encrypted in both ways (i have checked it with SQLiteManager, it asks
> for a password before opening)
> so we can presume it is encrypted correctly, but why doesn't FMDB open
> it when i use setKey?
>
> Op donderdag 24 juli 2014 09:21:07 UTC+2 schreef Nico VZ:
>
> Hi there,
>
> This week i purchased the sqlCypher for iOS.
> I got the library and setup a test project just for testing
> pusposes. (followed this tutorial:
>
http://sqlcipher.net/sqlcipher-binaries-ios-and-osx
> <
http://sqlcipher.net/sqlcipher-binaries-ios-and-osx>)
> FMDatabase*db =[FMDatabasedatabaseWithPath:dbPath];
> [db open];
> BOOL keyIsSet =[db setKey:@"testEncryptionKey"];
> if(keyIsSet){
> NSLog(@"Key seems to be correct for database:%@",dbPath);
> }
> else{
> NSLog(@"Key is incorrect.. ");
> }
>
> FMResultSet*rs =[db executeQuery:@"SELECT * FROM testtable"];
>
> if([rs next]){
> // do something with the data
> }
> [rs close];
> [db close];
> |
>
>
> First i thought there was something wrong with setting the
> encryption so i tried to set the encryption key with my
> SQLiteManager (
http://www.sqlabs.com/sqlitemanager.php
> <
http://www.sqlabs.com/sqlitemanager.php>) program. (see attached
> screenshot, seems to be correct right?)
> But that did not work also, still getting the error that says that
> the database file is not OK. The little check i built in my script
> above outputs that the key and path to the database is correct. but
> still the error message appears.
>
> What am i missing?
>