Hi Nick,
I'm in the directory : /usr/local/opt/sqlcipher/bin and i execute sqlite3 !
Is it correct ?
I maked : brew link sqlcipher and i have a warning :
Sqlcipher is keg-only and must be linked with —force
Note that doing so can interfere with building software
De : Nick Parker <
npa...@zetetic.net<mailto:
npa...@zetetic.net>>
Date : jeudi 16 mai 2013 15:09
Hi Rogister,
You need to make sure that the sqlite3 command line shell you are invoking is the one installed from homebrew and not the system provided sqlite3 as it will not contain the sqlcipher_export function. Also, you need to run `brew link sqlcipher`. Finally, execute `which sqlite3` to identify the path of the executable as configured by your PATH environment variable, this should point to your homebrew install.
Nick Parker
De : Billy Gray <
wg...@zetetic.net<mailto:
wg...@zetetic.net><mailto:
wg...@zetetic.net<mailto:
wg...@zetetic.net>>>
Répondre à : "
sqlc...@googlegroups.com<mailto:
sqlc...@googlegroups.com><mailto:
sqlc...@googlegroups.com<mailto:
sqlc...@googlegroups.com>>" <
sqlc...@googlegroups.com<mailto:
sqlc...@googlegroups.com><mailto:
sqlc...@googlegroups.com<mailto:
sqlc...@googlegroups.com>>>
Date : mercredi 15 mai 2013 19:51
À : "
sqlc...@googlegroups.com<mailto:
sqlc...@googlegroups.com><mailto:
sqlc...@googlegroups.com<mailto:
sqlc...@googlegroups.com>>" <
sqlc...@googlegroups.com<mailto:
sqlc...@googlegroups.com><mailto:
sqlc...@googlegroups.com<mailto:
sqlc...@googlegroups.com>>>
Objet : Re: Error on iOS: file is encrypted or is not a database
Hi Ron,
I may have misunderstood you, but in case I didn't: you don't need to use the command line in order to call sqlcipher_export(), your software can do that as part of its initialization process, something like this would do the trick:
ATTACH DATABASE 'path_to_template.db' AS template;
SELECT sqlcipher_export('template');
Hope that helps!
Billy
On Wed, May 15, 2013 at 10:08 AM, Ron Cox <
firs...@gmail.com<mailto:
firs...@gmail.com><mailto:
firs...@gmail.com<mailto:
firs...@gmail.com>>> wrote:
Oh, okay. I guess I got off track because I misunderstood the instructions on
http://sqlcipher.net/ios-tutorial/.
"Telling SQLCipher to encrypt a database is as easy as opening a database and using the sqlite3_key function."
It appears I need to use the sqlcipher version of sqlite at the command line. I'll use sqlcipher_export() to created an encrypted version of the template database.
In order for me to use the sqlcipher version of sqlite at the command line so I can use sqlcipher_export(), it looks like I need to do a build in addition to what I did for iOS. Is that correct? I don't see that the iOS project creates an OS X executable as an artifact of the build process. The only info on building from source I've seen is on
http://sqlcipher.net/introduction/. Am I on the right track?
Ron
On Tuesday, May 14, 2013 11:14:22 PM UTC-5, Stephen Lombardo wrote:
Hi Ron,
I sounds like you are trying encrypt an existing standard SQLite database by calling sqlite3_key, but SQLCIpher doesn't work that way. Instead, you'd want to open your template database with no key, then attach a new encrypted database, and then export the data between the two using the sqlcipher_export convenience function. There are some good examples of the procedure here:
http://sqlcipher.net/sqlcipher-api/#sqlcipher_export
Once your data is exported to an encrypted database can call sqlite3_key as the first operation before using it.
Cheers,
Stephen
On Tue, May 14, 2013 at 7:51 PM, Ron Cox <
firs...@gmail.com<mailto:
firs...@gmail.com>> wrote:
I'm using the community edition of SQLCipher on an iPad project. I'm using iOS 6.1, Xcode 4.6.2, openssl-1.0.1e, SQLCipher version 3.7.14.1.
My app communicates with a server. It downloads a bunch of records, the user edits the records, and then each modified record is sent back to the server for processing. Because the app has to still work when there is no internet connection, I have a SQLite database file I use to store the data locally. When the user first starts a "work session" I copy the (unencrypted) db file from the app resources to the documents directory. So... it's an existing db file that has tables and indexes and so forth in it, but initially has no data.
I have an #ifdef that allows me to turn the encryption off or on at compile time. With encryption off, everything works fine. With encryption on, opening the db and calling sqlite3_key works fine, but everything after that returns the error "file is encrypted or is not a database."
To troubleshoot this, I used the following code from the tutorial.
In the following code, the sqlite3_key call returns 0, which I understand indicates success. However, the sqlite3_exec does not execute successfully.
sqlite3 *db;
if (sqlite3_open([self.datastorePathUTF8String], &db) == SQLITE_OK) {
const char* key = [@"BIGSecret"UTF8String];
sqlite3_key(db, key, strlen(key));
if (sqlite3_exec(db, (constchar*) "SELECT count(*) FROM sqlite_master;", NULL, NULL, NULL) == SQLITE_OK) {
DLog(@"password is correct, or, database has been initialized");
} else {
DLog(@"password is NOT correct, or, database has NOT been initialized");
}
sqlite3_close(db);
}
I have -DSQLITE_HAS_CODEC in the "Other C Flags" for both debug and release.
I'm stuck. Any help would be greatly appreciated.
Ron
--
---
You received this message because you are subscribed to the Google Groups "SQLCipher Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
sqlcipher+...@googlegroups.com<mailto:
sqlcipher%2B...@googlegroups.com>.
To unsubscribe from this group and stop receiving emails from it, send an email to
sqlcipher+...@googlegroups.com<mailto:
sqlcipher%2Bunsu...@googlegroups.com><mailto:
sqlcipher%2Bunsu...@googlegroups.com<mailto:
sqlcipher%252Buns...@googlegroups.com>>.
To unsubscribe from this group and stop receiving emails from it, send an email to
sqlcipher+...@googlegroups.com<mailto:
sqlcipher%2Bunsu...@googlegroups.com><mailto:
sqlcipher%2Bunsu...@googlegroups.com<mailto:
sqlcipher%252Buns...@googlegroups.com>>.
To unsubscribe from this group and stop receiving emails from it, send an email to
sqlcipher+...@googlegroups.com<mailto:
sqlcipher%2Bunsu...@googlegroups.com><mailto:
sqlcipher+...@googlegroups.com<mailto:
sqlcipher%2Bunsu...@googlegroups.com>>.