WO2018152904A1 - Method for processing security outsourcing data of relational database supporting ciphertext data operation - Google Patents

Method for processing security outsourcing data of relational database supporting ciphertext data operation Download PDF

Info

Publication number
WO2018152904A1
WO2018152904A1 PCT/CN2017/077109 CN2017077109W WO2018152904A1 WO 2018152904 A1 WO2018152904 A1 WO 2018152904A1 CN 2017077109 W CN2017077109 W CN 2017077109W WO 2018152904 A1 WO2018152904 A1 WO 2018152904A1
Authority
WO
WIPO (PCT)
Prior art keywords
ciphertext
value
database
algorithm
att
Prior art date
Application number
PCT/CN2017/077109
Other languages
French (fr)
Chinese (zh)
Inventor
王晓菲
张玉清
伍前红
Original Assignee
中国科学院大学
北京航空航天大学
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中国科学院大学, 北京航空航天大学 filed Critical 中国科学院大学
Publication of WO2018152904A1 publication Critical patent/WO2018152904A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • H04L63/105Multiple levels of security
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2141Access rights, e.g. capability lists, access control lists, access tables, access matrices

Definitions

  • the invention relates to a relational database security outsourcing data processing method for supporting ciphertext data operations, which belongs to the field of cloud computing security and database security.
  • Client encryption mainly faces two problems: first, which encryption algorithm is used to encrypt the relational database; and second, how to perform data operations on the encrypted ciphertext relational database.
  • Related research has achieved a series of important results, including full homomorphic encryption technology, partial homomorphic encryption technology. More work is done around one or more of ciphertext domain equivalent queries, range queries, aggregate queries, and fuzzy queries, but the types of data operations it supports are very limited.
  • Some comprehensive ciphertext database query schemes can support some SQL-based query operations, but there are four shortcomings:
  • an object of the present invention is to provide a relational database security outsourcing data processing method that supports ciphertext data operations. This method protects the data confidentiality and effective data utilization of the relational database in the outsourcing process.
  • the technical solution used by the present invention to solve the technical problem thereof is: a relational database security outsourcing data processing method (including a query request, an insert request, an update request, and a delete request) that supports ciphertext data operations.
  • a relational database security outsourcing data processing method (including a query request, an insert request, an update request, and a delete request) that supports ciphertext data operations.
  • This approach works between end users, database owners, and cloud service providers.
  • the relational database is encrypted by the database owner before outsourcing, and then the cloud service provider directly executes the SQL-based full-type data operation on the outsourced ciphertext database, and the returned query result is decrypted by the database owner instead of the end user.
  • the method flow of the present invention is:
  • the database owner outsources the relational database security to the cloud service provider:
  • the database owner generates a private key
  • the database owner encrypts the outsourced database through the cryptographic module to generate an outsourced ciphertext database and sends it to the cloud service provider;
  • the cloud service provider receives and stores the outsourced ciphertext database in place
  • the database owner creates a user-defined function at the cloud service provider.
  • the database owner determines whether the query request has been authorized according to the access control policy, and if the access is illegal, the operation is rejected;
  • the database owner converts the plaintext SQL statement into a ciphertext SQL statement set by the conversion module and sends it to the cloud service provider;
  • the cloud service provider invokes the user-defined function, executes the ciphertext SQL statement in the ciphertext database, and returns the ciphertext query result to the database owner;
  • the database owner receives and decrypts the query result set and returns a plaintext record to the end user.
  • the security outsourcing data processing method of the present invention includes the following five modules:
  • a cryptographic module for encrypting or decrypting an outsourced database.
  • the encryption function of the OPEA algorithm has order-preserving and additivity, which can maximize the operability of data.
  • the ciphertext domain of the OPEA algorithm is divided into a plurality of ciphertext partitions arranged in order.
  • FIG. 2 is a mapping structure of the cryptographic module, and upper and lower boundaries of the ith ciphertext partition are respectively defined as U i and L i .
  • the one-to-many mapping structure used in the figure maps a single plaintext value into multiple ciphertext values in a ciphertext partition, which is used to construct an encryption function of the OPEA algorithm, thereby improving the security of the cryptographic module. Sex to defend against ciphertext attacks, statistical attacks, and weakly selected plaintext attacks.
  • the conversion module (SQL-Translator interpreter) is used to convert the plaintext SQL statement to be requested, and at the same time ensure that the ciphertext SQL statement obtained after the conversion can be executed normally in the ciphertext database.
  • FIG. 3 is a processing flow of the conversion module.
  • the integer data is directly encrypted using the OPEA algorithm; when the floating point data is encrypted, the ciphertext space is divided according to the minimum precision of the plaintext space; the character data is converted to the whole matching unit according to the minimum matching unit selected by the end user. After the type, it is encrypted, filled and spliced.
  • the plaintext space is a finite set of all the data in the database.
  • Access control using different keys to encrypt data tables or data fields with different security levels; terminal users who have obtained legal access authorization can log in to the database system through the shared user password; the database owner is based on the data of the currently logged-in user. Access rights get the corresponding encryption and decryption key.
  • the present invention solves two main problems of client encryption, and ensures data confidentiality and effective utilization of the outsourced relational database.
  • the overall architecture of the present invention is applicable to an unmodified commercial cloud database platform such as Microsoft Windows Azure SQL Database.
  • the present invention only needs to encrypt the database once, so the storage overhead is lower, and the relationship between the data access mode and the cloud database is preserved.
  • the OPEA algorithm of the cryptographic module of the present invention can resist ciphertext attacks, statistical attacks, and weakly selected plaintext attacks.
  • the average time complexity of the simplified boundary generation sub-algorithm, the encryption sub-algorithm and the decryption sub-algorithm reaches O(T), O(1) and O(log T), respectively, and T is the maximum value of the plaintext domain, which is basically superior to the mainstream.
  • Symmetric cryptographic algorithm In addition, the comparison operation time and network communication overhead of the OPEA algorithm are neglected.
  • the noise growth problem in the ciphertext domain can be effectively controlled in a constant time by adjusting the key.
  • the conversion module of the present invention supports the current most types of SQL data operations, and includes data operation statements such as equivalence query, range query, aggregate query, fuzzy query, insert, update, and delete.
  • the conversion time of the SQL-Translator interpreter is in the order of microseconds and satisfies the data conversion requirements of any type and length.
  • the present invention directly executes the ciphertext query without decrypting the outsourced data, and the query result is accurate, without error judgment, and no miss judgment. With the same query precision, the client post-processing overhead is low, and the overall query efficiency is high.
  • FIG. 1 shows the overall architecture of the system.
  • the module design, data flow direction and range of roles of the present invention are given.
  • Figure 2 is a cryptographic module mapping structure diagram. The division of the OPEA algorithm, the division method of the interval, and the plaintext domain are given. The mapping relationship of the ciphertext domain.
  • Figure 3 is a flow chart of the conversion module processing.
  • the workflow of the SQL-Translator interpreter is given, including the core conversion module and the sub-conversion module.
  • Figure 4 is an example of a database to be outsourced
  • Figure 5 is an example of an outsourced ciphertext database
  • Figure 6 is an example of a ciphertext query result
  • FIG. 7 is an example of the result of the plaintext query after decryption.
  • Figure 1 is the overall architecture of the system, mainly related to the three core service modules of the cryptographic module, the conversion module and the user-defined function.
  • the specific method includes the following steps:
  • Figure 2 is a cryptographic module mapping structure diagram.
  • the implementation method of the cryptographic module includes:
  • the algorithm consists of three sub-algorithms:
  • R i is a set of random numbers in the i th element
  • L i and L [i] is the i-th lower boundary ciphertext partitions
  • U i is the U-[i] is the i-th upper boundary ciphertext partition
  • T is the maximum value of the plaintext domain, that is, the maximum possible value of all the data in the plaintext database.
  • the encryption sub-algorithm is based on the ciphertext partition when encrypting the plaintext value m. For the boundary sets L and U, the encryption function E( ⁇ ) will select from the set ⁇ L[m], L[m]+1,...,U[m] ⁇ and return a random number as the ciphertext value c.
  • the database owner encrypts all data items using the OPEA algorithm, and encrypts the data table name, column name, and the like using an anti-collision hash function or a symmetric cryptography technique.
  • User-defined function implementation methods include:
  • step b) If the distance between E(value 1 ) and E(value 2 ) is not greater than x, the plaintext values are equal, and the function outputs 0, otherwise step b) is continued;
  • the cloud service provider calculates SUM(E(Att)) and SUM(E'(Att)) and sends the ciphertext accumulation result to the database owner;
  • Figure 3 is a flow chart of the conversion module processing.
  • the implementation method of the conversion module includes:
  • the data table name and column name are anonymized using an anti-collision hash function or a symmetric encryption technique;
  • Constant values are converted using the OPEA algorithm.
  • the corresponding sub-conversion module is called in turn for the minimum conversion unit.
  • the sub-conversion module i corresponds to the minimum conversion unit i, and the conversion rule of the minimum conversion unit i is provided, and is converted into a corresponding ciphertext SQL clause.
  • Table 1 details the conversion rules of the minimum conversion unit.
  • Table 1 shows the conversion rules for the minimum conversion unit.
  • a comparison operator expression of the form Att 1 ⁇ Att 2 is directly converted to EqualityCom(x, Att 1 C , Att 2 C ) ⁇ 0.
  • the following conversion methods are gradually adopted: add the temporary column Att_Match for Att; escape the wildcard according to the escape character esch and encrypt the ordinary characters with the OPEA algorithm;
  • the layer cursor matches the length of the data item;
  • the search mode string pat is divided into 3 parts by the Split function, and the matching conditions of the start, the middle, and the end part are respectively generated, and each matching condition is spliced using AND or OR;
  • the inner layer cursor is declared to match the current data.
  • the ciphertext string of the item updates the Att_Match column and the query criteria.
  • the conversion result of the LIKE operator consists of all the SQL statements required for the above conversion steps.
  • the cloud service provider first determines the records with the same attribute values in Att 1 C using the EqualityCom function, and then sorts them according to Att 2 C.
  • the following methods are used to convert: the self-join query is performed on the Att column, and the result of satisfying the query condition is stored in the temporary table #TEM; the query is converted into the temporary table query GROUP BY Att C.
  • the result of the conversion of the GROUP BY clause consists of all the SQL statements required for the above conversion steps.
  • insert operation statements of the form INSERT INTO ⁇ tbl>( ⁇ Att 1 ,Att 2 ,...>)VALUES(val 1 ,val 2 ,7) are directly converted to
  • the conversion rule is the same as the query operation statement.
  • the conversion rule is the same as the query condition of the query operation statement.
  • the conversion rule is the same as the query condition in the query operation statement.
  • the database owner's plaintext database consists of a data table named EXAMPLE.
  • the table contains two plaintext fields (or plaintext attribute columns) with column names C_CUSTKEY and C_NATIONKEY.
  • the database owner encrypts the plaintext database by means of the cryptographic module, and sends the encrypted ciphertext database to the cloud service provider.
  • the plaintext data table named EXAMPLE in the plaintext database corresponds to the ciphertext data table named [8e3b72508e05135569ace4ed9b96d137] in the ciphertext database, and there are 5 ciphertext records in the table, as shown in Fig.
  • the ciphertext column name obtained by encrypting the plaintext column names C_CUSTKEY and C_NATIONKEY by the hash function.
  • the ciphertext data items 121 and 4423 of the first line are respectively ciphertext values obtained by encrypting the plaintext data items 1 and 15 of the first line of the plaintext database one by one using the OPEA algorithm.
  • the end user requests to query the data record with a C_NATIONKEY value greater than 10 from the EXAMPLE table.
  • C_NATIONKEY>10 is the query condition, and the query result should return two plaintext records (1, 15) and (2, 13).
  • the database owner converts the plaintext SQL statement by means of the conversion module to obtain the ciphertext SQL statement:
  • EqualityCom [4eed023b3ef2a4fd3b3fae34f828ba5e], 2891) is a user-defined function.
  • the database owner sends the ciphertext SQL statement to the cloud service provider.
  • the query is executed in the library, and the user-defined function EqualityCom needs to be called during execution. After the query is completed, the ciphertext query result that meets the query conditions is obtained, as shown in FIG. 6.
  • the cloud service provider returns the ciphertext query result to the database owner.
  • the database owner decrypts it by means of the cryptographic module, and finally obtains the plaintext query result, as shown in Figure 7:
  • the database owner returns the plaintext query result to the end user.
  • the outsourced database query process ends.

