CN101937464B - 基于逐字索引的密文检索方法 - Google Patents

基于逐字索引的密文检索方法 Download PDF

Info

Publication number
CN101937464B
CN101937464B CN2010102790798A CN201010279079A CN101937464B CN 101937464 B CN101937464 B CN 101937464B CN 2010102790798 A CN2010102790798 A CN 2010102790798A CN 201010279079 A CN201010279079 A CN 201010279079A CN 101937464 B CN101937464 B CN 101937464B
Authority
CN
China
Prior art keywords
word
character
search condition
search
ciphertext
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN2010102790798A
Other languages
English (en)
Other versions
CN101937464A (zh
Inventor
张黎敏
冯源
周淳
张青林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Dream Database Co ltd
Original Assignee
Wuhan Dameng Database Co Ltd
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 Wuhan Dameng Database Co Ltd filed Critical Wuhan Dameng Database Co Ltd
Priority to CN2010102790798A priority Critical patent/CN101937464B/zh
Publication of CN101937464A publication Critical patent/CN101937464A/zh
Application granted granted Critical
Publication of CN101937464B publication Critical patent/CN101937464B/zh
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了一种基于逐字索引的密文检索方法,在基表中建立字符类型的加密属性的逐字索引信息,逐字索引信息由对加密属性的明文逐字加密后选取的部分字符构成,检索中,首先将涉及加密属性的原始检索条件转换为涉及该加密属性的逐字索引信息的中间检索条件,利用中间检索条件在基表中进行初步检索,最后利用原始检索条件在中间解密结果中进行精确检索。本发明可以在不解密的情况下对密文属性的内容进行预检索,得到准确率较高的中间结果集,这种方法降低了对中间结果集的解密开销,具有较高的检索性能。

Description

基于逐字索引的密文检索方法
技术领域
本发明属于计算机中的数据库应用技术领域,具体地说,是对加密后的字符类型数据进行高效检索的一种方法。
背景技术
外包数据库是一种新兴的数据管理模式。在这种模式下,企业或用户把数据存放在数据库服务提供商(Database Service Provider,简称DSP)端,通过互联网使用数据,从而降低数据管理及维护的开销。但是,由于数据库存放在DSP端,对于其中敏感和重要的文档数据,出于安全考虑,通常需要进行加密处理。加密后的密文文档数据由于失去了明文的原有特征,必须采用专门的密文检索技术对其进行检索。现有的密文检索技术可分为两类,一类是无索引密文检索技术,另一类是基于索引的密文检索技术。
无索引密文检索技术的实现方法是:对查询语句按其检索条件进行重构,将其分为对明文属性的检索和对密文属性的检索两部分,先执行对明文属性的检索,筛选出符合条件的中间结果集,然后对中间结果集中的记录进行解密,再在解密后的中间结果集上执行对密文属性的检索,得到最终的结果集。这种方法的缺陷是,对密文属性的检索必须在中间结果集解密后才能进行,导致中间结果集规模较大,对中间结果集的解密操作的开销也相应增大,因此查询语句的检索效率偏低。
基于索引的密文检索技术的实现方法是:预先对密文属性按一定方式建立索引,使系统能够利用该索引在不解密的前提下先对密文属性进行一次粗略的预检索,缩小中间结果集的规模,然后再在解密后的中间结果集上执行精确检索,得到最终的结果集。这种方法下,中间结果集的规模被预先缩小了,解密操作的开销也相应减小,因此检索效率更高。但是,现有的基于索引的密文检索技术大多只能处理数值类型的数据,而对于字符类型的文档数据,尚缺少高效的密文检索方法。
发明内容
本发明的目的在于提出一种基于逐字索引的密文检索方法,针对字符类型数据的特点,具有较高的检索性能。
基于逐字索引的密文检索方法,涉及基表,基表包含有字符类型的加密属性,以及加密属性的逐字索引信息;加密属性的逐字索引信息获取方式为:对加密属性的明文按字符逐个加密,得到每个字符的密文字符串,从每个密文字符串中选取k个字符依次连接组成逐字索引字符串,k小于等于采用的加密算法对密文字符串限定的最小长度;
检索方法具体为:
(1)检索条件变换:在涉及加密属性的原始检索条件中,匹配字符串S1包括普通字符和通配符,采用与上述逐字索引信息获取中相同的加密和字符选取方式对S1中的普通字符进行加密和选取字符,用选取的字符替换S1中的对应普通字符,同时检索条件中涉及到的加密属性转换为该加密属性的逐字索引信息,形成中间检索条件;
(2)初步检索:利用中间检索条件在基表中进行初步检索,得到中间检索结果;
(3)精确检索:对中间检索结果的各条记录中的加密属性进行解密,最后利用原始检索条件在解密结果中进行精确检索。
本发明为字符类型的密文属性建立了一种逐字索引,可以在不解密的情况下对密文属性的内容进行预检索,得到准确率较高的中间结果集。这种方法降低了对中间结果集的解密开销,具有较高的检索性能。
具体实施方式
本发明中的逐字索引是一种为字符类型的密文属性创建的,用于在不解密的情况下快速检索该属性内容的索引信息。下面结合实施例对本发明作进一步的描述,但该实施例不应理解为对本发明的限制。
本发明按以下步骤实施:
在数据库中创建包含属性A1,A2,A3的基本表Tablel,定义A1,A2的数据类型为字符类型(如char、varchar、text、clob等),A3的数据类型为整数类型,并插入若干条记录。此时Tablel中的数据信息如表1所示。
表1
  A1   A2   A3
  中华人民共和国   政治文化   100
  中国人民解放军   国防军事   200
  数据库原理   信息科学   50
  计算机科学与技术   科学技术   250
  人民英雄纪念碑   革命历史   150
  唐诗三百首   文学艺术   320
对Tablel的属性A1执行加密命令,系统自动在Tablel中增加一个新的属性Index_A1,用于保存A1的逐字索引信息。对Tablel中每个记录的A1属性值进行逐字加密,并取每个密文字符串的前3个字符,构成逐字索引字符串,如表2所示。建立逐字索引所用的加密算法可以任选一种常用的加密算法,如DES、AES、RC4、MD5等,每种加密算法对得到的密文字符串都有一个最小长度的限定,从密文字符串中选取的字符数只要小于或等于其最小长度即可,具体字符的选取方式不作限定。本实施例中采用的是DES算法,选取的是前3个字符。
A1的逐字索引建立完成后,再对A1属性的值进行加密,加密完成后Tablel中保存的数据信息如表3所示。
表2
  A1   Index_A1   A2   A3
  中华人民共和国   55D452738F9A73AA4E621   政治文化   100
  中国人民解放军   55D621738F9A9747CEAC2   国防军事   200
  数据库原理   0F42A0930C40CA2   信息科学   50
  计算机科学与技术   0CD67BCA5C98DE46EF23D345   科学技术   250
  人民英雄纪念碑   738F9A99C5F58027DA847   革命历史   150
  唐诗三百首   9738F9AD901771E   文学艺术   320
表3
  A1   Index_A1   A2   A3
  1948F79C6F7EC2842AEC3E8674338D18   55D452738F9A73AA4E621   政治文化   100
  708E35733544B732D720282B538DFD4C   55D621738F9A9747CEAC2   国防军事   330
  80F09087E874F21CCA232EC8F7C1B845   0F42A0930C40CA2   信息科学   50
  D7126F70F908A6DEEF7E0E667E849F6C   0CD67BCA5C98DE46EF23D345   科学技术   250
  EBA7922B69C1C919A2BEDC575C1BCA12   738F9A99C5F58027DA847   革命历史   150
  FCBD8AF4B4E6D69371E7D14ACCC98572   9738F9AD901771E   文学艺术   120
执行查询语句Q1,检索Tablel中A1属性的值为“数据库原理”的记录。
Q1:select A1,A2,A3 from Tablel where A1=′数据库原理′;
由于检索条件中涉及到加密属性A1,系统根据Q1自动生成查询语句Q2:
Q2:select A1,A2,A3 from Tablel whereIndex_A1=′0F42A0930C40CA2′;
转换后的查询语句Q2在不解密的情况下可利用A1的逐字索引Index_A1检索到表4所示的中间结果集。对表4的中间结果集解密并在解密后的结果集上执行查询语句Q1,即可得到如表5所示的最终检索结果集。
表4
  A1   A2   A3
  80F09087E874F21CCA232EC8F7C1B845   信息科学   50
表5
  A1   A2   A3
  数据库原理   信息科学   50
执行查询语句Q3,检索Tablel中A1属性的值包含字符串“人民”并且A3属性的值小于200的记录。其中匹配字符串‘%人民%’中的‘%’为通配符,表示任意字符串。
Q3:selectA1,A2,A3
    from Tablel
    where A1 like′%人民%′and A3<200;
由于检索条件中涉及到加密属性A1,系统根据Q3自动生成查询语句Q4:
Q4:select A1,A2,A3
    from Tablel
    where Index_A1 like′%738F9A%′and A3<200;
转换后的查询语句Q4在不解密的情况下可利用A1的逐字索引Index_A1检索到表6所示的中间结果集。其中第三行记录虽然不符合Q3的检索条件,但是由于其逐字索引字符串“9738F9AD901771E”中包含字符串“738F9A”,因此也被检索在中间结果集中。这是因为不同字符串的逐字索引字符串可能出现相同的情况,所以中间结果集并不是精确的检索结果。
表6
  A1   A2   A3
  1948F79C6F7EC2842AEC3E8674338D18   政治文化   100
  EBA7922B69C1C919A2BEDC575C1BCA12   革命历史   150
  FCBD8AF4B4E6D69371E7D14ACCC98572   文学艺术   120
对表6的中间结果集解密,并在解密后的结果集上执行查询语句Q3,即可得到如表7所示的最终检索结果集。表6中的第三行记录此时由于不符合Q3的检索条件而被过滤。
表7
  A1   A2   A3
  中华人民共和国   政治文化   100
  人民英雄纪念碑   革命历史   150
执行查询语句Q5,检索Tablel中A2属性的值包含字符串“科学”或者A3属性的值大于200的记录。
Q5:selectA1,A2,A3
    from Tablel
    where A2 like′%科学%′or A3>200;
由于Q5的检索条件不涉及任何加密属性,因此系统直接执行Q5得到精确的检索结果集,对该结果集进行解密,即可得到表8所示的最终检索结果集。
表8
  A1   A2   A3
  数据库原理   信息科学   50
  计算机科学与技术   科学技术   250
  唐诗三百首   文学艺术   320

Claims (1)

1.基于逐字索引的密文检索方法,涉及基表,基表包含有字符类型的加密属性以及加密属性的逐字索引信息;加密属性的逐字索引信息获取方式为:对加密属性的明文按字符逐个加密,得到每个字符的密文字符串,从每个密文字符串中选取k个字符依次连接组成逐字索引字符串,k小于等于采用的加密算法对密文字符串限定的最小长度;
检索方法具体为:
(1)检索条件变换:在涉及加密属性的原始检索条件中,匹配字符串S1包括普通字符和通配符,采用与上述逐字索引信息获取中相同的加密和字符选取方式对匹配字符串S1中的普通字符进行加密和选取字符,用选取的字符替换匹配字符串S1中的对应普通字符,同时检索条件中涉及的加密属性转换为该加密属性的逐字索引信息,形成中间检索条件;
(2)初步检索:利用中间检索条件在基表中进行初步检索,得到中间检索结果;
(3)精确检索:对中间检索结果的各条记录中的加密属性进行解密,最后利用原始检索条件在解密结果中进行精确检索。
CN2010102790798A 2010-09-13 2010-09-13 基于逐字索引的密文检索方法 Active CN101937464B (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010102790798A CN101937464B (zh) 2010-09-13 2010-09-13 基于逐字索引的密文检索方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010102790798A CN101937464B (zh) 2010-09-13 2010-09-13 基于逐字索引的密文检索方法

Publications (2)

Publication Number Publication Date
CN101937464A CN101937464A (zh) 2011-01-05
CN101937464B true CN101937464B (zh) 2012-01-25

Family

ID=43390793

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010102790798A Active CN101937464B (zh) 2010-09-13 2010-09-13 基于逐字索引的密文检索方法

Country Status (1)

Country Link
CN (1) CN101937464B (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103914541B (zh) * 2014-04-03 2017-08-01 小米科技有限责任公司 信息搜索的方法及装置
CN106685922B (zh) * 2016-11-17 2019-12-03 江西远成汽车技术股份有限公司 数据加密方法及装置
CN106874401B (zh) * 2016-12-30 2020-06-23 中安威士(北京)科技有限公司 一种面向数据库加密字段模糊检索的密文索引方法
CN108334577B (zh) * 2018-01-24 2020-02-07 东北大学 一种安全多方数值型记录匹配方法
CN110896387B (zh) * 2018-09-12 2021-01-01 宁德时代新能源科技股份有限公司 数据传输方法、电池管理系统和存储介质

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1347050A (zh) * 2000-09-27 2002-05-01 日本电气株式会社 加密文件系统、加密文件检索方法、以及计算机可读介质
CN101206815A (zh) * 2006-12-19 2008-06-25 株式会社富士通Bsc 加密处理、加密装置和存储加密程序的计算机可读介质

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101739400B (zh) * 2008-11-11 2014-08-13 日电(中国)有限公司 生成索引的方法和装置以及检索方法和装置

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1347050A (zh) * 2000-09-27 2002-05-01 日本电气株式会社 加密文件系统、加密文件检索方法、以及计算机可读介质
CN101206815A (zh) * 2006-12-19 2008-06-25 株式会社富士通Bsc 加密处理、加密装置和存储加密程序的计算机可读介质

Also Published As

Publication number Publication date
CN101937464A (zh) 2011-01-05

Similar Documents

Publication Publication Date Title
CN101937464B (zh) 基于逐字索引的密文检索方法
CN106815350B (zh) 一种云环境中动态的密文多关键词模糊搜索方法
US10346633B2 (en) Secure database searching
EP4235475A3 (en) Systems and methods of database encryption in a multitenant database management system
US7930560B2 (en) Personal information management system, personal information management program, and personal information protecting method
CN105637520A (zh) 数据库中为加密字段生成索引的方法和装置
Wang et al. Fast query over encrypted character data in database
US20060041533A1 (en) Encrypted table indexes and searching encrypted tables
CN105138585B (zh) 数据库加密字段部分匹配查询方法及系统
WO2008090014A3 (en) Query integrity assurance in database outsourcing
CN106407447A (zh) 一种加密云数据下基于Simhash的模糊排序搜索方法
CN102867064A (zh) 关联字段查询装置和关联字段查询方法
EP3356954A1 (en) Method and system for range search on encrypted data
CN102143159A (zh) 一种das模型中的数据库密钥管理方法
CN106407837B (zh) 一种具备隐私保护能力的时间数据加密处理方法
CN101162493A (zh) 维护数据库安全的方法和系统
CN116186108A (zh) 加密敏感字段支持模糊查询的方法
CN106203171A (zh) 大数据平台安全索引系统及方法
CN105808675B (zh) 从Informix数据库向人大金仓数据库迁移的方法
CN103414555B (zh) 阵列基于io块加密的密钥管理方法
Wang et al. Storage and query over encrypted character and numerical data in database
CN104794243A (zh) 基于文件名的第三方密文检索方法
CN108932434A (zh) 一种基于机器学习技术的数据加密方法及装置
Wang et al. Implementation of encrypted data for outsourced database
KR100698834B1 (ko) 인덱스 컬럼 암호화 방법

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Ciphertext search method based on word-for-word indexing

Effective date of registration: 20170421

Granted publication date: 20120125

Pledgee: Guanggu Branch of Wuhan Rural Commercial Bank Co.,Ltd.

Pledgor: WUHAN DAMENG DATABASE Co.,Ltd.

Registration number: 2017420000010

PE01 Entry into force of the registration of the contract for pledge of patent right
PC01 Cancellation of the registration of the contract for pledge of patent right

Date of cancellation: 20180328

Granted publication date: 20120125

Pledgee: Guanggu Branch of Wuhan Rural Commercial Bank Co.,Ltd.

Pledgor: WUHAN DAMENG DATABASE Co.,Ltd.

Registration number: 2017420000010

PC01 Cancellation of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Ciphertext search method based on word-for-word indexing

Effective date of registration: 20180329

Granted publication date: 20120125

Pledgee: Guanggu Branch of Wuhan Rural Commercial Bank Co.,Ltd.

Pledgor: WUHAN DAMENG DATABASE Co.,Ltd.

Registration number: 2018420000015

PE01 Entry into force of the registration of the contract for pledge of patent right
PC01 Cancellation of the registration of the contract for pledge of patent right

Date of cancellation: 20190325

Granted publication date: 20120125

Pledgee: Guanggu Branch of Wuhan Rural Commercial Bank Co.,Ltd.

Pledgor: WUHAN DAMENG DATABASE Co.,Ltd.

Registration number: 2018420000015

PC01 Cancellation of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Ciphertext search method based on word-for-word indexing

Effective date of registration: 20190328

Granted publication date: 20120125

Pledgee: Guanggu Branch of Wuhan Rural Commercial Bank Co.,Ltd.

Pledgor: WUHAN DAMENG DATABASE Co.,Ltd.

Registration number: 2019420000008

CP03 Change of name, title or address

Address after: 430073 16-19 / F, building C3, future science and technology building, 999 Gaoxin Avenue, Wuhan East Lake New Technology Development Zone, Wuhan City, Hubei Province

Patentee after: Wuhan dream database Co.,Ltd.

Address before: 430073 5 / F, building C6, optical valley software park, special 1, Guanshan 1st Road, Wuhan City, Hubei Province

Patentee before: WUHAN DAMENG DATABASE Co.,Ltd.

CP03 Change of name, title or address
PC01 Cancellation of the registration of the contract for pledge of patent right

Date of cancellation: 20210315

Granted publication date: 20120125

Pledgee: Guanggu Branch of Wuhan Rural Commercial Bank Co.,Ltd.

Pledgor: WUHAN DAMENG DATABASE Co.,Ltd.

Registration number: 2019420000008

PC01 Cancellation of the registration of the contract for pledge of patent right
TR01 Transfer of patent right

Effective date of registration: 20220907

Address after: 430073 16-19 / F, building C3, future science and technology building, 999 Gaoxin Avenue, Donghu New Technology Development Zone, Wuhan City, Hubei Province

Patentee after: Wuhan dream database Co.,Ltd.

Patentee after: HUAZHONG University OF SCIENCE AND TECHNOLOGY

Address before: 430073 16-19 / F, building C3, future science and technology building, 999 Gaoxin Avenue, Wuhan East Lake New Technology Development Zone, Wuhan City, Hubei Province

Patentee before: Wuhan dream database Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230728

Address after: 16-19/F, Building C3, Future Science and Technology Building, No. 999 Gaoxin Avenue, Donghu New Technology Development Zone, Wuhan City, Hubei Province, 430206

Patentee after: Wuhan dream database Co.,Ltd.

Address before: 430073 16-19 / F, building C3, future science and technology building, 999 Gaoxin Avenue, Donghu New Technology Development Zone, Wuhan City, Hubei Province

Patentee before: Wuhan dream database Co.,Ltd.

Patentee before: HUAZHONG University OF SCIENCE AND TECHNOLOGY