sqlcipher

正确使用sqlcipher for Android

空扰寡人 提交于 2020-05-07 20:17:57
android-database-sqlcipher 是基于SQLCipher的数据库加密框架,支持android4到android9,经常用来对android的SqlLite进行加密,现在支持Gradle集成,如果要支持androidx,可以使用Room框架,也可以配合原声的SQLiteOpenHelper使用。 首先在你的build.gradle中添加依赖: implementation 'net.zetetic:android-database-sqlcipher:4.2.0'   如果要兼容androidx请参考github页的配合Room框架使用的方案。 这里介绍怎么和原生API配合使用: 1、将所有android.database.sqlite.*的引入全部更改为net.sqlcipher.database.*,例如android.database.sqlite.SQLiteDatabase改为 net.sqlcipher.database.SQLiteDatabase; 2、在你的application的oncreate方法里面调用SQLiteDatabase.loadLibs();传入application的上下文作为参数; 3、在你获取数据库对象的时候,使用SQLiteDatabase.g() ,传入密码,支持String,byte[],char[] 作为密码;

How to build a SQLCipher driver for PyQt5

江枫思渺然 提交于 2020-04-07 09:27:17
问题 I am having some troubles in order to build a SQLCipher driver for PyQt5. I checked some ways of building a Qt SQLCipher driver plugin, but I am fairly new to this world and I only know Python, so I don't understand it nor understand how to make it work for PyQt5 without using plugins. I also saw that I building a driver as a class is possible, but I don't have any idea of how to build this driver. I have some disconnected information about drivers, Qt and PyQt5, but I just can't figure out

.net core加载加密的sqlite文件失败解决方案

僤鯓⒐⒋嵵緔 提交于 2020-03-08 18:53:29
.net core加载加密的sqlite文件失败解决方案   在项目开发过程中,遇到使用sqlite的场景。在加载加密的sqlite时,连接sqlite时报错,,先用百度查询了下资料,尚未找到对应解决方法,故接着在stackoverflow上查找,找到了解决思路,并已解决问题。 1.开发时所用到的相关内容 1.1相关项目组件 组件名称 版本 Microsoft.NETCore.App 2.1.0 sqlSugarCore 5.0.0.9 1.2 sqlite加密软件 软件名称 版本 SQLiteStudio 3.1.1 2.解决过程 2.1 遇错过程   刚开始用的时候是直接用SQLiteStudio直接创建了SQLCipher加密的sqlite文件,用sqlsugar进行DB连接时候程序报错。报错提示如下: file is encrypted or is not a database 2.2 第一种解决方案——System.Data.Sqlite 2.2.1 使用System.Data.Sqlite   在sqlite连接的时候,弃用sqlsugar,转而采用System.Data.Sqlite中的sqliteconnection来连接,这个需要自行从nuget中下载,当前采用是System.Data.Sqlite的最新版本1.0.112,且需要将原先加密方式进行改变

window系统下,如何使用sqlcipher工具对已加密数据库解密

荒凉一梦 提交于 2020-02-07 04:18:59
window系统下,如何使用sqlcipher工具对已加密数据库解密 需求背景 目前我项目里数据库是使用sqlcipher加密的,本文介绍如何使用sqlcipher工具进行解密,已给测试人员以及其他开发人员使用。 使用工具 工具下载地址,提取码59jq 具体解密操作 1.解压下载好的工具 2.打开cmd命令工具进入到bin目录下 3.解密已有的加密数据库,就以项目的universal_encrypt.db为例,执行 sqlcipher-shell64.exe universal_encrypt.db 进入到sqlite中 4.对数据库进行解密,执行以下四部操作 1. PRAGMA key = '123456' ; 2. ATTACH DATABASE 'plaintext.db' AS plaintext KEY '' ; 3. SELECT sqlcipher_export ( 'plaintext' ) ; 4. DETACH DATABASE plaintext 5.解密完成,这个plaintext.db就是解密好的数据库 其他使用 1.创建数据库 1.sqlcipher-shell64.exe encrypted .db 2.PRAGMA key = 'password'; 3.create table encrypted (id integer, name text);

