当前位置:网站首页>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
边栏推荐
- WMI技术介绍和应用
- 函数的调用过程
- 【UDS统一诊断服务】(补充)五、ECU bootloader开发要点详解 (2)
- 搭建openstack平台
- [UDS unified diagnosis service] i. diagnosis overview (3) - ISO 15765 architecture
- 【UDS统一诊断服务】五、诊断应用示例:Flash Bootloader
- Opencv uses genericindex for KNN search
- Installation of GCC, G + +, GDB
- PHP junior programmers, take orders and earn extra money
- 逻辑回归原理及代码实现
猜你喜欢
[ThreadX] h743 + ThreadX + Filex migration record
Qt 添加QSerialPort类 实现串口操作
基于TensorFlow的线性回归实例
2020 Jiangsu Collegiate Programming Contest-A.Array
Cross domain issues - allow origin header contains multiple values but only one is allowed
[UDS unified diagnostic service] III. application layer protocol (1)
VHDL 有限状态机(FSM) 代码示例
File viewing commands and user management commands
C#【文件操作篇】PDF文件和图片互相转换
【UDS统一诊断服务】(补充)五、ECU bootloader开发要点详解 (2)
随机推荐
PN结、二极管原理详解与应用
PM2 deploy nuxt related commands
四元数乘法
Round up a little detail of the round
日志写法(带时间)
Notes on advanced points of C language 4
The waterfall waterfall flow of uview realizes single column and loads more
Wechat applet request encapsulation
汇编 32位无符号加法计算器
ROS包nmea_navsat_driver读取GPS、北斗定位信息笔记
vs中的多字节与unicode
Quaternion multiplication
【UDS统一诊断服务】(补充)五、ECU bootloader开发要点详解 (1)
For() loop parameter call order
深蓝学院激光slam 理论与实践 第三章激光雷达去畸变 作业习题
LaTeX配置与使用
C语言进阶要点笔记4
浮点数双精度,单精度以及半精度知识总结
【UDS统一诊断服务】四、诊断典型服务(6)— 输入输出控制单元(0x2F)
undefined reference to `Nabo::NearestNeighbourSearch