CN104463020B - 存储器数据完整性保护的方法 - Google Patents

存储器数据完整性保护的方法 Download PDF

Info

Publication number
CN104463020B
CN104463020B CN201410707362.4A CN201410707362A CN104463020B CN 104463020 B CN104463020 B CN 104463020B CN 201410707362 A CN201410707362 A CN 201410707362A CN 104463020 B CN104463020 B CN 104463020B
Authority
CN
China
Prior art keywords
counter
data block
data
internal memory
block
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.)
Expired - Fee Related
Application number
CN201410707362.4A
Other languages
English (en)
Other versions
CN104463020A (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.)
Dalian University of Technology
Original Assignee
Dalian University of Technology
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 Dalian University of Technology filed Critical Dalian University of Technology
Priority to CN201410707362.4A priority Critical patent/CN104463020B/zh
Publication of CN104463020A publication Critical patent/CN104463020A/zh
Application granted granted Critical
Publication of CN104463020B publication Critical patent/CN104463020B/zh
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/78Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure storage of data
    • G06F21/79Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure storage of data in semiconductor storage media, e.g. directly-addressable memories

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Storage Device Security (AREA)

Abstract

本发明提出一种内存数据完整性的保护方法。当系统需要将一个数据块写回内存时,首先产生新的counter分配给这个数据块;然后应用计数器模式加密方法对数据块加密;随后将得到的密文数据块和数据块的地址输入到带密钥的MAC函数中,MAC函数会产生一个输出;最后根据MAC函数的输出确定counter在内存中的存储位置。本发明与传统的内存数据完整性保护方案相比,它能够以更低的存储空间消耗、更小的计算资源占用,提供相同或者更高级别的内存数据完整性保护。

Description

存储器数据完整性保护的方法
技术领域
本发明属于计算机数据存储保护技术领域,涉及一种存储器数据完整性保护的方法。
背景技术
科技的不断发展,使得越来越多的数据存储在内存中,特别是一些机密信息。攻击者可以对内存发动多种主动攻击,破坏存储在内存中的数据的完整性,使系统运行出现错误的结果。所以,需要对这些数据的完整性进行保护。目前保护内存数据完整性的常见方案是构建完整性保护树,对从内存中取到的数据进行完整性验证。但是,采用完整性保护树进行完整性保护需要耗费大量的存储空间存储树的内部节点,并且需要花费大量的时间对从内存中取到的数据块进行完整性验证,这会占用大量的系统计算资源。
发明内容
本发明提供一种隐藏数据块和系统为这个数据块分配的counter的地址间的映射关系的方法,以较低的存储开销和计算资源占用为内存数据提供完整性保护。
本发明的技术方案包括以下两个部分:
当CPU将一个数据块写回内存时:
1.11首先,系统使用的counter自动增长,给这个数据块分配新的counter,然后应用计数器模式加密方法对数据块加密,以获得相应的密文;
1.12将得到的密文形式的数据块写回内存;
1.13使用加密后的数据块和这个数据块的地址作为带密钥的MAC函数的输入产生相应的输出,根据这个输出确定这个数据块对应的counter在内存的最新存储位置,如(1);
1.14如果counter在缓存中不需要写回内存,则不写回;如果需要写回内存,则将其写回到根据1.13计算得出的结果确定的内存位置上,并且数据块与它所对应的counter不是同时写回内存。当counter需要写回内存时,可以将多个counter批量写回,使攻击者无法分析出数据与counter的对应关系。使用的数据块的地址是数据块的物理地址。
当CPU从内存中读取一个数据块时:
1.21直接从内存中读取数据块;
1.22同时,如果这个数据块对应的counter在缓存中,则直接使用这个counter解密1.21中取到的数据块;如果这个counter不在缓存中,则根据(1)计算系统为这个数据块分配的counter在内存中的存储位置,读取这个counter,使用读取到的counter对1.21中取到的数据块进行解密;
将数据块和数据块的地址的连接作为带密钥的MAC函数的输入,确保每次的输入都是不同的,产生不同的输出。如果产生冲突,采用通用的冲突消解方法处理。
可以在(1)中添加另一个非常短的输入counter_i,进一步消除MAC函数的输入发生重复的可能性,counter_i可以与数据以明文方式连接起来存储,如(2)所示。相应的,在验证数据完整性的步骤中,计算counter的存储地址时也按照(2)计算:
系统使用计数器模式加密方法保护数据的机密性。
带密钥的MAC函数的输入是密文形式的数据块和数据块的物理地址的连接。
本发明可以显著的降低系统的存储空间消耗。现存的完整性保护方法都需要在内存中存储完整性验证树的内部节点,会消耗大量的存储空间。本发明只需要将系统为数据块分配的counter存储到内存。
本发明可以隐藏数据块和counter的存储地址间的映射关系。因为带密钥的MAC函数的输出是均匀分布的,只要输入不同,产生的输出也是不同的。如果产生冲突,采用通用的冲突消除方法处理。
本发明可以显著降低完整性保护方法导致的系统性能下降。当系统从内存中读取一个数据块时,如果对应的counter在片上,则直接使用这个counter;如果对应的counter需要从内存中读取,则计算counter在内存中的位置;不需要进行完整性检查,直接解密即可,对系统的性能产生的负面影响较小。
本发明可以将一个非常短的辅助counter_i引入带密钥的MAC函数的输入中,进一步的降低MAC函数的输入产生重复的可能,提高系统的安全性,counter_i可以与明文数据连接起来存储,如等式2。相应的,在验证数据完整性的步骤中,计算counter的存储地址也按照等式2计算。
addrcounter=Hkey(block||counter_i||addrblock) (2)
本发明提出一种内存数据完整性的保护方法。当系统需要将一个数据块写回内存时,首先产生新的counter分配给这个数据块;然后应用计数器模式加密方法对数据块加密;随后将得到的密文数据块和数据块的地址输入到带密钥的MAC函数中,MAC函数会产生一个输出;最后根据MAC函数的输出确定counter在内存中的存储位置。本发明与传统的内存数据完整性保护方案相比,它能够以更低的存储空间消耗、更小的计算资源占用,提供相同或者更高级别的内存数据完整性保护。
附图说明
图1是本发明的系统体系框架图。
图2是CPU从内存中读取一个数据块的流程图。
图3是CPU将一个数据块写回内存的流程图。
具体实施方式
下面结合附图对本发明做进一步的说明。具体实现过程如下,结合图1、2和3:
当CPU从内存中读取一个数据块时:
①系统从内存中读取密文形式的数据块;
②如果这个数据块的counter在片上counter缓存中,转到④;
③如果这个数据块的counter不在片上counter缓存中,计算counter在内存中的位置,从内存中读取counter;
④应用计数器模式加密方法解密数据块;
⑤程序结束。
当CPU将一个数据块写回内存时:
①系统为需要写回的数据块分配最新的counter;
②应用计数器模式加密方法,加密数据块;
③计算counter在内存中的存储位置;
④将数据块写回内存;
⑤检查这个最新的counter是否需要写回内存?
⑥如果不需要写回内存,则暂不写回,转到⑧;
⑦如果需要写回内存,将多个counter一起写回内存;
⑧程序结束。
如上面描述的那样,当CPU从内存中读取数据块时,如果这个数据块的counter在counter缓存中,则直接应用计数器模式加密方法进行解密;如果counter不在counter缓存中,则计算这个counter在内存中的存储位置,从内存中读取,然后再应用计数器模式加密方法进行解密。不需要在内存中存储其他的额外数据,也不会在数据的关键路径上添加完整性验证延迟,降低了完整性保护方案导致的计算资源大量占用。

