当前位置:网站首页>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
边栏推荐
猜你喜欢

Vscode custom comments

OpenCV使用 GenericIndex 进行 KNN 搜索

Eigen 学习总结
![[UDS unified diagnosis service] IV. typical diagnosis service (3) - read fault information function unit (storage data transmission function unit)](/img/10/bd39bb03f5456a412650596208a391.png)
[UDS unified diagnosis service] IV. typical diagnosis service (3) - read fault information function unit (storage data transmission function unit)

【UDS统一诊断服务】(补充)五、ECU bootloader开发要点详解 (1)

卷积神经网络实现CIFAR100数据集分类

MOS管特性和导通过程

Introduction to nonparametric camera distortion model

进程管理命令
[ThreadX] h743 + ThreadX + Filex migration record
随机推荐
HDU-Memory Control
2020 Jiangsu Collegiate Programming Contest-A.Array
Notes on advanced points of C language 5
Qt 添加QSerialPort类 实现串口操作
C语言结构体指定初始化
Shell脚本的通配符和特殊符号
C语言中volatile的使用
[UDS unified diagnostic service] IV. typical diagnostic service (5) - function / component test function unit (routine function unit 0x31)
Camera calibration: key point method vs direct method
拷贝构造函数
修改注册表的值
Matlab标定板角点检测原理
CUDA project encountered a series of compilation problems after changing the environment (computer)
C语言进阶要点笔记4
HDU-Tunnel Warfare
【UDS统一诊断服务】二、网络层协议(2)— 数据传输规则(单帧与多帧)
PM2 deploy nuxt related commands
圆整 round 的一点点小细节
PN结、二极管原理详解与应用
浮点数双精度,单精度以及半精度知识总结