sqlcipher

c++ 调用 sqlcipher

北城余情 提交于 2019-12-05 00:31:29
#include <iostream> #include <string.h> #include "sqlite3.h" using namespace std; static int callback(void *notUsed, int argc, char **argv, char **azColName) { for (int i = 0; i < argc; i++) cout << azColName[i] << ":" << (argv[i] ? argv[i] : "NULL") << "\t"; cout << endl; return 0; } void dbTest() { #pragma region 打开或创建数据库 /*打开或创建的数据库实例句柄*/ sqlite3 *db = NULL; /*数据库文件的路径及文件名*/ const char* path = "./sqlcipher.db"; /*根据文件路径打开数据库连接。如果数据库不存在,则创建。数据库文件的路径必须以C字符串传入*/ int result = sqlite3_open_v2(path, &db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_NOMUTEX | SQLITE_OPEN_SHAREDCACHE,

Attach Database for SQLCIPHER

不想你离开。 提交于 2019-12-04 21:27:46
I have had many problems getting my SQLITE database encrypted for my project and finally i'm trying to use the attach database method to encrypt my unencrypted database. I've tried running the attach command on Terminal, only to realise the output would be a unencrypted database. So by right i'm supposed to run the commands in my project, with my sqlcipher and ssl libraries imported right? So I tried it, the method runs without any faults, but i didn't even get the encrypted database to be created in the documents directory. What am I doing wrong? [Code Snippet Below] - (void)encryptDB { NSLog

“_sqlite3_key” Symbol(s) not found for architecture i386

瘦欲@ 提交于 2019-12-04 15:36:16
Hi I used this SQLCipher( http://sqlcipher.net/ios-tutorial/ ) to encrypt my sqlite but when I compile I met this error "_sqlite3_key", referenced from: -[LCAppDelegate application:didFinishLaunchingWithOptions:] in LCAppDelegate.o Symbol(s) not found for architecture i386 It happened when I used this code in my AppDelegate #import <sqlite3.h> ... NSString *databasePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent: @"sqlcipher.db"]; sqlite3 *db; if (sqlite3_open([databasePath UTF8String], &db) == SQLITE_OK)

Android Proguard SqlCipher NoClassDefFoundError

邮差的信 提交于 2019-12-04 09:04:10
Have been battling with Proguard all day and have tried many examples and solutions on the official Proguard site as well as StackOverflow. I have a large project I need to obfuscate, which has a number of referenced library projects and Jars. I am getting 725 warnings from proguard from 2 libs, com.google.common and twitter4j. I can happily get the project to compile if I add the following: -dontwarn com.google.common.** -dontwarn twitter4j.** However, the app crashes instantly on open, so this seems to just be a way of hiding an issue, not fixing it. The proguard-project.txt is in the

iOS Magical Record & SQLCipher

三世轮回 提交于 2019-12-03 14:23:54
I m using Magical Record for saving my data. This data needs encryption, so i m trying to combine it with SQLCipher library( http://sqlcipher.net/ios-tutorial/ ). I already setup SQLCipher and tested it with Core Data successfully, using EncryptedStore file from this example https://github.com/project-imas/encrypted-core-data : What i did was only changed NSPersistentStoreCoordinator like this: NSPersistentStoreCoordinator *coordinator = [EncryptedStore makeStore:[self managedObjectModel]:[SSKeychain passwordForService:myservice account:myaccount]]; So i think i need to change how

how to encrypt an database using sql cipher

时光怂恿深爱的人放手 提交于 2019-12-03 10:01:14
I want to encrypt an database using sqlcipher. I have done with the integration os openssl and sqlcipher integration and the build works perfect. But my issue is I am not able to encrypt my database. I don't know how to perform that activity or method to encrypt a database using sql cipher. I read on the SQL Cipher but I am not able to understand the same process. I tried the code that is provided by them but not working . EDIT: Can any one tell my how to set PRAGMA key for the same and then how to start with the encryption ? As only this part is remain for my encryption to get completed.

How to build the Qt-SQL-driver-plugin &#039;QSQLCIPHER&#039; for SQLite-DB with SQLCipher-extension using the Windows/MinGW-platform?

匿名 (未验证) 提交于 2019-12-03 01:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This is not typically a question where to find a step-by-step guide, but rather the guide itself. My intention with this post is to give others a hint, who have the same problems in compiling the driver-plugin as I just had recently. How to build the Qt-SQL-driver-plugin 'QSQLCIPHER' for SQLite-DB with SQLCipher-extension using the Windows/MinGW-platform? 回答1: How to build the Qt-SQL-driver-plugin 'QSQLCIPHER' for SQLite-DB with SQLCipher-extension using the Windows/MinGW-platform: Qt 5.4.0 for Windows/MinGW Download Qt Install including the

file is encrypted or is not a database (Exception net.sqlcipher.database.SQLiteException)

匿名 (未验证) 提交于 2019-12-03 01:13:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to use sqlcipher lib to encrypt my database from already existing database but while accessing the old database(i.e opening the db) gives this exception: 02-27 13:12:21.231: E/AndroidRuntime(14687): FATAL EXCEPTION: main 02-27 13:12:21.231: E/AndroidRuntime(14687): java.lang.RuntimeException: Unable to start activity ComponentInfo{net.sqlcipher/example.SQLDemoActivity}: net.sqlcipher.database.SQLiteException: file is encrypted or is not a database 02-27 13:12:21.231: E/AndroidRuntime(14687): at android.app.ActivityThread

mac book air 编译sqlcipher

匿名 (未验证) 提交于 2019-12-03 00:26:01
0x01. 编译成静态库 $ ./configure --enable-tempstore=yes CFLAGS = "-DSQLITE_HAS_CODEC" \ LDFLAGS = "/opt/local/lib/libcrypto.a" 错误: clang: error: no such file or directory: '/opt/local/lib/libcrypto.a' ... configure:2922: error: in `/Users/panjing/github/sqlcipher' : configure:2924: error: C compiler cannot create executables See `config.log' for more details 0x02. 编译成动态库 第一步顺利通过 $ ./configure --enable-tempstore=yes CFLAGS = "-DSQLITE_HAS_CODEC" \ LDFLAGS = "-lcrypto" 第二步出错: $ make 错误信息: sqlite3.c: 18280 : 10 : fatal error : 'openssl/rand.h' file not found 重新安装openssl 根据提示执行: echo 'export PATH="/usr

Sqlcipher __ CREATE TABLE android_metadata failed

╄→尐↘猪︶ㄣ 提交于 2019-12-02 01:49:16
问题 I'm trying to attach a existing sqlcipher database(encrypted) in my android application but after copying it in my directory it cannot be opened using "SQLiteDatabase.openDatabase(...)" I tried the code in normal sqlite and it works correctly but when I used sqlcipher API i got this error message //CREATE TABLE android_metadata failed //Failed to setLocale() when constructing, closing the database // net.sqlcipher.database.SQLiteException: file is encrypted or is not a database I used the