Database access method and apparatus
Abstract
A database access method and apparatus are disclosed, to ensure data security during interaction between a user and a database, and effectively reduce performance overheads. The method includes: receiving an encrypted data computation request sent by a database kernel, where the encrypted data computation request requests to perform computation on encrypted data of a user, and the database kernel runs in a non-secure execution environment; receiving encrypted data sent by the database kernel, where the encrypted data is all encrypted data in a user query request; performing decryption and computation on the encrypted data in response to the encrypted data computation request, to obtain a computation result; encrypting the computation result to obtain an encrypted computation result; and sending the encrypted computation result to the database kernel.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 4 · Forward citations: 1.
Claims (8)
- Claim 1Independent Claim
A database access method, the method being performed in a trusted execution environment (TEE), the method comprising: receiving an encrypted data computation request sent by a database kernel, the encrypted data computation request requesting to perform computation on encrypted data of a user, the database kernel running in a non-secure execution environment (REE); receiving encrypted data sent by the database kernel, the encrypted data comprising all encrypted data in a user query request; performing decryption and computation on the encrypted data in response to the encrypted data computation request to obtain a computation result; encrypting the computation result to obtain an encrypted computation result; and sending the encrypted computation result to the database kernel.
- Claim 2Depends on #1
The method according to claim 1, wherein the receiving the encrypted data sent by the database kernel comprises: receiving a data eigenvalue sent by the database kernel, the data eigenvalue indicating the encrypted data; sending a first feedback to the database kernel when the data eigenvalue is not found in a cache record; and receiving the encrypted data sent by the database kernel in response to the first feedback.
- Claim 3Depends on #2
The method according to claim 2, wherein the method further comprises: decrypting the encrypted data to obtain plaintext data; labeling the plaintext data using the data eigenvalue and storing the plaintext data; and adding the data eigenvalue to the cache record.
- Claim 4Depends on #1
The method according to claim 1, wherein the receiving the encrypted data sent by the database kernel comprises: receiving a data eigenvalue sent by the database kernel, the data eigenvalue indicating the encrypted data; sending a second feedback to the database kernel when the data eigenvalue is found in a cache record; and obtaining, from stored plaintext data based on the data eigenvalue, plaintext data corresponding to the data eigenvalue, the plaintext data being obtained by decrypting the encrypted data.
- Claim 5Depends on #1
The method according to claim 1, wherein the method further comprises: receiving an identity authentication request forwarded by the database kernel, wherein the identity authentication request is initiated by a database client and the database client runs in the non-secure execution environment (REE); sending identity authentication information to the database kernel; and receiving the encrypted data computation request sent by the database kernel, wherein the encrypted data computation request is sent after authentication based on the identity authentication information has succeeded.
- Claim 6Depends on #5
The method according to claim 5, wherein the method further comprises: receiving a data key of the user that is forwarded by the database kernel, wherein the data key is encrypted according to an ECDH algorithm; generating a verification key, an encryption/decryption key, and an initial vector value based on the data key; receiving the encrypted data sent by the database kernel; and checking integrity of each piece of data of the encrypted data based on the verification key.
- Claim 7Depends on #6
The method according to claim 6, wherein the encrypted data is data on which an integrity check succeeds.
- Claim 8Depends on #6
The method according to claim 6, wherein the performing the decryption and the computation on the encrypted data in response to the encrypted data computation request comprises: decrypting each piece of data of the encrypted data based on the encryption/decryption key and the initial vector value to obtain plaintext data corresponding to each piece of data; and calling, based on the encrypted data computation request, one or more operators to perform computation on the plaintext data corresponding to each piece of data.
Technical Overview & Description
CROSS-REFERENCE TO RELATED APPLICATIONS This application is a continuation of International Application No. PCT/CN2022/082450, filed on Mar. 23, 2022, which claims priority to Chinese Patent Application No. 202110335806.6, filed on Mar. 29, 2021. The disclosures of the aforementioned applications are hereby incorporated by reference in their entireties. TECHNICAL FIELD This application relates to the field of data processing technologies, and more specifically, to a database access method and apparatus. BACKGROUND Security protection for a database that serves as one of important basic software has become a challenge that urgently needs to be addressed. In terms of a challenge for protecting sensitive data, to prevent an unauthorized program or a malicious administrator from tampering with or stealing sensitive data of a user, data is usually encrypted in the industry, and sensitive data is stored in ciphertext. However, when the user performs an operation on the sensitive data (for example, querying), the ciphertext still needs to be decrypted on a corresponding computing platform. Therefore, at an operation moment, data still exists in a memory of the computing platform in a plaintext form, and the plaintext data is a great security risk. In addition, in a technical solution in which an operation is performed on ciphertext according to a cryptographic algorithm, only some operations (such as equality querying and sorting) can be performed, and execution performance is usually poor. Therefore, a method for ensuring security of sensitive data of the user during interaction between the user and a database is urgently needed. SUMMARY This application provides a database access method and apparatus, to ensure data security during interaction between a user and a database, and effectively reduce performance overhead. According to a first aspect, a database access method is provided. The method is performed in a trusted execution environment, and includes: receiving an e
Cited By — Indexed Forward Citations (1 of 1 total)
| Patent | Title | Year | Citations |
|---|---|---|---|
| US 12,783,879 B2 | Method and electronic device for secure training of an artificial intelligence (AI) model | 2026 | 0 |
References Cited — Backward Prior Art (4)
| Patent | Title | Year | Citations |
|---|
Non-Patent Literature (10)
- Wang Yongzhi et al:
- “
- CryptSQLite: Protecting Data Confidentiality of SQLite with Intel SGX
- ”
- , 2017 International Conference on Networking and Networkapplications (NANA), Oct. 1, 2017 (Oct. 1, 2017), pp. 303-308, XP093146618.
- Vinayagamurthy, D., Gribov, A., and Gorbunov, S. (2019). StealthDB: a Scalable Encrypted Database with Full SQL Query Support, Proceedings on Privacy Enhancing Technologies, 2019(3), 370-388. doi: https://doi.org/10.2478/popets-2019-0052.
- C. Priebe, K. Vaswani and M. Costa,
- “
- EnclaveDB: A Secure Database Using SGX,
- ”