Abstract

Disclosed is a method for processing security outsourcing data of a relational database supporting a ciphertext data operation. The method involves: 1) a database owner utilizing a private key to encrypt a database to be outsourced and then generate an outsourced ciphertext database, and sending same to a cloud service provider; 2) an authorized terminal user submitting, to the database owner, a plaintext data operation request in the form of an SQL statement; 3) the database owner converting a plaintext SQL statement of the data operation request into a ciphertext SQL statement set, and sending same to the cloud service provider; 4) the cloud service provider directly executing, on the outsourced ciphertext database, the ciphertext SQL statement, and if there is a query request, returning an obtained ciphertext query result to the database owner; and 5) the database owner receiving and decrypting the ciphertext query result, and returning a plaintext record to the terminal user. The present invention guarantees the data confidentiality and effective utilization of an outsourced relational database.

Description

一种支持密文数据操作的关系型数据库安全外包数据处理方法Relational database security outsourcing data processing method supporting ciphertext data operation 技术领域Technical field
本发明涉及一种支持密文数据操作的关系型数据库安全外包数据处理方法,属云计算安全和数据库安全领域。The invention relates to a relational database security outsourcing data processing method for supporting ciphertext data operations, which belongs to the field of cloud computing security and database security.
背景技术Background technique
目前,将私有的关系型数据库外包至云服务供应商,可以为商业团体以及个人用户带来巨大的便捷和收益,然而与此同时,外包数据库的安全和隐私问题日益严峻。云计算用户的敏感信息(例如金融交易记录、个人医疗档案等)正面临着不同程度的滥用和泄露。At present, outsourcing private relational databases to cloud service providers can bring huge convenience and benefits to business groups and individual users. At the same time, however, the security and privacy issues of outsourced databases are becoming more and more serious. Sensitive information of cloud computing users (such as financial transaction records, personal medical files, etc.) is facing different levels of abuse and disclosure.
公有云环境通常使用云端驱动的数据库加密技术抵御外部攻击者的恶意入侵,但是依然难以阻止不可信云服务供应商的内部攻击。因此,为避免云端加密可能会带来的隐私泄露的问题,云数据库加密应完全由数据库拥有者实施,从而真正地实现“加密后外包与查询后解密”的服务模式。Public cloud environments typically use cloud-driven database encryption to protect against malicious attacks by external attackers, but it is still difficult to prevent internal attacks from untrusted cloud service providers. Therefore, in order to avoid the problem of privacy leakage that cloud encryption may bring, cloud database encryption should be implemented entirely by the database owner, thus truly realizing the service mode of “encrypted outsourcing and post-query decryption”.
客户端加密主要面临两项难题:其一,选用何种加密算法对关系型数据库进行加密;其二,如何对加密后的密文关系型数据库执行数据操作。相关的研究已经取得了一系列重要的成果,包括全同态加密技术、部分同态加密技术等。更多的工作则围绕密文域等值查询、范围查询、聚合查询以及模糊查询中的一种或者多种而展开,然而其所支持的数据操作种类十分有限。某些综合的密文数据库查询方案能够支持部分基于SQL的查询操作,但是存在以下四点不足:Client encryption mainly faces two problems: first, which encryption algorithm is used to encrypt the relational database; and second, how to perform data operations on the encrypted ciphertext relational database. Related research has achieved a series of important results, including full homomorphic encryption technology, partial homomorphic encryption technology. More work is done around one or more of ciphertext domain equivalent queries, range queries, aggregate queries, and fuzzy queries, but the types of data operations it supports are very limited. Some comprehensive ciphertext database query schemes can support some SQL-based query operations, but there are four shortcomings:
(1)不同类型的SQL语句需调用不同的加密技术以完成解释,导致数据库服务性能降低;(1) Different types of SQL statements need to call different encryption technologies to complete the interpretation, resulting in reduced database service performance;
(2)云服务供应商无法直接执行SQL语句,云服务模式难以彻底摆脱对可信代理的依赖;(2) The cloud service provider cannot directly execute the SQL statement, and the cloud service model is difficult to completely get rid of the dependence on the trusted agent;
(3)云服务供应商执行数据操作前需获知解密密钥,尚未完全克服云端加密的安全风险;(3) The cloud service provider needs to know the decryption key before performing the data operation, and has not completely overcome the security risk of cloud encryption;
(4)终端用户的数据库访问模式以及云数据库的关系结构被迫发生变化。(4) The database access mode of the end user and the relational structure of the cloud database are forced to change.
发明内容Summary of the invention
针对现有技术中存在的问题,本发明的目的在于提供一种支持密文数据操作的关系型数据库安全外包数据处理方法。这种方法保护了关系型数据库在外包过程中的数据机密性及有效数据利用。所采用的客户端加密技术从根本上解决了云端加密的安全问题。图1是本发明的模块设计与总体架构。 In view of the problems existing in the prior art, an object of the present invention is to provide a relational database security outsourcing data processing method that supports ciphertext data operations. This method protects the data confidentiality and effective data utilization of the relational database in the outsourcing process. The client encryption technology adopted fundamentally solves the security problem of cloud encryption. 1 is a block design and overall architecture of the present invention.
本发明解决其技术问题所用的技术方案是:一种支持密文数据操作的关系型数据库安全外包数据处理方法(包括查询请求、插入请求、更新请求和删除请求)。该方法作用于终端用户、数据库拥有者和云服务供应商三者之间。关系型数据库在外包前由数据库拥有者负责加密,然后由云服务供应商在外包密文数据库上直接执行基于SQL的全类型数据操作,返回的查询结果则由数据库拥有者代替终端用户进行解密。具体地,本发明的方法流程为:The technical solution used by the present invention to solve the technical problem thereof is: a relational database security outsourcing data processing method (including a query request, an insert request, an update request, and a delete request) that supports ciphertext data operations. This approach works between end users, database owners, and cloud service providers. The relational database is encrypted by the database owner before outsourcing, and then the cloud service provider directly executes the SQL-based full-type data operation on the outsourced ciphertext database, and the returned query result is decrypted by the database owner instead of the end user. Specifically, the method flow of the present invention is:
1.数据库拥有者将关系型数据库安全外包至云服务供应商:1. The database owner outsources the relational database security to the cloud service provider:
(1)数据库拥有者生成私有密钥;(1) The database owner generates a private key;
(2)数据库拥有者经密码模块对待外包数据库进行加密后生成外包密文数据库,并发送至云服务供应商;(2) The database owner encrypts the outsourced database through the cryptographic module to generate an outsourced ciphertext database and sends it to the cloud service provider;
(3)云服务供应商接收并原地存储该外包密文数据库;(3) The cloud service provider receives and stores the outsourced ciphertext database in place;
(4)数据库拥有者在云服务供应商处创建用户自定义函数。(4) The database owner creates a user-defined function at the cloud service provider.
2.终端用户请求对关系型数据库进行隐私保护的数据操作:2. The end user requests data protection for the privacy protection of the relational database:
(1)终端用户登录数据库系统,并向数据库拥有者提交明文SQL语句;(1) The terminal user logs into the database system and submits the plaintext SQL statement to the database owner;
(2)数据库拥有者依据访问控制策略,判断查询请求是否已得到授权,如若非法访问,则拒绝操作;(2) The database owner determines whether the query request has been authorized according to the access control policy, and if the access is illegal, the operation is rejected;
(3)数据库拥有者经转换模块将明文SQL语句转换为密文SQL语句集合,发送至云服务供应商;(3) The database owner converts the plaintext SQL statement into a ciphertext SQL statement set by the conversion module and sends it to the cloud service provider;
(4)云服务供应商调用用户自定义函数,在密文数据库中执行密文SQL语句,并将密文查询结果返回至数据库拥有者;(4) The cloud service provider invokes the user-defined function, executes the ciphertext SQL statement in the ciphertext database, and returns the ciphertext query result to the database owner;
(5)数据库拥有者接收并解密查询结果集,向终端用户返回明文记录。(5) The database owner receives and decrypts the query result set and returns a plaintext record to the end user.
本发明的安全外包数据处理方法包括以下的五大模块:The security outsourcing data processing method of the present invention includes the following five modules:
(1)密码模块(OPEA算法),用于加密或解密外包数据库。OPEA算法的加密函数具有保序性和可加性,能够最大限度地保留数据的可操作性。将OPEA算法密文域划分为多个按照先后顺序排列的密文分区,图2是该密码模块的映射结构,第i个密文分区的上下边界被分别定义为Ui和Li。具体来看,图中所采用的一对多的映射结构将单一的明文值映射为某个密文分区内的多个密文值,用于构造OPEA算法的加密函数,从而改善密码模块的安全性以抵御惟密文攻击、统计攻击以及弱选择明文攻击。(1) A cryptographic module (OPEA algorithm) for encrypting or decrypting an outsourced database. The encryption function of the OPEA algorithm has order-preserving and additivity, which can maximize the operability of data. The ciphertext domain of the OPEA algorithm is divided into a plurality of ciphertext partitions arranged in order. FIG. 2 is a mapping structure of the cryptographic module, and upper and lower boundaries of the ith ciphertext partition are respectively defined as U i and L i . Specifically, the one-to-many mapping structure used in the figure maps a single plaintext value into multiple ciphertext values in a ciphertext partition, which is used to construct an encryption function of the OPEA algorithm, thereby improving the security of the cryptographic module. Sex to defend against ciphertext attacks, statistical attacks, and weakly selected plaintext attacks.
(2)转换模块(SQL-Translator解释器),用于转换待请求的明文SQL语句,同时确保经转换后得到的密文SQL语句可以在密文数据库中正常执行。图3是该转换模块的处理流程。 (2) The conversion module (SQL-Translator interpreter) is used to convert the plaintext SQL statement to be requested, and at the same time ensure that the ciphertext SQL statement obtained after the conversion can be executed normally in the ciphertext database. FIG. 3 is a processing flow of the conversion module.
(3)用户自定义函数,部署在云服务供应商,主要用于云端的等值比较、聚合比较、和值计算和字符串分割等操作。(3) User-defined functions, deployed in cloud service providers, are mainly used for operations such as equivalence comparison, aggregation comparison, and value calculation and string segmentation in the cloud.
(4)加密规则,整型数据直接使用OPEA算法进行加密;加密浮点型数据时,按明文空间的最小精度来划分密文空间;字符型数据按终端用户选定的最小匹配单元转为整型后依次加密、填充并拼接。具体到外包关系型数据库而言,明文空间就是数据库中全部数据组成的有限集合。(4) Encryption rules, the integer data is directly encrypted using the OPEA algorithm; when the floating point data is encrypted, the ciphertext space is divided according to the minimum precision of the plaintext space; the character data is converted to the whole matching unit according to the minimum matching unit selected by the end user. After the type, it is encrypted, filled and spliced. Specific to the outsourced relational database, the plaintext space is a finite set of all the data in the database.
(5)访问控制,选用不同的密钥加密具有不同保密级别的数据表或数据字段;已取得合法访问授权的终端用户可以通过共享用户口令登录数据库系统;数据库拥有者依据目前已登录用户的数据访问权限获取相应的加解密密钥。(5) Access control, using different keys to encrypt data tables or data fields with different security levels; terminal users who have obtained legal access authorization can log in to the database system through the shared user password; the database owner is based on the data of the currently logged-in user. Access rights get the corresponding encryption and decryption key.
本发明的有益效果是:The beneficial effects of the invention are:
(1)本发明解决了客户端加密的两项主要难题,保障了外包关系型数据库的数据机密性和有效利用。(1) The present invention solves two main problems of client encryption, and ensures data confidentiality and effective utilization of the outsourced relational database.
(2)本发明的总体架构适用于Microsoft Windows Azure SQL Database等未经修改的商业化云数据库平台。(2) The overall architecture of the present invention is applicable to an unmodified commercial cloud database platform such as Microsoft Windows Azure SQL Database.
(3)本发明仅需单次加密数据库,故存储开销更低,且数据访问模式与云数据库关系结构得以保留。(3) The present invention only needs to encrypt the database once, so the storage overhead is lower, and the relationship between the data access mode and the cloud database is preserved.
(4)本发明密码模块的OPEA算法能够抵御惟密文攻击、统计攻击以及弱选择明文攻击。其简化边界生成子算法、加密子算法和解密子算法的平均时间复杂度分别达到O(T),O(1)和O(log T),T是明文域的最大值,基本优于主流的对称密码算法。此外,OPEA算法的比较操作用时和网络通信开销忽略不计。密文域的噪声增长问题可通过调整密钥在常量级时间内得到有效控制。(4) The OPEA algorithm of the cryptographic module of the present invention can resist ciphertext attacks, statistical attacks, and weakly selected plaintext attacks. The average time complexity of the simplified boundary generation sub-algorithm, the encryption sub-algorithm and the decryption sub-algorithm reaches O(T), O(1) and O(log T), respectively, and T is the maximum value of the plaintext domain, which is basically superior to the mainstream. Symmetric cryptographic algorithm. In addition, the comparison operation time and network communication overhead of the OPEA algorithm are neglected. The noise growth problem in the ciphertext domain can be effectively controlled in a constant time by adjusting the key.
(5)本发明转换模块支持目前最多种类的SQL数据操作,涵盖等值查询、范围查询、聚合查询、模糊查询、插入、更新、删除等数据操作语句。SQL-Translator解释器的转换用时在微秒量级以内,并满足任意类型和长度的数据转换需求。(5) The conversion module of the present invention supports the current most types of SQL data operations, and includes data operation statements such as equivalence query, range query, aggregate query, fuzzy query, insert, update, and delete. The conversion time of the SQL-Translator interpreter is in the order of microseconds and satisfies the data conversion requirements of any type and length.
(6)本发明直接执行密文查询而无需解密外包数据,查询结果准确,无误判,无漏判。相同查询精度下,客户端后处理开销较低,总体查询效率较高。(6) The present invention directly executes the ciphertext query without decrypting the outsourced data, and the query result is accurate, without error judgment, and no miss judgment. With the same query precision, the client post-processing overhead is low, and the overall query efficiency is high.
附图说明DRAWINGS
图1为系统总体架构图。给出了本发明的模块设计、数据流向和参与者的作用范围。Figure 1 shows the overall architecture of the system. The module design, data flow direction and range of roles of the present invention are given.
图2为密码模块映射结构图。给出了OPEA算法的分区、间隔的划分方法以及明文域至 密文域的映射关系。Figure 2 is a cryptographic module mapping structure diagram. The division of the OPEA algorithm, the division method of the interval, and the plaintext domain are given. The mapping relationship of the ciphertext domain.
图3为转换模块处理流程图。给出了SQL-Translator解释器的工作流程,包含核心转换模块和子转换模块。Figure 3 is a flow chart of the conversion module processing. The workflow of the SQL-Translator interpreter is given, including the core conversion module and the sub-conversion module.
图4为待外包数据库示例;Figure 4 is an example of a database to be outsourced;
图5为外包密文数据库示例;Figure 5 is an example of an outsourced ciphertext database;
图6为密文查询结果示例;Figure 6 is an example of a ciphertext query result;
图7为解密后的明文查询结果示例。FIG. 7 is an example of the result of the plaintext query after decryption.
具体实施方式detailed description
下面结合附图对本发明作进一步说明。The invention will now be further described with reference to the accompanying drawings.
图1是系统总体架构图,主要涉及密码模块、转换模块和用户自定义函数三大核心服务模块。具体方法包括下列步骤:Figure 1 is the overall architecture of the system, mainly related to the three core service modules of the cryptographic module, the conversion module and the user-defined function. The specific method includes the following steps:
1.图2是密码模块映射结构图。密码模块的实现方法包括:1. Figure 2 is a cryptographic module mapping structure diagram. The implementation method of the cryptographic module includes:
(1)设计并实现具有可加性的保序加密算法OPEA,离散密文域由顺序密文分区构成,其加密函数E:X→Y满足下述两个条件(X和Y分别是OPEA的明文与密文空间;具体到外包数据库应用,明文空间是指明文数据库中全部数据组成的集合,密文空间是指密文数据库中全部数据组成的集合):(1) Design and implement an addendum encryption algorithm OPEA, the discrete ciphertext domain is composed of sequential ciphertext partitions, and its encryption function E:X→Y satisfies the following two conditions (X and Y are respectively OPEA) Plaintext and ciphertext space; specific to outsourced database applications, plaintext space is a collection of all data in the text database, and ciphertext space refers to a collection of all data in the ciphertext database):
a)
Figure PCTCN2017077109-appb-000001
a<b当且仅当E(a)<E(b);
a)
Figure PCTCN2017077109-appb-000001
a<b if and only if E(a) <E(b);
b)
Figure PCTCN2017077109-appb-000002
若a+b<c,则有E(a)+E(b)<E(c)。
b)
Figure PCTCN2017077109-appb-000002
If a+b<c, then E(a)+E(b)<E(c).
该算法由三个子算法构成:The algorithm consists of three sub-algorithms:
a)边界生成子算法BoundaryGen,输入随机的非负整数集合R={Ri}以及随机正整数σ>max1≤i≤T{Ri}-R1作为密钥,根据密钥计算并输出密文域的密文分区下边界集L={Li}={L[i]}(1≤i≤T)和上边界集U={Ui}={U[i]}(1≤i≤T)。其中,Ri是随机数集合中第i个元素,Li和L[i]是第i个密文分区的下边界,Ui和U[i]则是第i个密文分区的上边界。子算法首先设定首个密文分区[L1,U1],有L[1]=σ且U[1]=L[1]+R1,随后迭代地划定后续密文分区的上下边界值,要求满足L[t]=max1≤i<t{U[i]+U[t-i]}且U[t]=L[t]+Rt(2≤t≤T)。这里T是明文域的最大值,即明文数据库中全部数据的最大可能取值。a) Boundary generator algorithm BoundaryGen, input random non-negative integer set R={R i } and random positive integer σ>max 1≤i≤T {R i }-R 1 as key, calculate and output according to key The lower boundary set of the ciphertext partition of the ciphertext domain L={L i }={L]}(1≤i≤T) and the upper boundary set U={U i }={U[i]}(1≤ i ≤ T). Wherein, R i is a set of random numbers in the i th element, L i and L [i] is the i-th lower boundary ciphertext partitions, U i, and the U-[i] is the i-th upper boundary ciphertext partition . The sub-algorithm first sets the first ciphertext partition [L 1 , U 1 ], with L[1]=σ and U[1]=L[1]+R 1 , and then iteratively delimits the subsequent ciphertext partitions. The boundary value is required to satisfy L[t]=max 1≤i<t {U[i]+U[ti]} and U[t]=L[t]+R t (2≤t≤T). Here T is the maximum value of the plaintext domain, that is, the maximum possible value of all the data in the plaintext database.
b)加密子算法Enc,输入边界集和正整数明文m,输出集合{L[m],L[m]+1,…,U[m]}内的随机整数作为密文c=E(m)。加密子算法在加密明文值m时,根据密文分区的 边界集L和U,加密函数E(·)将会从集合{L[m],L[m]+1,…,U[m]}中选择并返回一个随机数作为密文值c。b) Encryption sub-algorithm Enc, input boundary set and positive integer plaintext m, output random set of {L[m], L[m]+1,...,U[m]} as ciphertext c=E(m) . The encryption sub-algorithm is based on the ciphertext partition when encrypting the plaintext value m. For the boundary sets L and U, the encryption function E(·) will select from the set {L[m], L[m]+1,...,U[m]} and return a random number as the ciphertext value c.
c)解密子算法Dec,输入边界集和密文c,借助折半查找算法输出密文c所属密文分区的编号作为明文值。c) Decryption sub-algorithm Dec, input boundary set and ciphertext c, and output the ciphertext partition number of ciphertext c as a plaintext value by means of a halved search algorithm.
(2)简化OPEA算法的边界生成子算法,令密钥Ri(1≤i≤T)以非降序排列,得到线性边界函数:(2) Simplify the boundary generation sub-algorithm of the OPEA algorithm, and arrange the keys R i (1 ≤ i ≤ T) in non-descending order to obtain a linear boundary function:
Figure PCTCN2017077109-appb-000003
Figure PCTCN2017077109-appb-000003
(3)扩展OPEA算法以判定密文关系E’(a)+E’(b)>E’(c),其中E’:X→Y’是扩展算法的加密函数。(3) The OPEA algorithm is extended to determine the ciphertext relationship E'(a) + E'(b) &gt; E'(c), where E': X → Y' is an encryption function of the spreading algorithm.
a)扩展的边界生成子算法BoundaryGen’,要求密钥σ>3·max1≤i≤T{Ri},根据密钥计算并输出密文分区的扩展上边界集U’={U’[i]}(1≤i≤T)以及扩展下边界集L’={L’[i]}(1≤i≤T)。扩展子算法划定首个密文分区U’[1]=σ且L’[1]=U’[1]-R1,后续密文分区应满足上边界U’[t]=min1≤i<t{L’[i]+L’[t-i]}且下边界L’[t]=U’[t]-Rt(Rt<U’[t]-U’[t-1],2≤t≤T),其线性边界函数为:a) The extended boundary generation sub-algorithm BoundaryGen' requires the key σ>3·max 1≤i≤T {R i } to calculate and output the extended upper boundary set U'={U'[ according to the key. i]}(1≤i≤T) and the extended lower boundary set L'={L'[i]}(1≤i≤T). The extended sub-algorithm delimits the first ciphertext partition U'[1]=σ and L'[1]=U'[1]-R 1 , and the subsequent ciphertext partition should satisfy the upper boundary U'[t]=min 1≤ i<t {L'[i]+L'[ti]} and the lower boundary L'[t]=U'[t]-R t (R t <U'[t]-U'[t-1] , 2 ≤ t ≤ T), the linear boundary function is:
Figure PCTCN2017077109-appb-000004
Figure PCTCN2017077109-appb-000004
b)扩展的加密子算法和扩展的解密子算法与Enc和Dec类似。b) The extended cipher sub-algorithm and the extended decryption sub-algorithm are similar to Enc and Dec.
(4)数据库拥有者使用OPEA算法对全部数据项进行加密,使用抗碰撞哈希函数或者对称密码技术对数据表名、列名等进行加密。(4) The database owner encrypts all data items using the OPEA algorithm, and encrypts the data table name, column name, and the like using an anti-collision hash function or a symmetric cryptography technique.
2.用户自定义函数的实现方法包括:2. User-defined function implementation methods include:
(1)数据库拥有者依据密钥以及查询请求中的待比较明文选取随机整数x∈[max{R1,R2},σ+R1),并发送至云服务供应商,其中R1=U[value1]-L[value1]和R2=U[value2]-L[value2]分别是待比较明文值value1和value2所对应的密文分区长度。(1) The database owner selects a random integer x∈[max{R 1 , R 2 }, σ+R 1 ) according to the key and the plaintext to be compared in the query request, and sends it to the cloud service provider, where R 1 = U[value 1 ]-L[value 1 ] and R 2 =U[value 2 ]-L[value 2 ] are the ciphertext partition lengths corresponding to the plaintext values value 1 and value 2 to be compared, respectively.
(2)设计并实现等值比较函数EqualityCom(x,E(value1),E(value2)),判定步骤为:(2) Design and implement the equivalence comparison function EqualityCom(x, E(value 1 ), E(value 2 )), and the decision step is:
a)若E(value1)和E(value2)的距离不大于x,则明文值相等,函数输出0,否则继续执行步骤b);a) If the distance between E(value 1 ) and E(value 2 ) is not greater than x, the plaintext values are equal, and the function outputs 0, otherwise step b) is continued;
b)若E(value1)大于E(value2),则value1大于value2,函数输出1;而若E(value1)小于E(value2),则value2大于value1,函数输出-1。b) If E(value 1 ) is greater than E(value 2 ), then value 1 is greater than value 2 and the function outputs 1; if E(value 1 ) is less than E(value 2 ), then value 2 is greater than value 1 and the function outputs - 1.
(3)设计出聚合比较函数
Figure PCTCN2017077109-appb-000005
L[value],U’[value]),
Figure PCTCN2017077109-appb-000006
是某数据库字段的数据项集合,SUM是求和函数,明文value与查询条件中的某个常量数值相对应,L[value]和U’[value]分别是value对应的密文分区下边界和扩展上边界。这里要求
Figure PCTCN2017077109-appb-000007
且R以非降序排列,判定步骤为:
(3) Designing an aggregate comparison function
Figure PCTCN2017077109-appb-000005
L[value], U'[value]),
Figure PCTCN2017077109-appb-000006
Is a collection of data items in a database field, SUM is a summation function, the plaintext value corresponds to a constant value in the query condition, L[value] and U'[value] are respectively the lower boundary of the ciphertext partition corresponding to the value Extend the upper boundary. Request here
Figure PCTCN2017077109-appb-000007
And R is arranged in non-descending order, and the decision step is:
a)若
Figure PCTCN2017077109-appb-000008
不大于L[value]且
Figure PCTCN2017077109-appb-000009
不小于U’[value],则
Figure PCTCN2017077109-appb-000010
与value相等,函数输出0,否则继续执行步骤b);
a) if
Figure PCTCN2017077109-appb-000008
Not greater than L[value] and
Figure PCTCN2017077109-appb-000009
Not less than U'[value], then
Figure PCTCN2017077109-appb-000010
Equal to value, the function outputs 0, otherwise continue to perform step b);
b)若
Figure PCTCN2017077109-appb-000011
大于U’[value],则
Figure PCTCN2017077109-appb-000012
大于value,函数输出1;而若
Figure PCTCN2017077109-appb-000013
小于L[value],则value大于
Figure PCTCN2017077109-appb-000014
函数输出-1。
b) if
Figure PCTCN2017077109-appb-000011
Greater than U'[value], then
Figure PCTCN2017077109-appb-000012
Greater than value, the function outputs 1;
Figure PCTCN2017077109-appb-000013
Less than L[value], value is greater than
Figure PCTCN2017077109-appb-000014
The function outputs -1.
(4)借助用户自定义函数SumEqualityCom,在数据库拥有者与云服务供应商之间部署安全和值计算协议。假设Att是某数据库字段的数据项集合,协议步骤为:(4) Deploy security and value calculation protocols between the database owner and the cloud service provider with the user-defined function SumEqualityCom. Assuming that Att is a collection of data items for a database field, the protocol steps are:
a)云服务供应商计算SUM(E(Att))和SUM(E’(Att)),并将密文累加结果发送至数据库拥有者;a) The cloud service provider calculates SUM(E(Att)) and SUM(E'(Att)) and sends the ciphertext accumulation result to the database owner;
b)数据库拥有者解密得到d=Dec(SUM(E(Att)),L)和d’=Dec(SUM(E’(Att)),U’);b) The database owner decrypts d=Dec(SUM(E(Att)), L) and d'=Dec(SUM(E'(Att)), U');
c)若d与d’相等,则数据库拥有者获知SUM(Att)=d,并将E(SUM(Att))=SUM(E(Att))返回云服务供应商。协议结束。c) If d is equal to d', the database owner knows SUM(Att)=d and returns E(SUM(Att))=SUM(E(Att)) to the cloud service provider. The agreement is over.
d)否则,数据库拥有者将会继续尝试寻找能够使得SumEqualityCom(SUM(E(Att)),SUM(E’(Att)),L[d+i],U’[d+i])=0成立的整数i(0≤i≤d’-d),从而获知SUM(Att)=d+i,并将E(d+i)返回云服务供应商。协议结束。d) Otherwise, the database owner will continue to try to find SumEqualityCom(SUM(E(Att)), SUM(E'(Att)), L[d+i], U'[d+i])=0 The established integer i (0 ≤ i ≤ d'-d), so that SUM (Att) = d + i is known, and E (d + i) is returned to the cloud service provider. The agreement is over.
(5)设计并实现字符串分割函数Split(str,delimiter),str是待分割的LIKE运算符的密文搜索模式串,delimiter是分隔符,分割后的结果采用Table类型存储并返回。(5) Design and implement the string splitting function Split(str, delimiter), str is the ciphertext search pattern string of the LIKE operator to be split, delimiter is the separator, and the split result is stored and returned by the Table type.
3.图3是转换模块处理流程图。转换模块的实现方法包括:3. Figure 3 is a flow chart of the conversion module processing. The implementation method of the conversion module includes:
(1)针对经OPEA算法加密的外包数据库,设计并实现SQL-Translator解释器,采用标准Transact-SQL数据操作语句作为输入。这里假设tbl是明文库某数据表名,Att、Att1、Att2是明文库某字段的数据项集合,val、val1、val2是常量数值,*C是密文域对应的数据库对象。(1) Design and implement the SQL-Translator interpreter for the outsourced database encrypted by the OPEA algorithm, using standard Transact-SQL data manipulation statements as input. Here, it is assumed that tbl is a data table name of Ming Library, and Att, Att 1 and Att 2 are data item sets of a field of Ming Library, val, val 1 and val 2 are constant values, and * C is a database object corresponding to the ciphertext field.
(2)转换明文数据操作语句中的数据库实体,转换规则为:(2) Convert the database entity in the plaintext data operation statement, the conversion rule is:
a)数据表名、列名使用抗碰撞哈希函数或对称加密技术进行匿名化转换;a) The data table name and column name are anonymized using an anti-collision hash function or a symmetric encryption technique;
b)常量值使用OPEA算法进行转换。b) Constant values are converted using the OPEA algorithm.
(3)划分转换后的数据操作语句为最小转换单元,其中包含完整谓词表达式或子句结构。(3) Dividing the converted data operation statement into a minimum conversion unit, which includes a complete predicate expression or clause structure.
(4)依次为最小转换单元调用相应的子转换模块。其中,子转换模块i与最小转换单元i对应,设有该最小转换单元i的转换规则,将其转换为对应的密文SQL子句。针对查询、插入、更新、删除四类数据操作语句,表1详述了其最小转换单元的转换规则。 (4) The corresponding sub-conversion module is called in turn for the minimum conversion unit. The sub-conversion module i corresponds to the minimum conversion unit i, and the conversion rule of the minimum conversion unit i is provided, and is converted into a corresponding ciphertext SQL clause. For the four types of data operation statements of query, insert, update, and delete, Table 1 details the conversion rules of the minimum conversion unit.
表1为最小转换单元的转换规则Table 1 shows the conversion rules for the minimum conversion unit.
Figure PCTCN2017077109-appb-000015
Figure PCTCN2017077109-appb-000015
Figure PCTCN2017077109-appb-000016
Figure PCTCN2017077109-appb-000016
表1中各转换规则具体描述如下:The conversion rules in Table 1 are described as follows:
■对于查询操作语句:形如SELECT<Att1,Att2,…>FROM<tbl>的查询操作语句直接转换为■ For query operation statements: Query operation statements of the form SELECT<Att 1 , Att 2 ,...>FROM<tbl> are directly converted to
SELECT<Att1 C,Att2 C,…>FROM<tblC>SELECT<Att 1 C ,Att 2 C ,...>FROM<tbl C >
其余子句的转换规则如下,其中规定整数x∈[max1≤i≤T{Ri},σ+R1):The conversion rules of the remaining clauses are as follows, where the integer x ∈ [max 1 i ≤ T {R i }, σ + R 1 ) is specified:
Figure PCTCN2017077109-appb-000017
WHERE子句
Figure PCTCN2017077109-appb-000017
WHERE clause
形如Att1=Att2的比较运算符表达式直接转换为EqualityCom(x,Att1 C,Att2 C)=0。A comparison operator expression of the form Att 1 =Att 2 is directly converted to EqualityCom(x,Att 1 C ,Att 2 C )=0.
形如Att1>Att2的比较运算符表达式直接转换为EqualityCom(x,Att1 C,Att2 C)>0。 The comparison operator expression of the form Att 1 >Att 2 is directly converted to EqualityCom(x,Att 1 C ,Att 2 C )>0.
形如Att1<Att2的比较运算符表达式直接转换为EqualityCom(x,Att1 C,Att2 C)<0。A comparison operator expression of the form Att 1 <Att 2 is directly converted to EqualityCom(x, Att 1 C , Att 2 C )<0.
同理,比较运算符<>,!=,!>,<=,!<,>=的转换规则可通过组合上述规则而得到。Similarly, the comparison operator <>,! =,! >,<=,! The conversion rule of <, >= can be obtained by combining the above rules.
形如Att BETWEEN Att1 AND Att2的BETWEEN运算符表达式直接转换为The BETWEEN operator expression of the form Att BETWEEN Att 1 AND Att 2 is directly converted to
EqualityCom(x,AttC,Att1 C)>=0∧EqualityCom(x,AttC,Att2 C)<=0EqualityCom(x,Att C ,Att 1 C )>=0∧EqualityCom(x,Att C ,Att 2 C )<=0
形如AttNOT BETWEEN Att1 AND Att2的NOT BETWEEN运算符表达式直接转换为The NOT BETWEEN operator expression of the form AttNOT BETWEEN Att 1 AND Att 2 is directly converted to
EqualityCom(x,AttC,Att1 C)<0∨EqualityCom(x,AttC,Att2 C)>0EqualityCom(x,Att C ,Att 1 C )<0∨EqualityCom(x,Att C ,Att 2 C )>0
形如Att IN(Att1,Att2,…)的IN运算符表达式直接转换为The IN operator expression of the form Att IN (Att 1 , Att 2 , ...) is directly converted to
EqualityCom(x,AttC,Att1 C)=0∨EqualityCom(x,AttC,Att2 C)=0∨…EqualityCom(x,Att C ,Att 1 C )=0∨EqualityCom(x,Att C ,Att 2 C )=0∨...
形如AttNOT IN(Att1,Att2,…)的NOT IN运算符表达式直接转换为The NOT IN operator expression of the form AttNOT IN (Att 1 , Att 2 , ...) is directly converted to
EqualityCom(x,AttC,Att1 C)!=0∧EqualityCom(x,AttC,Att2 C)!=0∧…EqualityCom(x,Att C ,Att 1 C )! =0∧EqualityCom(x,Att C ,Att 2 C )! =0∧...
形如Att IS NULL的IS运算符表达式直接转换为An IS operator expression of the form Att IS NULL is directly converted to
EqualityCom(x,AttC,NULLC)=0EqualityCom(x,Att C ,NULL C )=0
形如Att IS NOT NULL的IS NOT运算符表达式直接转换为An IS NOT operator expression of the form Att IS NOT NULL is directly converted to
EqualityCom(x,AttC,NULLC)!=0EqualityCom(x,Att C ,NULL C )! =0
对于形如Att[NOT]LIKE pat[ESCAPE esch]的LIKE运算符,逐步采用如下的转换方式:为Att增加临时列Att_Match;根据转义符esch转义通配符并以OPEA算法加密普通字符;声明外层游标匹配数据项长度;以Split函数将搜索模式串pat分割为3部分,并分别生成起始、中间和结束部分的匹配条件,使用AND或OR拼接各个匹配条件;声明内层游标匹配当前数据项的密文字符串;更新Att_Match列以及查询条件。LIKE运算符的转换结果由上述转换步骤所需的全部SQL语句构成。For the LIKE operator of the form Att[NOT]LIKE pat[ESCAPE esch], the following conversion methods are gradually adopted: add the temporary column Att_Match for Att; escape the wildcard according to the escape character esch and encrypt the ordinary characters with the OPEA algorithm; The layer cursor matches the length of the data item; the search mode string pat is divided into 3 parts by the Split function, and the matching conditions of the start, the middle, and the end part are respectively generated, and each matching condition is spliced using AND or OR; the inner layer cursor is declared to match the current data. The ciphertext string of the item; updates the Att_Match column and the query criteria. The conversion result of the LIKE operator consists of all the SQL statements required for the above conversion steps.
对于形如s1WHERE EXISTS(s2)的子查询语句,其中s1和s2是SELECT语句,逐步采用如下的转换方式:转换内层查询s2,其查询结果存入临时表#INTER_TABLE2;将外层查询转换为s1WHERE EXISTS(SELECT*FROM #INTER_TABLE2)。子查询语句的转换结果由上述转换步骤所需的全部SQL语句构成。同理,NOT EXISTS型子查询与运算符型子查询的转换规则与此相同。For a subquery of the form s 1 WHERE EXISTS (s 2 ), where s 1 and s 2 are SELECT statements, the following conversion methods are gradually adopted: converting the inner query s 2 , and the query result is stored in the temporary table #INTER_TABLE2; Convert the outer query to s 1 WHERE EXISTS(SELECT*FROM #INTER_TABLE2). The conversion result of the subquery statement is composed of all the SQL statements required for the above conversion step. Similarly, the conversion rules for NOT EXISTS subqueries and operator subqueries are the same.
对于查询条件con1和con2而言,有以下转换规则:For the query conditions con 1 and con 2 , there are the following conversion rules:
形如con1 AND con2的组合查询条件直接转换为con1 C∧con2 CThe combined query condition of the form con 1 AND con 2 is directly converted to con 1 C ∧con 2 C .
形如con1 OR con2的组合查询条件直接转换为con1 C∨con2 CThe combined query condition of the form con 1 OR con 2 is directly converted to con 1 C ∨con 2 C .
Figure PCTCN2017077109-appb-000018
ORDER BY子句
Figure PCTCN2017077109-appb-000018
ORDER BY clause
形如ORDER BY Att1,Att2,…[ASC|DESC]的ORDER BY子句直接转换为 The ORDER BY clause of the form ORDER BY Att 1 , Att 2 ,...[ASC|DESC] is directly converted to
ORDER BY Att1 C,Att2 C,…[ASC|DESC]ORDER BY Att 1 C ,Att 2 C ,...[ASC|DESC]
在密文SQL语句执行过程中,云服务供应商首先以EqualityCom函数判定出Att1 C中属性值相同的记录,然后再按照Att2 C进行排序。During the execution of the ciphertext SQL statement, the cloud service provider first determines the records with the same attribute values in Att 1 C using the EqualityCom function, and then sorts them according to Att 2 C.
Figure PCTCN2017077109-appb-000019
GROUP BY子句
Figure PCTCN2017077109-appb-000019
GROUP BY clause
对于形如GROUP BY Att的GROUP BY子句,逐步采用如下的方式转换:对Att列进行自连接查询,满足查询条件的结果存入临时表#TEM;转换为临时表内查询GROUP BY AttC。GROUP BY子句的转换结果由上述转换步骤所需的全部SQL语句构成。For the GROUP BY clause of the form GROUP BY Att, the following methods are used to convert: the self-join query is performed on the Att column, and the result of satisfying the query condition is stored in the temporary table #TEM; the query is converted into the temporary table query GROUP BY Att C. The result of the conversion of the GROUP BY clause consists of all the SQL statements required for the above conversion steps.
Figure PCTCN2017077109-appb-000020
HAVING子句
Figure PCTCN2017077109-appb-000020
HAVING clause
形如MIN(Att)的聚合函数直接转换为MIN(AttC)。An aggregate function of the form MIN(Att) is directly converted to MIN(Att C ).
形如MAX(Att)的聚合函数直接转换为MAX(AttC)。An aggregate function of the form MAX(Att) is directly converted to MAX(Att C ).
形如COUNT(Att)的聚合函数直接转换为COUNT(AttC)。An aggregate function of the form COUNT(Att) is directly converted to COUNT(Att C ).
对于形如SUM(Att)的聚合函数,则转换为云服务供应商与数据库拥有者之间的安全和值计算协议,借助该协议最终计算得到E(SUM(Att))。For an aggregate function of the form SUM(Att), it is converted into a security and value calculation protocol between the cloud service provider and the database owner, by which the E(SUM(Att)) is finally calculated.
形如AVG(Att)的聚合函数直接转换为E(SUM(Att))/COUNT(AttC)。An aggregate function of the form AVG(Att) is directly converted to E(SUM(Att))/COUNT(Att C ).
■对于插入操作语句:形如INSERT INTO<tbl>(<Att1,Att2,…>)VALUES(val1,val2,…)的插入操作语句直接转换为■ For insert operation statements: insert operation statements of the form INSERT INTO<tbl>(<Att 1 ,Att 2 ,...>)VALUES(val 1 ,val 2 ,...) are directly converted to
INSERT INTO<tblC>(<Att1 C,Att2 C,…>)VALUES(E(val1),E(val2),…)INSERT INTO<tbl C >(<Att 1 C ,Att 2 C ,...>)VALUES(E(val 1 ),E(val 2 ),...)
同理,对于插入操作语句中包含的子查询语句,其转换规则与查询操作语句相同。Similarly, for a subquery statement contained in an insert operation statement, the conversion rule is the same as the query operation statement.
■对于更新操作语句:形如UPDATE<tbl>SET<Att>=val的更新操作语句直接转换为■ For the update operation statement: the update operation statement of the form UPDATE<tbl>SET<Att>=val is directly converted to
UPDATE<tblC>SET<AttC>=E(val)UPDATE<tbl C >SET<Att C >=E(val)
同理,对于更新操作语句中由FROM子句和WHERE子句指定的更新条件,其转换规则与查询操作语句的查询条件相同。Similarly, for the update condition specified by the FROM clause and the WHERE clause in the update operation statement, the conversion rule is the same as the query condition of the query operation statement.
■对于删除操作语句:形如DELETE FROM<tbl>的删除操作语句直接转换为■ For the delete operation statement: the delete operation statement of the form DELETE FROM <tbl> is directly converted to
DELETE FROM<tblC>DELETE FROM<tbl C >
同理,对于删除操作语句中由WHERE子句指定的删除条件,其转换规则与查询操作语句中的查询条件相同。Similarly, for the delete condition specified by the WHERE clause in the delete operation statement, the conversion rule is the same as the query condition in the query operation statement.
(5)对转换得到的密文SQL子句进行拼接和排列,得到完整的密文SQL语句,并使其保留相同语义。例如对于下述明文查询语句: (5) Splicing and arranging the converted ciphertext SQL clauses to obtain a complete ciphertext SQL statement and retaining the same semantics. For example, the following plaintext query:
SELECT Att1 FROM tbl WHERE Att1=Att2ORDER BY Att1 SELECT Att 1 FROM tbl WHERE Att 1 =Att 2 ORDER BY Att 1
GROUP BY Att1HAVING SUM(Att2)>valGROUP BY Att 1 HAVING SUM(Att 2 )>val
经SQL-Translator转换后拼接排列得到下述密文查询语句:After the SQL-Translator conversion, the following ciphertext query statements are obtained by splicing and arranging:
SELECT Att1 C FROM tblC WHERE EqualityCom(x,Att1 C,Att2 C)=0 ORDER BY Att1 CGROUPSELECT Att 1 C FROM tbl C WHERE EqualityCom(x,Att 1 C ,Att 2 C )=0 ORDER BY Att 1 C GROUP
BY Att1 CHAVING SumEqualityCom(SUM(E(Att2)),SUM(E’(Att2)),L[val],U’[val])>0BY Att 1 C HAVING SumEqualityCom(SUM(E(Att 2 )), SUM(E'(Att 2 )), L[val], U'[val])>0
(6)输出可以直接在外包密文数据库上执行的密文SQL语句。(6) Output ciphertext SQL statements that can be executed directly on the outsourced ciphertext database.
下面给出本发明的一个具体实施例。A specific embodiment of the present invention is given below.
1.假设数据库拥有者的明文数据库由一个名为EXAMPLE的数据表组成。表中包含两个明文字段(或称明文属性列),列名分别为C_CUSTKEY和C_NATIONKEY。表中共有5条明文记录(即5行数据),如图4所示。1. Assume that the database owner's plaintext database consists of a data table named EXAMPLE. The table contains two plaintext fields (or plaintext attribute columns) with column names C_CUSTKEY and C_NATIONKEY. There are 5 plaintext records (ie 5 rows of data) in the table, as shown in Figure 4.
2.数据库拥有者借助密码模块对该明文数据库进行加密处理,并将加密后得到的密文数据库发送至云服务供应商。明文数据库中名为EXAMPLE的明文数据表对应密文数据库中名为[8e3b72508e05135569ace4ed9b96d137]的密文数据表,表中共5条密文记录,如图5所示;其中,d0d0a493e28066e951fa7a980e81cb05和4eed023b3ef2a4fd3b3fae34f828ba5e分别是使用抗碰撞哈希函数对明文列名C_CUSTKEY和C_NATIONKEY进行加密处理后得到的密文列名。第一行的密文数据项121和4423则分别是使用OPEA算法对明文数据库第一行的明文数据项1和15逐一加密后得到的密文值。2. The database owner encrypts the plaintext database by means of the cryptographic module, and sends the encrypted ciphertext database to the cloud service provider. The plaintext data table named EXAMPLE in the plaintext database corresponds to the ciphertext data table named [8e3b72508e05135569ace4ed9b96d137] in the ciphertext database, and there are 5 ciphertext records in the table, as shown in Fig. 5; wherein d0d0a493e28066e951fa7a980e81cb05 and 4eed023b3ef2a4fd3b3fae34f828ba5e are respectively used for anti-collision The ciphertext column name obtained by encrypting the plaintext column names C_CUSTKEY and C_NATIONKEY by the hash function. The ciphertext data items 121 and 4423 of the first line are respectively ciphertext values obtained by encrypting the plaintext data items 1 and 15 of the first line of the plaintext database one by one using the OPEA algorithm.
3.假设终端用户提出下述查询操作请求(即明文SQL语句):3. Assume that the end user proposes the following query operation request (ie plaintext SQL statement):
SELECT*FROM EXAMPLE WHERE C_NATIONKEY>10SELECT*FROM EXAMPLE WHERE C_NATIONKEY>10
终端用户请求从EXAMPLE表中查询出C_NATIONKEY值大于10的数据记录。其中C_NATIONKEY>10是查询条件,查询结果应返回两条明文记录(1,15)和(2,13)。The end user requests to query the data record with a C_NATIONKEY value greater than 10 from the EXAMPLE table. Where C_NATIONKEY>10 is the query condition, and the query result should return two plaintext records (1, 15) and (2, 13).
4.数据库拥有者借助转换模块对该明文SQL语句进行转换处理,得到密文SQL语句:4. The database owner converts the plaintext SQL statement by means of the conversion module to obtain the ciphertext SQL statement:
SELECT*FROM[8e3b72508e05135569ace4ed9b96d137]SELECT*FROM[8e3b72508e05135569ace4ed9b96d137]
WHERE EqualityCom(100,[4eed023b3ef2a4fd3b3fae34f828ba5e],2891)>0WHERE EqualityCom(100,[4eed023b3ef2a4fd3b3fae34f828ba5e], 2891)>0
其中EqualityCom(100,[4eed023b3ef2a4fd3b3fae34f828ba5e],2891)是用户自定义函数。EXAMPLEC=[8e3b72508e05135569ace4ed9b96d137],x=100,C_NATIONKEYC=[4eed023b3ef2a4fd3b3fae34f828ba5e],E(10)=2891。Among them EqualityCom (100, [4eed023b3ef2a4fd3b3fae34f828ba5e], 2891) is a user-defined function. EXAMPLE C = [8e3b72508e05135569ace4ed9b96d137], x=100, C_NATIONKEY C = [4eed023b3ef2a4fd3b3fae34f828ba5e], E(10)=2891.
5.数据库拥有者将密文SQL语句发送至云服务供应商。由云服务供应商负责在密文数据 库中执行查询,执行过程中需要调用用户自定义函数EqualityCom。查询结束后得到符合查询条件的密文查询结果,如图6所示。5. The database owner sends the ciphertext SQL statement to the cloud service provider. Responsible for ciphertext data by cloud service provider The query is executed in the library, and the user-defined function EqualityCom needs to be called during execution. After the query is completed, the ciphertext query result that meets the query conditions is obtained, as shown in FIG. 6.
6.云服务供应商将该密文查询结果返回给数据库拥有者。数据库拥有者借助密码模块对其进行解密处理,最终得到明文查询结果,如图7所示:6. The cloud service provider returns the ciphertext query result to the database owner. The database owner decrypts it by means of the cryptographic module, and finally obtains the plaintext query result, as shown in Figure 7:
7.数据库拥有者将该明文查询结果返回给终端用户。外包数据库查询过程结束。 7. The database owner returns the plaintext query result to the end user. The outsourced database query process ends.

Claims (10)

  1. 一种支持密文数据操作的关系型数据库安全外包数据处理方法,其步骤为:A relational database security outsourcing data processing method supporting ciphertext data operation, the steps of which are:
    (1)数据库拥有者利用私有密钥对待外包数据库进行加密后生成外包密文数据库,并将其发送至云服务供应商;(1) The database owner encrypts the outsourced database with the private key to generate an outsourced ciphertext database and sends it to the cloud service provider;
    (2)终端用户通过其口令登录数据库系统,并以SQL语句的形式向该数据库拥有者提交明文数据操作请求;(2) The end user logs in to the database system through its password, and submits a plaintext data operation request to the database owner in the form of a SQL statement;
    (3)该数据库拥有者依据访问控制策略,判断该数据操作请求是否已得到授权,如若非法访问,则拒绝操作;若为合法访问,则将该数据操作请求的明文SQL语句转换为密文SQL语句集合,并发送至该云服务供应商;(3) The owner of the database determines whether the data operation request has been authorized according to the access control policy, and if the access is illegal, the operation is rejected; if the access is legal, the plaintext SQL statement of the data operation request is converted into the ciphertext SQL. a collection of statements and sent to the cloud service provider;
    (4)该云服务供应商在该外包密文数据库上直接执行该密文SQL语句;若为查询请求,则将得到的密文查询结果返回至该数据库拥有者;(4) the cloud service provider directly executes the ciphertext SQL statement on the outsourced ciphertext database; if it is a query request, returns the obtained ciphertext query result to the database owner;
    (5)该数据库拥有者接收并解密该密文查询结果,向该终端用户返回明文记录。(5) The database owner receives and decrypts the ciphertext query result, and returns a plaintext record to the end user.
  2. 如权利要求1所述的方法,其特征在于,步骤(1)中,对待外包数据库进行加密的方法为:设计并实现具有可加性的保序加密算法OPEA,对待外包数据库中的全部数据项进行加密,并使用抗碰撞哈希函数或者对称密码技术对待外包数据库中的数据表名、列名进行加密;其中,该保序加密算法OPEA中采用顺序密文分区构成离散密文域,其加密函数E:X→Y满足条件a)和b);X和Y分别是OPEA算法的明文与密文空间;The method according to claim 1, wherein in the step (1), the method for encrypting the outsourced database is: designing and implementing an addendaic encryption algorithm OPEA, and treating all data items in the outsourced database. Encryption is performed, and the data table name and column name in the outsourced database are encrypted by using an anti-collision hash function or a symmetric cryptographic technique; wherein the sequence encryption algorithm OPEA uses a sequential ciphertext partition to form a discrete ciphertext domain, and the encryption is performed. The function E:X→Y satisfies the conditions a) and b); X and Y are the plaintext and ciphertext spaces of the OPEA algorithm, respectively;
    a)
    Figure PCTCN2017077109-appb-100001
    b∈X,a<b当且仅当E(a)<E(b);
    a)
    Figure PCTCN2017077109-appb-100001
    b∈X, a<b if and only if E(a) <E(b);
    b)
    Figure PCTCN2017077109-appb-100002
    b,c∈X,若a+b<c,则有E(a)+E(b)<E(c)。
    b)
    Figure PCTCN2017077109-appb-100002
    b, c∈X, if a+b<c, then E(a)+E(b)<E(c).
  3. 如权利要求2所述的方法,其特征在于,该保序加密算法OPEA包括边界生成子算法、加密子算法和解密子算法,其中:The method according to claim 2, wherein the order-preserving encryption algorithm OPEA comprises a boundary generation sub-algorithm, an encryption sub-algorithm and a decryption sub-algorithm, wherein:
    a)边界生成子算法为:输入随机非负整数集R={Ri}和随机正整数σ>max1≤i≤T{Ri}-R1作为密钥,设定首个密文分区[L1,U1],满足L[1]=σ且U[1]=L[1]+R1;随后迭代地划定后续密文分区的边界值,满足L[t]=max1≤i<t{U[i]+U[t-i]}且U[t]=L[t]+Rt,输出密文域的密文分区下边界集L={Li}={L[i]}和上边界集U={Ui}={U[i]};其中,1≤i≤T,2≤t≤T,T是明文域的最大值;Ri是集合R中的第i个元素,Li和L[i]是第i个密文分区的下边界,Ui和U[i]是第i个密文分区的上边界;a) The boundary generation sub-algorithm is: input a random non-negative integer set R={R i } and a random positive integer σ>max 1≤i≤T {R i }-R 1 as a key, and set the first ciphertext partition [L 1 , U 1 ], satisfying L[1]=σ and U[1]=L[1]+R 1 ; then iteratively delineating the boundary value of the subsequent ciphertext partition, satisfying L[t]=max 1 ≤ i <t {U[i]+U[ti]} and U[t]=L[t]+R t , the lower boundary set of the ciphertext partition of the output ciphertext domain L={L i }={L[ i]} and the upper boundary set U={U i }={U[i]}; where 1≤i≤T, 2≤t≤T, T is the maximum value of the plaintext domain; R i is the set R The i-th element, L i and L[i] are the lower boundary of the i-th ciphertext partition, U i and U[i] are the upper boundaries of the i-th ciphertext partition;
    b)加密子算法为:输入边界集L、U和正整数明文m,输出密文c=E(m);在加密明文值 m时,采用一对多的映射结构,根据密文分区的边界集L和U,加密函数E(·)将会从集合{L[m],L[m]+1,…,U[m]}中选择并返回一个随机整数作为密文值c;b) The encryption sub-algorithm is: input boundary set L, U and positive integer plaintext m, output ciphertext c=E(m); in encrypted plaintext value m, using a one-to-many mapping structure, according to the boundary set L and U of the ciphertext partition, the encryption function E(·) will be from the set {L[m], L[m]+1,...,U[m ]} selects and returns a random integer as the ciphertext value c;
    c)解密子算法为:输入边界集L、U和密文c,借助折半查找算法输出密文c所属密文分区的编号作为明文值。c) The decryption sub-algorithm is: input boundary set L, U and ciphertext c, and output the ciphertext partition number of the ciphertext c as a plaintext value by means of a binary search algorithm.
  4. 如权利要求3所述的方法,其特征在于,简化OPEA算法的边界生成子算法为:令密钥Ri(1≤i≤T)以非降序排列,得到其线性边界函数
    Figure PCTCN2017077109-appb-100003
    U[t]=L[t]+Rt,1≤t≤T;然后利用该线性边界函数生成边界集L和U。
    The method according to claim 3, wherein the boundary generation sub-algorithm of the simplified OPEA algorithm is such that the keys R i (1 ≤ i ≤ T) are arranged in non-descending order to obtain a linear boundary function thereof.
    Figure PCTCN2017077109-appb-100003
    U[t]=L[t]+R t , 1≤t≤T; then the boundary set L and U are generated using the linear boundary function.
  5. 如权利要求3所述的方法,其特征在于,扩展OPEA算法的边界生成子算法为:令密钥σ>3·max1≤i≤T{Ri},设定首个密文分区U’[1]=σ且L’[1]=U’[1]-R1,后续密文分区应满足上边界U’[t]=min1≤i<t{L’[i]+L’[t-i]}且下边界L’[t]=U’[t]-Rt(Rt<U’[t]-U’[t-1]);其线性边界函数为
    Figure PCTCN2017077109-appb-100004
    L’[t]=U’[t]-Rt,1≤t≤T;得到扩展上边界集U’={U’[i]}和扩展下边界集L’={L’[i]},其中,2≤t≤T,1≤i≤T;OPEA扩展算法的加密函数为E’:X→Y’,满足条件a)和b);X和Y’分别是OPEA扩展算法的明文与密文空间;
    The method according to claim 3, wherein the boundary generation sub-algorithm of the extended OPEA algorithm is: setting a key σ>3·max 1≤i≤T {R i }, and setting a first ciphertext partition U' [1]=σ and L'[1]=U'[1]-R 1 , the subsequent ciphertext partition should satisfy the upper boundary U'[t]=min 1≤i<t {L'[i]+L' [ti]} and the lower boundary L'[t]=U'[t]-R t (R t <U'[t]-U'[t-1]); its linear boundary function is
    Figure PCTCN2017077109-appb-100004
    L'[t]=U'[t]-R t ,1≤t≤T; obtain the extended upper boundary set U'={U'[i]} and the extended lower boundary set L'={L'[i] }, where 2≤t≤T,1≤i≤T; the encryption function of the OPEA extension algorithm is E':X→Y', which satisfies the conditions a) and b); X and Y' are the plaintext of the OPEA extension algorithm, respectively And ciphertext space;
    a)
    Figure PCTCN2017077109-appb-100005
    b∈X,a<b当且仅当E’(a)<E’(b);
    a)
    Figure PCTCN2017077109-appb-100005
    b∈X, a<b if and only if E'(a)<E'(b);
    b)
    Figure PCTCN2017077109-appb-100006
    b,c∈X,若a+b>c,则有E’(a)+E’(b)>E’(c)。
    b)
    Figure PCTCN2017077109-appb-100006
    b, c∈X, if a+b>c, then E'(a)+E'(b)>E'(c).
  6. 如权利要求2或3所述的方法,其特征在于,该保序加密算法OPEA的加密规则为:整型数据直接加密;加密浮点型数据时,按明文空间的最小精度来划分密文空间;字符型数据按最小匹配单元转为整型后依次加密、填充并拼接。The method according to claim 2 or 3, wherein the encryption rule of the sequence-preserving encryption algorithm OPEA is: direct encryption of integer data; when encrypting floating-point data, the ciphertext space is divided according to the minimum precision of the plaintext space. The character data is encrypted, filled, and spliced in turn by the smallest matching unit.
  7. 如权利要求1所述的方法,其特征在于,步骤(3)中,将该数据操作请求的明文SQL语句转换为密文SQL语句集合的方法为:The method according to claim 1, wherein in the step (3), the method for converting the plaintext SQL statement of the data operation request into the ciphertext SQL statement set is:
    (31)针对该外包密文数据库设计并实现SQL-Translator解释器;(31) designing and implementing an SQL-Translator interpreter for the outsourced ciphertext database;
    (32)利用SQL-Translator解释器转换明文SQL语句中的数据库实体,转换规则为:(32) Using the SQL-Translator interpreter to convert the database entities in the plaintext SQL statement, the conversion rules are:
    a)数据表名、列名使用抗碰撞哈希函数或对称加密技术进行匿名化转换;a) The data table name and column name are anonymized using an anti-collision hash function or a symmetric encryption technique;
    b)常量值使用OPEA算法进行转换;b) the constant value is converted using the OPEA algorithm;
    (33)划分转换后的SQL语句为最小转换单元,其中包含完整谓词表达式或子句结构;(33) dividing the converted SQL statement into a minimum conversion unit, which includes a complete predicate expression or a clause structure;
    (34)依次为最小转换单元调用相应的子转换模块,并对转换得到的密文SQL子句进行拼接、排列,得到完整的密文SQL语句;其中,子转换模块i与最小转换单元i对应,设有该最小转换单元i的转换规则,将其转换为对应的密文SQL子句。 (34) sequentially invoking the corresponding sub-conversion module for the minimum conversion unit, and splicing and arranging the converted ciphertext SQL clause to obtain a complete ciphertext SQL statement; wherein the sub-conversion module i corresponds to the minimum conversion unit i The conversion rule of the minimum conversion unit i is provided and converted into a corresponding ciphertext SQL clause.
  8. 如权利要求1所述的方法,其特征在于,数据库拥有者在该云服务供应商处设置用户自定义函数;然后步骤(4)中该云服务供应商调用该用户自定义函数,在该外包密文数据库上执行该密文SQL语句;其中,该用户自定义函数包括:The method of claim 1 wherein the database owner sets a user-defined function at the cloud service provider; then in step (4) the cloud service provider invokes the user-defined function in the outsourcing The ciphertext SQL statement is executed on the ciphertext database; wherein the user-defined function includes:
    a)等值比较函数EqualityCom(x,E(value1),E(value2)),其判定步骤为:若E(value1)和E(value2)的距离不大于x,则明文值相等,函数输出0;否则,若E(value1)大于E(value2),则value1大于value2,函数输出1;若E(value1)小于E(value2),则value2大于value1,函数输出-1;E(·)为OPEA算法的加密函数,E(value1)代表明文值value1经OPEA算法加密处理后的密文值;其中,数据库拥有者依据密钥以及该数据操作请求中的待比较明文(value1和value2)选取随机整数x∈[max{R1,R2},σ+R1),并发送至云服务供应商,R1=U[value1]-L[value1]和R2=U[value2]-L[value2]分别是value1和value2所对应的密文分区长度;a) Equivalent comparison function EqualityCom(x, E(value 1 ), E(value 2 )), the decision step is: if the distance between E(value 1 ) and E(value 2 ) is not greater than x, the plaintext values are equal , the function outputs 0; otherwise, if E(value 1 ) is greater than E(value 2 ), then value 1 is greater than value 2 and the function outputs 1; if E(value 1 ) is less than E(value 2 ), then value 2 is greater than value 1 The function outputs -1; E(·) is the encryption function of the OPEA algorithm, and E(value 1 ) represents the ciphertext value after the plaintext value 1 is encrypted by the OPEA algorithm; wherein the database owner operates according to the key and the data The plaintext to be compared in the request (value 1 and value 2 ) is selected as a random integer x∈[max{R 1 , R 2 }, σ+R 1 ) and sent to the cloud service provider, R 1 =U[value 1 ] -L[value 1 ] and R 2 =U[value 2 ]-L[value 2 ] are the ciphertext partition lengths corresponding to value 1 and value 2 , respectively;
    b)字符串分割函数Split(str,delimiter),str是待分割的LIKE运算符的密文搜索模式串,delimiter是分隔符,分割后的结果采用Table类型存储并返回。b) String splitting function Split(str, delimiter), str is the ciphertext search pattern string of the LIKE operator to be split, delimiter is the delimiter, and the split result is stored and returned by the Table type.
  9. 如权利要求5所述的方法,其特征在于,数据库拥有者在该云服务供应商处设置用户自定义函数;然后步骤(4)中该云服务供应商调用该用户自定义函数,在该外包密文数据库上执行该密文SQL语句;其中,该用户自定义函数包括:聚合比较函数SumEqualityCom
    Figure PCTCN2017077109-appb-100007
    Figure PCTCN2017077109-appb-100008
    是一数据库字段的数据项集合,SUM是求和函数,L[value]和U’[value]分别是一常量数值value对应的密文分区下边界和扩展上边界;
    Figure PCTCN2017077109-appb-100009
    且R以非降序排列,判定步骤为:若
    Figure PCTCN2017077109-appb-100010
    不大于L[value]且
    Figure PCTCN2017077109-appb-100011
    不小于U’[value],则
    Figure PCTCN2017077109-appb-100012
    与value相等,函数输出0;否则,若
    Figure PCTCN2017077109-appb-100013
    大于U’[value],则
    Figure PCTCN2017077109-appb-100014
    大于value,函数输出1;若
    Figure PCTCN2017077109-appb-100015
    小于L[value],则value大于
    Figure PCTCN2017077109-appb-100016
    函数输出-1;E(·)为OPEA算法的加密函数,E’(·)为OPEA扩展算法的加密函数。
    The method of claim 5, wherein the database owner sets a user-defined function at the cloud service provider; and then in step (4) the cloud service provider invokes the user-defined function in the outsourcing The ciphertext SQL statement is executed on the ciphertext database; wherein the user-defined function includes: an aggregate comparison function SumEqualityCom
    Figure PCTCN2017077109-appb-100007
    Figure PCTCN2017077109-appb-100008
    Is a data item set of a database field, SUM is a summation function, L[value] and U'[value] are respectively a lower boundary of the ciphertext partition corresponding to a constant value value and an extended upper boundary;
    Figure PCTCN2017077109-appb-100009
    And R is arranged in non-descending order, and the determining step is:
    Figure PCTCN2017077109-appb-100010
    Not greater than L[value] and
    Figure PCTCN2017077109-appb-100011
    Not less than U'[value], then
    Figure PCTCN2017077109-appb-100012
    Equal to value, the function outputs 0; otherwise, if
    Figure PCTCN2017077109-appb-100013
    Greater than U'[value], then
    Figure PCTCN2017077109-appb-100014
    Greater than value, the function outputs 1;
    Figure PCTCN2017077109-appb-100015
    Less than L[value], value is greater than
    Figure PCTCN2017077109-appb-100016
    The function outputs -1; E(·) is the encryption function of the OPEA algorithm, and E'(·) is the encryption function of the OPEA extension algorithm.
  10. 如权利要求9所述的方法,其特征在于,根据函数SumEqualityCom,在数据库拥有者与云服务供应商之间部署安全和值计算协议,该协议步骤为:云服务供应商计算SUM(E(Att))和SUM(E’(Att)),并将密文累加结果发送至数据库拥有者;数据库拥有者解密得到d=Dec(SUM(E(Att)),L)和d’=Dec(SUM(E’(Att)),U’);若此时d与d’相等,则数据库拥有者获知SUM(Att)=d,并将E(SUM(Att))=SUM(E(Att))返回云服务供应商,协议结束;否则,数据库拥有者寻找能够使得SumEqualityCom(SUM(E(Att)),SUM(E’(Att)),L[d+i],U’[d+i])=0成立的整数i(0≤i≤d’-d),从而获知SUM(Att)=d+i,并将E(d+i)返回至云服务供应商,协议 结束;其中,Att是一数据库字段的数据项集合。 The method of claim 9, wherein the security and value calculation protocol is deployed between the database owner and the cloud service provider according to the function SumEqualityCom, the protocol step is: the cloud service provider calculates SUM (E(Att) )) and SUM(E'(Att)), and send the ciphertext accumulation result to the database owner; the database owner decrypts d=Dec(SUM(E(Att)), L) and d'=Dec(SUM) (E'(Att)), U'); if d and d' are equal at this time, the database owner knows SUM(Att)=d and E(SUM(Att))=SUM(E(Att)) Return to the cloud service provider, the agreement ends; otherwise, the database owner looks for SumEqualityCom(SUM(E(Att)), SUM(E'(Att)), L[d+i], U'[d+i] ) = 0 holds the integer i (0 ≤ i ≤ d'-d), so that SUM(Att)=d+i is obtained, and E(d+i) is returned to the cloud service provider, the agreement End; where Att is a collection of data items for a database field.
PCT/CN2017/077109 2017-02-24 2017-03-17 Method for processing security outsourcing data of relational database supporting ciphertext data operation WO2018152904A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710103350.4A CN106934301B (en) 2017-02-24 2017-02-24 Relational database secure outsourcing data processing method supporting ciphertext data operation
CN201710103350.4 2017-02-24

Publications (1)

Publication Number Publication Date
WO2018152904A1 true WO2018152904A1 (en) 2018-08-30

Family

ID=59424165

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/077109 WO2018152904A1 (en) 2017-02-24 2017-03-17 Method for processing security outsourcing data of relational database supporting ciphertext data operation

Country Status (2)

Country Link
CN (1) CN106934301B (en)
WO (1) WO2018152904A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10846423B2 (en) * 2017-08-11 2020-11-24 Palo Alto Research Center Incorporated System and architecture for analytics on encrypted databases
CN107592298B (en) * 2017-08-11 2020-07-14 中国科学院大学 Sequence comparison algorithm secure outsourcing method based on single server model, user terminal and server
CN108170753B (en) * 2017-12-22 2021-08-17 北京工业大学 Key-Value database encryption and security query method in common cloud
CN109992986B (en) * 2017-12-29 2021-05-11 中国移动通信集团上海有限公司 Desensitization processing method and device for sensitive data
CN109522727A (en) * 2018-10-26 2019-03-26 吴晓军 A kind of data processing method, device and equipment
CN109840423B (en) * 2018-11-27 2023-12-05 吴晓军 Recording method, device and equipment of data relationship
CN116910791B (en) * 2023-09-12 2023-12-12 闪捷信息科技有限公司 Encryption analysis method and device for database list, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102968455A (en) * 2012-10-31 2013-03-13 山东浪潮齐鲁软件产业股份有限公司 Transparent database encrypting method of application layer
US20130091357A1 (en) * 2011-10-10 2013-04-11 Altibase Corp. Database management system and encryption method performed in database
CN105681280A (en) * 2015-12-29 2016-06-15 西安电子科技大学 Searchable encryption method based on Chinese in cloud environment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103281377B (en) * 2013-05-31 2016-06-08 北京创世泰克科技股份有限公司 A kind of encrypt data storage and querying method of facing cloud
CN104022868A (en) * 2014-02-18 2014-09-03 杭州师范大学 Outsourcing decryption method of attribute-based encryption based on ciphertext policy
US9455831B1 (en) * 2014-09-18 2016-09-27 Skyhigh Networks, Inc. Order preserving encryption method
CN105610793B (en) * 2015-12-18 2018-10-26 江苏大学 A kind of outsourcing data encryption storage and cryptogram search system and its application process

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130091357A1 (en) * 2011-10-10 2013-04-11 Altibase Corp. Database management system and encryption method performed in database
CN102968455A (en) * 2012-10-31 2013-03-13 山东浪潮齐鲁软件产业股份有限公司 Transparent database encrypting method of application layer
CN105681280A (en) * 2015-12-29 2016-06-15 西安电子科技大学 Searchable encryption method based on Chinese in cloud environment

