forked from yhirose/cpp-sqlitelib
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
目前的 cpp-sqlitelib 是基于原仓库 cpp-sqlitelib修改的。
原仓库属于一个纯头文件库,封装的是标准 sqlite3,而标准 sqlite3 是默认不支持加密数据库的。
我们将仓库fork后,将原本仓库的 sqlite3 源码删除,修改 cmake 以及部分源码,让其查找 sqlite3mc,以支持加密数据库。
然而截止目前,仅仅是添加了一个 setPassword 函数:
https://github.com/Mq-b/cpp-sqlitelib/blob/ff9896c/sqlitelib.h#L287-L297
void setPassword(const std::string& passworld) const {
int rc = sqlite3_key(db_, passworld.c_str(), static_cast<int>(passworld.size()));
if (rc != SQLITE_OK) {
throw std::runtime_error("设置密码错误");
}
rc = sqlite3_exec(db_, "SELECT count(*) FROM sqlite_master;", nullptr, nullptr, nullptr);
if (rc != SQLITE_OK) {
throw std::runtime_error("密码验证错误");
}
}直接使用了 sqlite3_key 这意味着选择了默认的加密算法为 ChaCha20-Poly1305。
然而 sqlite3mc 总共支持 6 种加密算法:
- wxSQLite3: AES 128 Bit CBC - No HMAC
- wxSQLite3: AES 256 Bit CBC - No HMAC
- sqleet: ChaCha20 - Poly1305 HMAC (Default cipher scheme)
- SQLCipher: AES 256 Bit CBC - SHA1/SHA256/SHA512 HMAC
- System.Data.SQLite: RC4
- Ascon: Ascon-128 v1.2
- AEGIS: AEGIS Family of Authenticated Encryption Algorithms
文档:https://utelle.github.io/SQLite3MultipleCiphers/
我们需要补齐对剩下加密算法的支持,以及添加更多的测试用例,修改 cmake 和 README。
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request