当前位置:网站首页>使用sqlcipher打开加密的sqlite方法
使用sqlcipher打开加密的sqlite方法
2022-07-02 06:50:00 【微澜-】
说明:
SQLite 一个非常流行的嵌入式数据库,它支持 SQL 语言,并且只利用很少的内存就有很好的性能。此外它还是开源的,任何人都可以使用它。许多开源项目((Mozilla, PHP, Python)都使用了 SQLite.
Android 在运行时集成了 SQLite,所以每个 Android 应用程序都可以使用 SQLite 数据库。对数熟悉 SQL 的开发人员来时,使用 SQLite 相当简单。对于小型应用来说,使用这样的单机版文件数据库更加小巧实用。
加密问题
原生的sqLite并不支持密码加密,目前常用的数据库加密方式大部分是字段加密,或者是内容加密。这里特别推荐使用sqlcipher的数据库加密方案,使用与原生一致,(sqlcipher-android的Github地址请戳)
加密的时候使用windows版本sqlcipher-windows工具处理,设置密码和算法。
Sqlcipher加密sqlite数据库之后,使用android版Sqlcipher访问数据库和原生的sqlite几乎一摸一样,只需要在打开数据库的时候设置密码,算法就可以打开
打开加密sqlite例子
import net.sqlcipher.database.SQLiteDatabase;

打开数据库之后,后面的操作和原生操作一摸一样。
我之前把txt数据包装为apk用的就是sqlite数据库,把章节目录位置写入sqlite,可以快速定位。
书籍列表 | android 书籍apk下载 | ||
序号 | 名称 | 下载 | 备注 |
1 | 红楼梦 | ||
2 | 三国演义 | ||
3 | 西游记 | ||
4 | 水浒传 | ||
5 | 饥饿的盛世 | 讲述乾隆王朝的得失 | |
6 | 阿凡提故事 | 阿凡提及部分民族故事 | |
7 | 格言卡片 | 格言上百篇 | |
8 | 笑话大全 | 众多日常笑话 | |
9 | 小小说 | 数十篇著名小小说 | |
10 | 元史演义 | 每个朝代都是历史的选择 | |
11 | 爱情语录 | 关于爱情的小文章 | |
12 | 济公全传 | 那些年那些事那些心愿 | |
13 | 明朝那些事儿 | 一个让人遗憾的王朝,最能看清人性的时代 | |
14 | 凡人修仙传-人界篇 | 一个人的玄界奋斗史,修仙小说的经典 | |
15 | 凡人修仙传-灵界篇 | ||
16 | 凡人修仙传-仙界篇 | ||
参考:
git clone https://github.com/sqlcipher/sqlcipher.git关于:
qq:9611153 微信lgs9611153
边栏推荐
- Following nym, the new project Galaxy token announced by coinlist is gal
- Edge computing accelerates live video scenes: clearer, smoother, and more real-time
- allure--常用配置项
- 02-taildir source
- Blender model import UE, collision settings
- Blender摄像机环绕运动、动画渲染、视频合成
- MPLS experiment
- Excuse me, is it cost-effective to insure love life patron saint 2.0 increased lifelong life insurance? What are the advantages of this product?
- Blender ocean production
- Webui automated learning
猜你喜欢

shell编程01_Shell基础

Considerations for Apache deploying static web page projects

Determine whether there are duplicate elements in the array

flink 提交程序

sqoop创建job出现的一系列问题解决方法

Sum the two numbers to find the target value

虚幻材质编辑器基础——如何连接一个最基本的材质

Vscode set JSON file to format automatically after saving

Beautiful and intelligent, Haval H6 supreme+ makes Yuanxiao travel safer

《MySQL 8 DBA基础教程》简介
随机推荐
数据库字典Navicat自动生成版本
[Lua] summary of common knowledge points (including common interview sites)
Determine whether there are duplicate elements in the array
flume 190 INSTALL
Aiphacode is not a substitute for programmers, but a tool for developers
MYSQL关键字
2021-09-12
Applet development summary
合并有序数列
01安装虚拟机
Pytest framework implements pre post
Blender摄像机环绕运动、动画渲染、视频合成
SPSS做Shapiro-Wilk正态分析
Is this code PHP MySQL redundant?
session-cookie与token
2.14 is it Valentine's day or Valentine's day when the mainstream market continues to fluctuate and wait for changes?
【虚幻4】UMG组件的简介与使用(更新中...)
SUS系统可用性量表
07 data import sqoop
[Fantasy 4] the transformation from U3D to UE4