windows bat脚本如何自动执行sqlcipher命令

余生颓废 提交于 2020-02-06 18:03:56
windows bat脚本如何自动执行sqlcipher命令 需求背景 继sqlcipher解密完成后,觉得每次查看加密数据库都要输入一堆指令,不利于开发和测试工作,所以本文介绍如何通过bat脚本自动执行。 直接使用命令行 sqlcipher-shell64.exe universal_encrypt.db 进入到sqlite中 然后再执行 1. PRAGMA key = '123456' ; 2. ATTACH DATABASE 'plaintext.db' AS plaintext KEY '' ; 3. SELECT sqlcipher_export ( 'plaintext' ) ; 4. DETACH DATABASE plaintext 使用bat脚本 sqlcipher - shell64 . exe universal_encrypt . db < adb . txt pause adb.txt PRAGMA key = ‘123456’; ATTACH DATABASE ‘plaintext.db’ AS plaintext KEY ‘’; SELECT sqlcipher_export(‘plaintext’); DETACH DATABASE plaintext 来源: CSDN 作者: 黑山老妖2018 链接: https://blog.csdn.net

How can I use ORMLite with SQLCipher together in Android?

主宰稳场 提交于 2020-01-27 06:11:28
问题 I would like to use OrmLite with SQLCipher in my Android project, but both libraries have their own abstract SQLiteOpenHelper class to implement. Java don't allow a class to extend two classes and if I implement separately, they will not communicate with each other. How can I work with both together? How do I resolve the SQLiteOpenHelper implementation problem? 回答1: How can I use ORMLite with SQLCipher together in Android? It should be possible @Bruno. One way that should work is to just copy

Using SQLCipher with Android [duplicate]

房东的猫 提交于 2020-01-11 07:45:10
问题 This question already has an answer here : Encrypt exisiting database in Android (1 answer) Closed 4 years ago . I have previously asked this question and have not got any appropriate answer. I have an app published in the Play Store which makes heavy use of SQLite database. Now I need to secure the database using SQLCipher. Here are some problems I am facing. 1) How can I seamlessly integrate SQLCipher with my existing unencrypted database, so that my app works as it works normally but now

SQLCipher and CWAC-SafeRoom doubling the size of my APK

烈酒焚心 提交于 2020-01-06 07:31:53
问题 The size of these libraries really increase the APK size. It’s almost 50% my App size, taking it to 16.3 MBs and when I analyze the APK, sqlcipher-lib alone is 48.9% of my apk size i.e 7.3MBs!!! Is there any workaround? Edit: Since this is a DB related issue and I believe it's good if the specified tags remain referenced for specificity during search by other developers. I think the answer below addresses it better in order to keep the conversation along specific topics 回答1: This section of

Android SQLcipher PRAGMA problems

百般思念 提交于 2020-01-05 10:07:45
问题 Hey guys I am having a some problems with SQLcipher db for android The documentation is not too descriptive so I could not figure it out. I am trying to modify the default number of iterations on sqlcipher for android, I am editing the notecipher app provided as demo app with sqlcipher, and want to increase the kdf_iter to i.e. 5000 By overriding the getWritableDatabase() method in the database helper i enter the pragma value just after the file is open with the password. I can open and

moving from android sqlcipher to android sqlite database

徘徊边缘 提交于 2020-01-05 08:23:19
问题 From the last 3 days i am trying to upgrade my database to a higher version of SQLCipher library (v3.1.0). I did every step and followed a few tutorials too. But keep on getting the error "File is encrypted or not a Database". Now am trying to move to unencrypted database ie. simple sqlite database. Do we have a way to move to encrypted database to un-encrypted database? Thanks in advance. This is the code i am working on: public MyDBAdapter(Context context) { this.context = context; File