当前位置:网站首页>SQLite3 encrypted version
SQLite3 encrypted version
2022-04-23 06:44:00 【The old man is outside the door】
sqlite3 Encrypted version
1.lib、dll stay github Download address on
https://github.com/rindeal/SQLite3-Encryption
2. Description of encryption interface
// Decryption or for the first encryption
int sqlite3_key(sqlite3 *db, const void *zKey, int nKey);
// Reset password
int sqlite3_rekey(sqlite3 *db, const void *zKey, int nKey);
sqlite3_key Yes, enter the key , If the database is encrypted, you must execute this function and enter the correct key before you can operate ; If the database is not encrypted , After executing this function, the database operation will appear “ This database is encrypted or not a database file (file is encrypted or is not a database)” Error of .
int sqlite3_key( sqlite3 *db, const void *pKey, int nKey),
db Is the specified database ,pKey It's the key ,nKey It's the key length .
sqlite3_rekey Is to change the key or add the key to the database without encryption or empty the key , Before changing the key or emptying the key, it must be executed correctly sqlite3_key. In the correct implementation sqlite3_rekey After the sqlite3_close Before closing the database, you can operate the database normally , No more execution sqlite3_key.
int sqlite3_rekey( sqlite3 *db, const void *pKey, int nKey), The parameters are the same as above .
// Detailed instructions
1. Add database password : If you want to add a password , After creating the database file , Call... Any time before closing the database file sqlite3_key Function
2. Read database data : After opening the data file , call sqlite3_key function , that will do ( If the database is not encrypted , After executing this function, the database operation will appear “ This database is encrypted or not a database file ” Error of ; After testing , The password can only be set when creating a new database !)
3. Change database password : First, you need to use the current password to open the database correctly , Then you can call sqlite3_rekey(db,"112233",6) To change the database password .
4. Delete database password : First, you need to use the current password to open the database correctly , Then you can call sqlite3_rekey(db,"112233",6) To delete the database password .
Reference resources :
1.https://blog.csdn.net/Best_ZYJ/article/details/102483847
2.https://blog.csdn.net/weixin_33770878/article/details/94542946?utm_medium=distribute.pc_relevant.none-task-blog-2~default~baidujs_baidulandingword~default-0.pc_relevant_paycolumn_v3&spm=1001.2101.3001.4242.1&utm_relevant_index=3
版权声明
本文为[The old man is outside the door]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230548038789.html
边栏推荐
- 【UDS统一诊断服务】三、应用层协议(2)
- Object array and object pointer
- CUDA环境安装
- POJ-The Unique MST
- FOC电机库 定点PID代码分析
- SQLite compilation
- C语言结构体指定初始化
- Initialization of classes and objects (constructors and destructors)
- [UDS unified diagnostic service] IV. typical diagnostic service (2) - data transmission function unit
- 【UDS统一诊断服务】四、诊断典型服务(4)— 在线编程功能单元(0x34-0x38)
猜你喜欢
[UDS unified diagnostic service] II. Network layer protocol (2) - data transmission rules (single frame and multi frame)
[ThreadX] h743 + ThreadX + Filex migration record
基于VGG卷积神经网络的图像识别代码实现
【UDS统一诊断服务】四、诊断典型服务(5)— 功能/元件测试功能单元(例行程序功能单元0x31)
Makefile基础、常用函数及通用Makefile
QT add qserialport class to realize serial port operation
深蓝学院激光slam理论与实践 -第二章(里程计标定)作业
Vscode custom comments
基于Keras的时装分类案例
三极管原理及特性分析
随机推荐
[ThreadX] h743zi + lan8720 + ThreadX + netx duo transplantation
C51/C52 特殊功能寄存器表
【UDS统一诊断服务】四、诊断典型服务(1)— 诊断和通信管理功能单元
HDU-Memory Control
【UDS统一诊断服务】一、诊断概述(2)— 主要诊断协议(K线和CAN)
【UDS统一诊断服务】四、诊断典型服务(4)— 在线编程功能单元(0x34-0x38)
函数的调用过程
文件查看命令和用户管理命令
日志写法(带时间)
sqlite3加密版
【UDS统一诊断服务】二、网络层协议(2)— 数据传输规则(单帧与多帧)
对象的动态建立和释放,赋值和复制
Qt 给应用程序加图标
Understanding of SSH public key and private key
[UDS unified diagnosis service] i. diagnosis overview (3) - ISO 15765 architecture
赛氪-zeal
HDU-Tunnel Warfare
带默认模板实参的类模板与模板模板形参的匹配
产生随机数
ARM常用汇编指令