Claims (3)

1.一种保护内存存储器数据完整性的方法,其特征在于隐藏数据块和系统为这个数据块分配的最新的counter的存储地址之间的映射关系;具体包括以下两个部分:
当CPU将一个数据块写回内存时:首先,系统使用的counter自动增长,给这个数据块分配新的counter,然后应用计数器模式加密方法对数据块加密,以获得相应的密文;将得到的密文形式的数据块写回内存;使用加密后的数据块和这个数据块的地址作为带密钥的MAC函数的输入产生相应的输出,根据这个输出确定这个数据块对应的counter在内存的最新内存位置,根据式(1);如果counter在缓存中不需要写回内存,则不写回;如果需要写回内存,则将其写回到计算得出的结果确定的内存位置上,并且数据块与它所对应的counter不是同时写回内存;当counter需要写回内存时,将多个counter批量写回,使攻击者无法分析出数据与counter的对应关系;使用的数据块的地址是数据块的物理地址:
addrcounter=Hkey(block||addrblock) (1);
当CPU从内存中读取一个数据块时:直接从内存中读取数据块;同时,如果这个数据块对应的counter在缓存中,则直接使用这个counter解密取到的数据块;如果这个counter不在缓存中,则根据计算系统为这个数据块分配的counter在内存中的内存位置,读取这个counter,使用读取到的counter对取到的数据块进行解密。
2.如权利要求1所述的一种保护内存存储器数据完整性的方法,其特征在于将数据块和数据块的地址的连接作为带密钥的MAC函数的输入,确保每次的输入都是不同的,产生不同的输出;如果产生冲突,采用通用的冲突消解方法处理。
3.如权利要求1或2所述的一种保护内存存储器数据完整性的方法,其特征在于,添加另一个非常短的输入counter_i,进一步消除MAC函数的输入发生重复的可能性,counter_i与数据以明文方式连接起来存储;相应的,在验证数据完整性的步骤中,计算counter的存储地址时也按照式(2)计算:
addrcounter=Hkey(block||counter_i||addrblock) (2)。
CN201410707362.4A 2014-11-27 2014-11-27 存储器数据完整性保护的方法 Expired - Fee Related CN104463020B (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410707362.4A CN104463020B (zh) 2014-11-27 2014-11-27 存储器数据完整性保护的方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410707362.4A CN104463020B (zh) 2014-11-27 2014-11-27 存储器数据完整性保护的方法

Publications (2)

Publication Number Publication Date
CN104463020A CN104463020A (zh) 2015-03-25
CN104463020B true CN104463020B (zh) 2017-08-22

Family

ID=52909040

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410707362.4A Expired - Fee Related CN104463020B (zh) 2014-11-27 2014-11-27 存储器数据完整性保护的方法

Country Status (1)

Country Link
CN (1) CN104463020B (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9798900B2 (en) * 2015-03-26 2017-10-24 Intel Corporation Flexible counter system for memory protection
US9710675B2 (en) * 2015-03-26 2017-07-18 Intel Corporation Providing enhanced replay protection for a memory
CN106681941A (zh) * 2015-11-07 2017-05-17 上海复旦微电子集团股份有限公司 存储器的数据写入、读出方法及装置
CN105608147B (zh) * 2015-12-17 2019-05-21 无锡天脉聚源传媒科技有限公司 一种隐藏图片原始地址的方法及装置
US10396991B2 (en) 2016-06-30 2019-08-27 Microsoft Technology Licensing, Llc Controlling verification of key-value stores
CN112597488B (zh) * 2020-12-30 2022-12-06 海光信息技术股份有限公司 页表完整性保护方法、装置和设备

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6931480B2 (en) * 2001-08-30 2005-08-16 Micron Technology, Inc. Method and apparatus for refreshing memory to preserve data integrity
CN102841998A (zh) * 2012-07-11 2012-12-26 哈尔滨工程大学 内存附加校验器的内存数据完整性保护方法

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6931480B2 (en) * 2001-08-30 2005-08-16 Micron Technology, Inc. Method and apparatus for refreshing memory to preserve data integrity
CN102841998A (zh) * 2012-07-11 2012-12-26 哈尔滨工程大学 内存附加校验器的内存数据完整性保护方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
存储器机密性完整性保护技术研究;程顺燚;《中国优秀硕士学位论文全文数据库》;中国学术期刊(光盘版)电子杂志社;20130215(第2期);第35-42页 *

Also Published As

Publication number Publication date
CN104463020A (zh) 2015-03-25

Similar Documents

Publication Publication Date Title
CN104463020B (zh) 存储器数据完整性保护的方法
US11088846B2 (en) Key rotating trees with split counters for efficient hardware replay protection
US8516271B2 (en) Securing non-volatile memory regions
US11239994B2 (en) Techniques for key provisioning in a trusted execution environment
CN107667374B (zh) 用于存储器保密性、完整性和重放保护的技术
US10496841B2 (en) Dynamic and efficient protected file layout
US8954752B2 (en) Building and distributing secure object software
US9898624B2 (en) Multi-core processor based key protection method and system
US11658808B2 (en) Re-encryption following an OTP update event
US20140095883A1 (en) Hardening of direct anonymous attestation from side-channel attack
CN108090366B (zh) 数据保护方法及装置、计算机装置及可读存储介质
US20190042474A1 (en) Enhanced storage encryption with total memory encryption (tme) and multi-key total memory encryption (mktme)
CN105320895B (zh) 用于联机加密处理的高性能自主硬件引擎
CN107430555B (zh) 用于存储器保护的高速缓存和数据组织
MX2007008540A (es) Metodo y dispositivo de almacenamiento portatil para asignar area segura en area insegura.
US20170085540A1 (en) Secure data re-encryption
US11863670B2 (en) Efficient side-channel-attack-resistant memory encryptor based on key update
CN103136458A (zh) 一种Linux操作系统的代码保护方法及其模块
CN104023009B (zh) 一种Web系统许可证验证方法
CN105205416A (zh) 一种移动硬盘密码模块
CN104636276A (zh) 一种保护内存存储器数据机密性和完整性的方法
CN103679066A (zh) 可信保密磁盘的实现方法
EP3588841A1 (en) Method and device for executing an authentication scheme
CN103198258A (zh) 复合系统以及传输数据的方法
US20230099543A1 (en) Application-specific computer memory protection

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20170822

Termination date: 20201127

CF01 Termination of patent right due to non-payment of annual fee