Also Published As

Publication number Publication date
CN106934301A (en) 2017-07-07
CN106934301B (en) 2019-12-13

Similar Documents

Publication Publication Date Title
WO2018152904A1 (en) Method for processing security outsourcing data of relational database supporting ciphertext data operation
Popa et al. CryptDB: A practical encrypted relational DBMS
US9087212B2 (en) Methods and apparatus for securing a database
Popa et al. CryptDB: Protecting confidentiality with encrypted query processing
Li et al. Efficiency and security trade-off in supporting range queries on encrypted databases
US20160132692A1 (en) Searchable encryption for infrequent queries in adjustable encrypted databases
US9069987B2 (en) Secure data access using SQL query rewrites
Sarfraz et al. Dbmask: Fine-grained access control on encrypted relational databases
Hang et al. ENKI: access control for encrypted query processing
Pattuk et al. Bigsecret: A secure data management framework for key-value stores
Kamel et al. Dynamic spatial index for efficient query processing on the cloud
Zhan et al. MDOPE: Efficient multi-dimensional data order preserving encryption scheme
Jiang et al. Rphx: Result pattern hiding conjunctive query over private compressed index using Intel SGX
CN114254344A (en) Private data range query method of shared database based on block chain
Talha et al. Enhancing confidentiality and privacy of outsourced spatial data
Wang et al. QuickN: Practical and secure nearest neighbor search on encrypted large-scale data
Talha et al. Facilitating secure and efficient spatial query processing on the cloud
Barouti et al. Symmetrically-private database search in cloud computing
Zhang et al. Sorel: Efficient and secure ore-based range query over outsourced data
Tang et al. An effective encrypted scheme over outsourcing data for query on cloud platform
Watanabe et al. Privacy-preserving queries for a DAS model using encrypted Bloom filter
Talha et al. DISC: Query processing on the cloud service provider for dynamic spatial databases
Wang et al. T-DB: toward fully functional transparent encrypted databases in dbaas framework
Xu et al. Symmetric searchable encryption with supporting search pattern and access pattern protection in multi‐cloud
Ali et al. Enhancing performance of search over encrypted data in cloud computing

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17897371

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17897371

Country of ref document: EP

Kind code of ref document: A1