Journal of Computer Applications

    Next Articles

Multi-key page-level encryption system for SQLite

LI Xudong1,2,3, FENG Yukang1,3, CHEN Junsheng1,3   

  1. 1.College of Software, Nankai University 2.Haihe Laboratory of Information Technology Application Innovation (HL-IT) 3.Tianjin Key Laboratory of Operating System
  • Received:2023-10-08 Revised:2023-12-17 Online:2024-03-21 Published:2024-03-21
  • About author:LI Xudong,born in 1975,Ph. D. associate professor, His research interests include operating system,database,distributed computing. FENG Yukang,born in 1998,M. S. candidate. His research interests include database. CHEN Junsheng,born in 2000,M. S. candidate. His research interests include database.

面向SQLite的多密钥页级别加密系统

李旭东1,2,3,冯宇康1,3,陈俊升1,3   

  1. 1.南开大学 软件学院 2.先进计算与关键软件(信创)海河实验室 3.天津市操作系统企业重点实验室
  • 通讯作者: 冯宇康
  • 作者简介:李旭东(1975—),男,吉林松原人,副教授,博士,主要研究方向:操作系统、数据库、分布式计算;冯宇康(1998—),男,河北保定人,硕士研究生,主要研究方向:数据库;陈俊升(2000—),男,广西梧州人,硕士研究生,主要研究方向:数据库。

Abstract: At present, research on SQLite encryption both domestically and internationally is conducted at the file level and single-key, resulting in coarse encryption granularity and low decryption difficulty. In response to the security shortcomings of SQLite, a multi-key page-level encryption system was proposed. Firstly, an independent page key was assigned to each physical page, allowing for individual encryption and decryption of each page. A key file was introduced to store all page keys. Secondly, a page key cache module KeyCache was designed to generate and cache page keys for pages, thereby reducing the performance loss caused by frequent I/O read and write operations. Thirdly, an encryption and decryption module Crypto was proposed to implement the encryption and decryption functions. Crypto quickly retrieved page keys through KeyCache, consequently enhancing the overall system performance. A comparative experiment was conducted between the proposed solution and typical SQLCipher. Experimental results show that in read and update tests, compared with SQLCipher, the execution time of the proposed solution reduced by 1.5% and 3.0% on average, achieving better performance at a higher security level. Additionally, in create and delete tests, the proposed solution exhibites minimal performance loss compared to SQLCipher and the performance loss is close to SQLCipher while significantly enhancing the security level, verifying the effectiveness of the proposed solution.

Key words: SQLite database, database encryption, page-level, multi-key encryption, key management

摘要: 目前国内外对于SQLite的加密研究粒度级别都是文件级别且采取的都是单一密钥,加密粒度粗、破解难度低。针对SQLite的安全性不足的问题,设计了一个多密钥页级别加密系统。首先,为每一个物理页设置一个独立的页密钥,每个页面独立加解密,并引入密钥文件来存放所有页密钥;其次,在内存中引入一个页密钥缓存器KeyCache生成和缓存物理页的页密钥,减少页密钥频繁I/O读写的性能损失;再次,设计了加解密模块Crypto实现物理页的加密和解密功能,Crypto通过KeyCache快速获取页密钥从而提升整个系统的处理性能。将所提方案和典型的SQLCipher等进行对比实验,实验结果表明,在读取测试和修改测试中,相较于SQLCipher,所提方案的执行时间平均缩短了1.5%和3.0%,能在安全级别更高的情况下达到更好的性能;而在新增测试和删除测试中,所提方案相较于SQLCipher的性能损失很小,在大大提升安全级别的情况下性能损失接近,验证了所提方案的有效性。

关键词: SQLite数据库, 数据库加密, 页粒度, 多密钥加密, 密钥管理

CLC Number: