WO2016037488A1 - 一种保护敏感信息的方法及装置 - Google Patents

一种保护敏感信息的方法及装置 Download PDF

Info

Publication number
WO2016037488A1
WO2016037488A1 PCT/CN2015/078038 CN2015078038W WO2016037488A1 WO 2016037488 A1 WO2016037488 A1 WO 2016037488A1 CN 2015078038 W CN2015078038 W CN 2015078038W WO 2016037488 A1 WO2016037488 A1 WO 2016037488A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
memory
blocks
block
information
Prior art date
Application number
PCT/CN2015/078038
Other languages
English (en)
French (fr)
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 WO2016037488A1 publication Critical patent/WO2016037488A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/14Protection against unauthorised use of memory or access to memory

Definitions

  • This paper relates to the field of mobile Internet, and in particular to a method and device for protecting sensitive information.
  • Some of the currently widely used BYOD implementation technologies are based on a dedicated API (Application Programming Interface) to develop enterprise security applications. Some are for existing third-party applications, using direct modification software installation packages or As a new software installation package, the original software installation package adds security functions such as VPN (Virtual Private Network) login, data isolation, and information management and control to applications that do not have enterprise security policy functions.
  • VPN Virtual Private Network
  • encryption technology is required for the protection of sensitive information. For example, when it is necessary to protect the original application installation package, the software installation package needs to be stored in an encrypted form; when it is required to operate on the user. When file data is protected, the file can also be saved in encrypted form.
  • the files that have been encrypted and processed must be decrypted before they can be used.
  • the enterprise application runs in a white-box environment, so the decrypted file cannot be directly saved to the external file system in a clear manner, otherwise the sensitive information that needs to be protected will be in danger of being leaked.
  • a simple way to resolve this contradiction is to protect these decrypted messages with memory files.
  • the memory files that have been decrypted may still be easily located, and the attacker can obtain the original content of the sensitive information required.
  • Embodiments of the present invention provide a method and apparatus for protecting sensitive information, so as to increase the complexity of an attacker acquiring original file content.
  • the decrypted file containing the sensitive information is divided into a plurality of file blocks of corresponding size and stored in the plurality of memory blocks, respectively.
  • the requesting a plurality of memory blocks that are randomly determined in length include:
  • the random length of the memory block for storing the file attribute information is set to be smaller than the length of the file feature information.
  • the method further includes:
  • the plurality of memory blocks are rearranged in a random order, and then the file blocks are saved.
  • the reference information of the memory block includes: an address pointer to the memory block, a length of the memory block, and location information of the file block saved by the memory block in the file;
  • the nodes in the data structure also hold address pointers to the upper node and/or the lower node.
  • the method further includes: performing conversion processing on one or more pieces of information stored in the data structure node, where different items adopt the same or different conversion manners.
  • the method further includes: performing security processing when the data structure is provided to other program modules for use.
  • the method before the dividing the file into a plurality of file blocks of a corresponding size, or storing the divided plurality of file blocks before the plurality of memory blocks, the method further includes: data or a file block of the file.
  • the data is processed as content that is not directly usable.
  • An embodiment of the present invention further provides an apparatus for protecting sensitive information, including:
  • the application module is configured to apply for a plurality of randomly determined memory blocks, each of which is obtained by dynamically allocating, and associates the memory blocks with a discontinuous data structure, and uses multiple of the data structures.
  • the node separately stores reference information of the memory block;
  • the saving module is configured to divide the decrypted file containing the sensitive information into a plurality of file blocks of a corresponding size, and respectively stored in the plurality of memory blocks.
  • the application module is further configured to set a random length of the applied memory block for saving file feature information to be smaller than a length of the file feature information.
  • the device further includes
  • the programming module is configured to rearrange the plurality of memory blocks requested by the application module in a random order, and then trigger the saving module to save the file block.
  • the reference information of the memory block applied by the application module includes: a location pointing to the memory block The location pointer, the length of the memory block, and the location information of the file block held by the memory block in the file;
  • the nodes in the data structure also hold address pointers to the upper node and/or the lower node.
  • the foregoing apparatus further includes:
  • the first processing module is configured to perform conversion processing on one or more pieces of information stored in the data structure node, and different items adopt the same or different conversion manners.
  • the foregoing apparatus further includes:
  • the second processing module is configured to perform security processing first when the data structure is provided to other program modules.
  • the foregoing apparatus further includes:
  • a third processing module configured to: before the saving module divides the file into a plurality of file blocks of a corresponding size, or save the divided plurality of file blocks before the plurality of memory blocks, respectively, the file
  • the data of the data or file block is processed as content that is not directly usable.
  • the embodiment of the invention further provides a computer readable storage medium storing program instructions, which can be implemented when the program instructions are executed.
  • the embodiments of the present invention provide a method and an apparatus for protecting sensitive information, which can increase the complexity of an attacker acquiring the original file content. In other words, even if an attacker can locate the beginning of sensitive information in the dumped memory data, the complete original file content cannot be easily obtained.
  • FIG. 1 is a layout diagram of an address space of a general user process under the 32-bit Android (Android) operating system of the related art.
  • FIG. 2 is a schematic diagram of a memory area of a continuous application of the related art.
  • FIG. 3 is a flowchart of protecting sensitive information according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a fragmented memory block organized by using a linked list method according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of a fragmented memory block organized by a binary tree method according to an embodiment of the present invention.
  • FIG. 6 is a diagram of converting key information in an object node in a data structure according to an embodiment of the present invention. Schematic diagram of the treatment.
  • FIG. 7 is a schematic diagram of an apparatus for protecting sensitive information according to an embodiment of the present invention.
  • Figure 1 depicts the layout of the address space of a general user process under the 32-bit Android (Android) operating system. Under other terminal operating systems, the memory layout of the user process space, including the Linux operating system on the PC side, is similar. .
  • Android Android
  • the address space referred to herein refers to the virtual address space of the user process, so the address layout is a continuous flat space; if mapped to physical memory, then these addresses may be discontinuous. This does not increase security for enterprise applications in a white-box operating environment.
  • the address space is continuous from the perspective of a single user process. In this contiguous address space, the code segment, the data segment, the memory allocation heap, the stack space, and the address space occupied by the shared library mapped to the user process can be explicitly located to the user process, and so on.
  • the user process code segment is from 0x2a000000 virtual address (a higher version of the Linux kernel may support
  • the memory address randomization function adds a random offset based on the starting address, but this is also the known parameter for the attacker in the white-box environment, and the immediate part is statically allocated.
  • the memory dynamically requested by the user process at runtime is allocated in the heap space. Therefore, for an attacker in the white box running environment, as long as the memory dumping opportunity is obtained, the storage location of the positioning file can be searched in the heap space according to the characteristic information of the known target file.
  • Figure 2 depicts the security risks that may be faced if a continuously applied memory area is used to hold the contents of the decrypted file.
  • the dex file contains all the Java code in the user application.
  • the bytecode generated after compilation. This file is characterized by the first 8 bytes being the ASCII character 'dex ⁇ n' or 'dey ⁇ n' plus the version number, and the version number actually has only two, '036' and '035', even considering Transport There are only eight types of target feature byte arrays to be searched for in the endianness of the line environment.
  • the purpose of the embodiment of the present invention is to design an attacking manner that can resist the memory dump mentioned above, so that the enterprise application after security hardening is not used because the sensitive information is decrypted and used, so that the attacker is attacked. Easy to acquire, which increases the security of enterprise applications.
  • the attacker cannot obtain the feature information of the file header, but locates the sensitive information in the memory according to the characteristics of other locations of the file, since the file data is continuously stored, it is also possible to correlate the content of the file after decryption. To get some or all of the original file content.
  • FIG. 3 is a flowchart of protecting sensitive information according to an embodiment of the present invention. As shown in FIG. 3, the method in this embodiment includes:
  • each memory block is obtained by dynamically allocating, and the memory blocks are associated with a discontinuous data structure, and are saved by using multiple nodes in the data structure.
  • the "corresponding" means that the file block size corresponds to the memory block size.
  • the solution proposed by the embodiment of the present invention saves the content of the file that needs to be continuously stored in a fragmented manner in the memory. This avoids the leakage of information caused by writing file content to the file system, and it can largely resist the analysis of memory dumps that attackers can use.
  • the content of the decrypted file is saved in a fragmented memory block, and each memory block is obtained by dynamically allocating, and a random memory block length is used when applying.
  • the random length of the memory block containing the sensitive information feature data can be set as much as possible to be smaller than the file header feature length. Although it is a random value, its range of values is usually configurable when it is programmed.
  • a non-contiguous data structure is created, and reference information of the plurality of memory blocks is separately saved by using a plurality of nodes in the data structure, for example, a tree such as a linked list or a binary tree is used.
  • the data structure holds reference information for the memory block.
  • the reference information of the memory block may include: an address pointer pointing to the memory block, a length of the memory block, and location information of the file block saved by the memory block in the file;
  • the nodes in the data structure also hold address pointers to the upper node and/or the lower node.
  • the key information stored in the node objects in these data structures can be converted to prevent attackers from using reverse techniques to analyze the data structures and files used. Full content.
  • Converting one or more pieces of information stored in the data structure node, and converting the different items may be the same or different.
  • the securely processed file data structure needs to be packaged before it can be supplied to other program modules.
  • Use block to minimize the complexity of the implementation of external modules caused by application security hardening technology
  • the security processing here can be reversible and the linear or non-linear operations of the field of operation values in the data structure can be loaded, for example, stream symmetric encryption, shifting, mapping tables, XOR, and the like.
  • the data in the memory block can be processed, for example, by performing stream symmetric encryption, and the original information is not recorded, and the original content of the file data block is calculated and restored when the data is read.
  • Data blocks saved in memory are not directly usable.
  • the implementation scheme described in this embodiment can ensure that when the enterprise application runs in an insecure mobile terminal environment in the form of a white box, and the attacker uses an attack technology such as a memory dump, the file content that has been decrypted can still be guaranteed. It is easily acquired to increase the security of enterprise applications while they are running.
  • Figure 4 illustrates an example of the implementation of a fragmented file block using a linked list approach:
  • the memory used to store the contents of the actual file is dynamically applied in a manner that is smaller than the length of the file.
  • the length of the memory block at the time of application is randomly selected as long as the value is much smaller than the actual length of the file.
  • this value is too small, it may cause too many file blocks to be processed when reading and writing files, resulting in a decrease in processing efficiency.
  • the value is too large, the number of file blocks will be less, and it will be less difficult for a natural attacker to use the file features to obtain the original content of the file.
  • the specific implementation method of the memory allocation algorithm provided by the operating system and the application framework will be allocated in different pre-application memory pages according to different length memory allocation requests.
  • using a random memory length can prevent an attacker from determining the location of a file block based on the length of the memory block.
  • it can also make the allocated memory block empty in the user process.
  • the position in the room is not continuous, which is actually the main goal that is expected to be achieved by using fragmented memory to hold the contents of the file.
  • the memory blocks of different lengths that are applied in advance may be rearranged in a random order to ensure that the memory blocks that are ultimately used to save the actual contents of the file are dispersed as much as possible in the user process space.
  • the address information and location information of these file blocks need to be organized in a certain form. .
  • this kind of organization can be various, as long as it can ensure that the application module can efficiently complete the continuous and random reading and writing of the file content, then this organization is acceptable.
  • FIG 4 is a simplified implementation of a file block reference implemented using a doubly linked list.
  • each data node in the linked list is a custom structure.
  • the information elements that need to be saved in this structure include the address of the memory block pointed to by the current node, the length of the memory block, and the location of the memory block in the file.
  • the characteristics of the doubly linked list can be utilized, when the program accesses a node in the middle of the linked list, the forward node of the current node is directly accessed through the reverse pointer to speed up the process of positioning processing, but each time the random access request of the application arrives, the file is obtained.
  • the position of the current position pointer is unknown. Therefore, only the doubly linked list structure is used to store file block reference information, which may not be suitable in situations where performance requirements are particularly high.
  • FIG. 5 an implementation example of saving a file block application using a simple binary tree form is also given.
  • the tree storage structure that can be chosen is much more than a binary tree, so the description given here can be seen as a generalization of the use of tree storage structures in such functional scenarios.
  • the algorithm when inserting nodes needs to be adjusted according to the specific data structure and search in comparison with the simple binary tree.
  • the adjustment of the algorithm when traversing the nodes but the main idea has not changed, that is, using discrete nodes in the user process space to save reference information on the fragmented file block, and provide the application with the most efficient access means.
  • the access interface of the external application does not need to implement the deletion of the node or the memory block, but only needs to increase the memory block or insert the node when necessary. Yes.
  • the node object of each binary tree is similar to the one in the doubly linked list implementation example, and also stores the address pointer to each memory block, as well as the length of the memory block and the location information in the file. .
  • an address pointer to the left child node and an address pointer to the right child node are also set in each node object.
  • the position of each memory block in the file can be used as the key value of the node, thus naturally ensuring the node order relationship required by the binary tree structure.
  • the relationship between the nodes can be designed such that the file blocks pointed to by the nodes in all the left subtrees are located in the file more than the current node points, and the file block locations pointed to by the nodes in all the right subtrees. They are all behind the current one. In this way, when the tree structure is traversed in a sequential manner, sequential access to the file can be completed by the file block information pointed to in each node.
  • the application needs to implement random access to files, it can also take advantage of the orderly organization between nodes in the tree structure, and reduce the number of nodes that need to be accessed when searching for file blocks. The number of points.
  • the file content is saved into the fragmented memory block, and the reference information units pointing to the memory blocks are organized into discrete nodes in the form of a linked list, a binary tree, etc., but the nodes are saved to point to other
  • the address information of the node in particular, the address information pointing to each file block, the length of each file block, and the location information in the file.
  • FIG. 6 An example of an implementation example is given in Figure 6. This is an illustration of the hardening process for organizing the fragmentation of memory block reference nodes with a doubly linked list as mentioned above.
  • each address pointer to another location needs to be transformed. This includes each pointer to the next node in the linked list node, a pointer to the previous node, and a pointer to the memory block.
  • the specific conversion algorithm can be various, including the use of a simple comparison table conversion, or the use of encryption methods or non-linear formulas to transform the address information, the lesser-known conversion method, the security enhancement effect achieved. The better.
  • the null pointer in each node can be considered not to be converted, although this may provide convenience for the attacker to locate the node object, but if the result of each null pointer conversion is the same, then it may still provide an analysis for the attacker. Good clues, and may also expose the way other addresses are converted. Of course, this is related to the specific conversion method used. When using a conversion method, when you choose to convert the null pointer to a higher final security, you will naturally choose to convert instead of ignore it. As long as the explicit association between the memory block and the corresponding reference node can be cut off, it is not so easy to find the other party based on one of them.
  • the conversion of the length of the memory block in the reference node and the location information of the memory block in the file can also increase the security of the specific implementation.
  • the conversion method used here can still be selected according to actual needs in different program implementations.
  • An example of an interface definition is:
  • the input parameter is the file length, or there is no input, which indicates that such a file is created with a default or 0 length.
  • the return object is a pointer to the head node of the storage area.
  • the internal library implementation may first decrypt the file and then call the function that creates the fragmented region with the decrypted file length as a parameter.
  • the application expands a fragmented storage area that has been created with a specified length: the input parameter is Pointer to the head node of the storage area that has been created and the file length that needs to be expanded.
  • the return object is a pointer to the head node of the storage area.
  • the application releases a fragmented storage area: the input parameter is the head node pointer of the storage area that has been created, and the return parameter is a flag indicating whether the execution is successful or not.
  • the application requests to read a specified part or all of the contents in the fragmented storage area: the input parameters are naturally first the head node pointer of the already created storage area, and the offset and the data to be read that need to be read. Length and output buffer, etc., and the output parameter is the number of bytes actually read.
  • the application request writes a specified portion of the fragmented storage area: it has similar input and output parameters as the read request, including the pointer of the storage area and the offset of the file location for the start of the write operation and the length of the data to be written. And the buffer in which the data to be written is located.
  • the interface returns the number of bytes of data actually written.
  • one or more dedicated interfaces can be defined, including one character and one character, to facilitate the use of the application.
  • the application can not be easily developed, or the application can only perform reading and writing of the memory file in the form of a standard file library interface, then it is necessary to perform another on the basis of the above interface.
  • the layer wrapper provides an external access interface in the form of a standard file object, and the above-mentioned customized interface is used when processing inside the file object. This is almost no additional adaptation burden for application development.
  • this interface Since a specialized interface is provided to access the fragmented file storage area, this interface has actually isolated the raw data accessed in the application and the data stored in memory. In other words, even in a memory block that has been fragmented, it is not necessary to save the original contents of the file. As mentioned earlier, if the file content is saved in its original form, even after fragmentation, the attacker can directly search and locate the first file block, unless the first file block is small enough to be sufficient. Contains the length of the feature bytes that the attacker needs to match. However, the previously described scheme has given a number of designs to ensure that even if an attacker gets a small file fragment, it is not enough to continue to acquire other sensitive information. But just do it on this specialized interface Processing, then even can prevent an attacker from obtaining a file block with property information. The processing of this step is optional, but adding such a treatment can indeed enhance the security that can be obtained.
  • This secure conversion process on a specialized interface can be understood as re-encrypting and decrypting the contents of the file that has been fragmented.
  • a fixed-length memory block is required as an input to the encryption and decryption processing module, such as 8 bytes, 16 bytes, or even 128 bytes.
  • the encryption and decryption processing module such as 8 bytes, 16 bytes, or even 128 bytes.
  • the single-byte based conversion method is selected, which is more suitable for the efficiency of file reading and writing.
  • the fragmentation process has provided the necessary guarantees for the overall security, so that this optional process can meet the requirements without too much complexity.
  • FIG. 7 is a schematic diagram of an apparatus for protecting sensitive information according to an embodiment of the present invention. As shown in the figure, the apparatus of this embodiment includes:
  • the application module is configured to apply for a plurality of randomly determined memory blocks, each of which is obtained by dynamically allocating, and associates the memory blocks with a discontinuous data structure, and uses multiple of the data structures.
  • the node separately stores reference information of the memory block;
  • the saving module is configured to divide the decrypted file containing the sensitive information into a plurality of file blocks of a corresponding size, and respectively stored in the plurality of memory blocks.
  • the application module is further configured to set a random length of the applied memory block for saving the file feature information to be smaller than a length of the file feature information.
  • the apparatus may further include:
  • the programming module is configured to rearrange the plurality of memory blocks requested by the application module in a random order, and then trigger the saving module to save the file block.
  • the reference information of the memory block includes: an address pointer to the memory block, a length of the memory block, and location information of the file block saved by the memory block in the file;
  • the nodes in the data structure also hold address pointers to the upper node and/or the lower node.
  • the apparatus may further include:
  • the first processing module is configured to perform conversion processing on one or more pieces of information stored in the data structure node, and different items adopt the same or different conversion manners.
  • the apparatus may further include:
  • the second processing module is configured to perform security processing first when the data structure is provided to other program modules.
  • the apparatus may further include:
  • a third processing module configured to: before the saving module divides the file into a plurality of file blocks of a corresponding size, or save the divided plurality of file blocks before the plurality of memory blocks, respectively, the file
  • the data of the data or file block is processed as content that is not directly usable.
  • the invention can increase the complexity of the attacker acquiring the original file content, that is, the attacker cannot easily obtain the complete original file content.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明实施例提供一种保护敏感信息的方法及装置,该方法包括:申请多个长度随机确定的内存块,每一内存块均采用动态分配的方式获取,并以不连续的数据结构来关联所述内存块,利用所述数据结构中的多个节点分别保存所述内存块的引用信息;将已解密的包含敏感信息的文件划分为相应大小的多个文件块,分别保存在所述多个内存块中。

Description

一种保护敏感信息的方法及装置 技术领域
本文涉及移动互联网领域,尤其涉及一种保护敏感信息的方法及装置。
背景技术
随着移动宽带技术和终端硬件平台技术的不断发展,移动终端上可用的计算资源足以满足各种办公场景的需求,并且廉价和随处可用的无线网络,也可以帮助人们利用移动终端随时随地地访问本来需要通过固定网络才能够获取的各种数据和文件。随着移动终端操作系统技术的发展,各种原来只有在桌面办公系统中才能够使用的应用软件,都已经以适合移动终端用户操作的方式,在各种移动操作系统环境中被开发出来。这些基础设置的普及,推动着移动终端在企业办公环境中的使用越来越普遍。
当企业员工使用自有的和企业配发的移动终端执行各种办公操作时,很重要的一点就是考虑在这种操作过程中,使用的各种数据的安全性以及网络的安全性等。不过,完全限定用户只在专用手机上安装指定应用来完成移动办公的需求,显然背离了用户原本可以通过移动终端办公所能够达到的高效、舒适和便捷的体验目标。因此,即便有诸多的安全考虑,但是企业应用软件的实际运行环境,还是混合了企业专有应用和用户自有应用的复杂系统环境。这是各种BYOD(Bring Your Own Device,自带设备)实现技术的主要需求驱动来源。
当前普遍使用的BYOD实现技术中,有些是基于专门的API(Application Programming Interface,应用程序编程接口)来开发企业安全应用,有些是针对既有的第三方应用,采用直接修改软件安装包或者是将原有软件安装包作为一个新的软件安装包的载荷的方式,为这些本来没有企业安全策略功能的应用软件添加VPN(Virtual Private Network,虚拟专用网络)登录、数据隔离、信息管控等安全功能。不管是采用哪一种BYOD实现技术,在对敏感信息的保护方面,都需要使用加密技术。比如,当需要对原始的应用安装包进行保护时,需要将该软件安装包以加密的形式来存储;当需要对用户操作的 文件数据进行保护时,同样也可以用加密的形式来保存文件。
既然有加密,自然就需要有解密操作,否则直接使用这些已经被加过密的数据,只能导致软件原有的功能失效。这种解密操作只能在软件的运行时进行,否则就失去了对敏感信息保护的意义。这时,就不得不考虑这种解密操作所处的运行环境。在BYOD场景中,即便是已经被做过安全加固的企业应用软件,也是在充满安全风险的用户终端环境中运行,可能遭遇到各种已知和未知的安全攻击。一般将这种无法掌控的安全环境称之为白盒运行环境,与之相对的黑盒运行环境中,软件内部的运行细节,比如进程空间等,对于用户来说,都是不可访问的,但是在这种白盒环境中,此种假设将不能成立。
为了保证企业应用软件功能的正常执行,必须将已经加密处理过的文件重新解密后才能够加以使用。但是考虑到BYOD业务场景中,企业应用运行在白盒环境中,因此解密后的文件不能以明码的方式直接保存到外部文件系统中,否则需要保护的敏感信息将遭遇到泄漏的危险。一种简单的解决这种矛盾的处理方式是:以内存文件来保护这些已经被解密的信息。但是当攻击者使用内存转储的方式来分析用户进程的全部地址空间时,这些已经被解密处理的内存文件还是可能被轻易地定位,攻击者可以据此获得所需要的敏感信息的原始内容。
发明内容
本发明实施例提供一种保护敏感信息的方法及装置,以增加攻击者获取原始文件内容的复杂度。
本发明实施例提供的一种保护敏感信息的方法,包括:
申请多个长度随机确定的内存块,每一内存块均采用动态分配的方式获取,并以不连续的数据结构来关联所述内存块,利用所述数据结构中的多个节点分别保存所述内存块的引用信息;
将已解密的包含敏感信息的文件划分为相应大小的多个文件块,分别保存在所述多个内存块中。
可选地,所述申请多个长度随机确定的内存块,包括:
将申请的用于保存文件特性信息的内存块的随机长度设定为小于所述文件特征信息的长度。
可选地,所述申请多个长度随机确定的内存块后,所述方法还包括:
将所述多个内存块以随机的顺序重新编排,然后再保存所述文件块。
可选地,所述内存块的引用信息包括:指向内存块的地址指针、内存块长度和内存块所保存的文件块在所述文件中的位置信息;
所述数据结构中的节点还保存有指向上节点和/或下节点的地址指针。
可选地,所述方法还包括:对所述数据结构节点中保存的一项或多项信息进行转换处理,不同项采用的转换方式相同或不同。
可选地,所述方法还包括:在将所述数据结构提供给其他程序模块使用时,先进行安全处理。
可选地,将所述文件划分为相应大小的多个文件块之前,或者将划分的多个文件块分别保存在所述多个内存块之前,还包括:将所述文件的数据或文件块的数据处理为不可直接使用的内容。
本发明实施例还提供了一种保护敏感信息的装置,其中,包括:
申请模块,设置为申请多个长度随机确定的内存块,每一内存块均采用动态分配的方式获取,并以不连续的数据结构来关联所述内存块,利用所述数据结构中的多个节点分别保存所述内存块的引用信息;以及
保存模块,设置为将已解密的包含敏感信息的文件划分为相应大小的多个文件块,分别保存在所述多个内存块中。
可选地,所述申请模块,还设置为将申请的用于保存文件特征信息的内存块的随机长度设定为小于所述文件特征信息的长度。
可选地,所述装置还包括,
编排模块,设置为对所述申请模块申请的多个内存块以随机的顺序重新编排,然后触发所述保存模块保存所述文件块。
可选地,所述申请模块申请的内存块的引用信息包括:指向内存块的地 址指针、内存块长度和内存块所保存的文件块在所述文件中的位置信息;
所述数据结构中的节点还保存有指向上节点和/或下节点的地址指针。
可选地,上述装置还包括:
第一处理模块,设置为对所述数据结构节点中保存的一项或多项信息进行转换处理,不同项采用的转换方式相同或不同。
可选地,上述装置还包括:
第二处理模块,设置为在将所述数据结构提供给其他程序模块使用时,先进行安全处理。
可选地,上述装置还包括:
第三处理模块,设置为在所述保存模块将所述文件划分为相应大小的多个文件块之前,或者将划分的多个文件块分别保存在所述多个内存块之前,将所述文件的数据或文件块的数据处理为不可直接使用的内容。
本发明实施例还提供一种计算机可读存储介质,存储有程序指令,当该程序指令被执行时可实现上述方法。
综上,本发明实施例提供一种保护敏感信息的方法及装置,可以增加攻击者获取原始文件内容的复杂度。换句话说,即便攻击者能够在转储的内存数据中定位到敏感信息的开始位置,也不能轻易地获取到完整的原始文件内容。
附图概述
图1是相关技术的32位Android(安卓)操作系统下一般用户进程的地址空间的布局图。
图2是相关技术的连续申请的内存区域的示意图。
图3为本发明实施例的一种保护敏感信息的流程图。
图4为本发明实施例的使用链表方式组织碎片化的内存块的示意图。
图5为本发明实施例的使用二叉树方式组织碎片化的内存块的示意图。
图6为本发明实施例的对数据结构中的对象节点中的关键信息进行转换 处理的示意图。
图7为本发明实施例的一种保护敏感信息的装置的示意图。
本发明的实施方式
图1描述的是32位Android(安卓)操作系统下一般用户进程的地址空间的布局图,在其他的终端操作系统下,包括在PC端的Linux操作系统等的用户进程空间的内存布局也是类似的。
如图1所示,这里所说的地址空间是指的用户进程的虚拟地址空间,因此地址布局是一个连续平坦空间;如果是映射为物理内存的话,那么这些地址可能是不连续的。这一点对于白盒运行环境中的企业应用来说,并没有增加安全保障。换句话说,尽管用户进程申请的存储区域在整个运行时环境中和其他进程所申请的存储区域在物理上是交错的,但是从单一用户进程的角度来看,其地址空间还是连续的。在这个连续的地址空间中,可以明确地定位到用户进程执行镜像的代码段、数据段、内存分配堆、栈空间以及映射到用户进程中的共享库所占用的地址空间,等等。在一个确定的终端操作系统环境中,这些参数的边界,很多都是预设的,比如在32位的Android运行环境中,用户进程代码段是从0x2a000000虚拟地址(较高版本Linux内核可能支持了内存地址随机化功能,在此开始地址基础上增加了随机偏移量,但是这对于白盒环境中的攻击者来说,也是已知的参数)开始的,而紧接的部分是静态分配的数据段,再接着是内存堆所占用的空间。而用户进程在运行时动态申请的内存,都是在堆空间中分配的。因此,对于白盒运行环境中的攻击者而言,只要能够得到内存转储的机会,就可以根据已知的目标文件的特征信息,在堆空间中搜索定位文件的存储位置。
图2描述的是假如利用一个连续申请的内存区域来保存已经解密后的文件内容,将可能面临的安全风险。从图2中可以清楚地看到,只要攻击者可以明确地知道文件头的特性信息,而这一点是很容易得到的,比如Android运行环境中,dex文件中包含这一个用户应用中全部Java代码编译后生成的字节码。这种文件的特征是前8个字节为ASCII字符‘dex\n’或者‘dey\n’加上版本号,而版本号实际上只有两种,‘036’和‘035’,即使考虑到运 行环境中字节序的不同,所需要搜索的目标特征字节数组也只有8种。对于其他可能的攻击者感兴趣的敏感信息文件来说,这种明确的特征也是可能存在的。尤其是这些有着固定格式的文件在其头部的元数据中通常都带有诸如文件头长度、文件长度等信息。因此,只要能够根据文件的特征信息定位到文件数据存放的开始虚拟地址,就可以从导出的用户进程空间数据中方便地得到敏感数据的原始内容。
本发明实施例的目的是设计一种可以抵抗上面提到的内存转储的攻击手段,以使得经过安全加固后的企业应用在运行时,不因为将敏感信息解密后使用,导致其被攻击者轻易地获取,进而增加企业应用的安全性。
分析攻击者能够通过内存转储的方式分析并获取原始敏感信息的原因,主要是因为攻击者可以根据原始文件的特征信息,比如标准的文件头等,在内存映像中搜索并定位到原始文件的开始位置,并根据文件头获取文件的元数据(可能包括文件长度等参数)。此时,如果文件数据在内存中以连续地址的方式来保存,那么攻击者只要以对应的文件头位置加上文件长度参数,就可以截取出文件内容。即便不知道文件长度参数,也可以通过逐步尝试的方式,获取精确的文件原始内容。假如攻击者不能得到文件头的特征信息,而是根据文件其他位置的特征来定位内存中的敏感信息的话,由于文件数据是连续存放的,因此,也可以根据已经解密后的文件内容的相关性,来得到部分或者全部的原始文件内容。
总而言之,只要解密后的文件内容以连续的方式保存在内存中,那么就不能阻止攻击者在白盒运行环境中以内存转储的方式,在运行时分析并得到原本是加密处理过的敏感信息。
图3为本发明实施例的一种保护敏感信息的流程图,如图3所示,本实施例的方法包括:
S11、申请多个长度随机确定的内存块,每一内存块均采用动态分配的方式获取,并以不连续的数据结构来关联所述内存块,利用所述数据结构中的多个节点分别保存所述内存块的引用信息;
S12、将已解密的包含敏感信息的文件划分为相应大小的多个文件块,分别保存在所述多个内存块中。
所述“相应”是指文件块大小与内存块大小相应。
本发明实施例提出的方案,是将原本需要连续存放的文件内容,以碎片化的方式保存在内存中。这样既可以避免将文件内容写入到文件系统中所造成的信息泄漏,又可以在很大程度上抵抗攻击者所能够使用的内存转储的分析手段。
其中,已经解密的文件内容以碎片化的内存块保存,每个内存块采用动态分配的方式获取,且申请时使用随机的内存块长度。为了使得攻击者难以根据文件头特征定位到敏感信息,一般可以将包含敏感信息特征数据的内存块的随机长度尽量设定为小于文件头特征长度。尽管是随机值,但是其取值范围在编程实现时通常是可以指定的。
其中,在使用这种碎片化的处理方式时,创建非连续的数据结构,利用所述数据结构中的多个节点分别保存所述多个内存块的引用信息,例如采用链表或二叉树等树型数据结构保存对所述内存块的引用信息。这些已经申请到的内存块,应该避免使用指针数组或者对象数组等连续的数据结构来保存,而是以链表、二叉树等数据结构形式组织起来,由这些数据结构中的节点对象里的指针指向每块数据的开始地址。
所述内存块的引用信息可以包括:指向内存块的地址指针、内存块长度和内存块所保存的文件块在所述文件中的位置信息;
所述数据结构中的节点还保存有指向上节点和/或下节点的地址指针。
在这些数据结构的节点对象中,至少还需要保存每个内存块的长度和该内存块在整个文件中的位置信息,以方便程序对文件数据的连续访问和随机访问。
可以通过对这些数据结构中的节点对象里所保存的关键信息,比如地址指针、数据块长度、数据块位置信息等进行转换处理,来阻止攻击者使用逆向技术分析出所用的数据结构以及文件的完整内容。
对所述数据结构节点中保存的一项或多项信息进行转换处理,不同项采用的转换方式可以相同或不同。
经过安全处理的文件数据结构需要经过包装后才能够提供给其他程序模 块使用,尽量减少应用安全加固技术所带来的外部模块的实现复杂度的增加;
这里的安全处理可以是可逆的以及运算结果取值范围在数据结构中字段所能够装载的线性或者非线性运算,例如,流式对称加密、移位、映射表、异或等等。
当然,可选地,可以对内存块中的数据进行处理,比如进行流式对称加密等处理,而并不记录原始信息,在读出数据时才计算并恢复出文件数据块的原始内容,这样在内存中保存的数据块,是不可直接使用的内容。
采用本实施例描述的实现方案可以保证当企业应用运行在白盒形式的不安全的移动终端环境中,并且攻击者使用了内存转储等攻击技术后,还是可以保证已经解密处理的文件内容不被轻易地获取,进而增加企业应用运行时的安全性。
下面结合附图对技术方案的实施例作详细描述。
图4说明的是使用链表方式组织碎片化的文件块的实现样例:
首先,用于存储实际文件内容的内存是按照小于文件长度的块的方式来动态申请的。不过,在申请时的内存块长度是随机选定的,只要该值是远小于文件的实际长度就可以。当然,如果这个值过小的话,可能造成在读取文件和写入文件时,需要处理的文件块的数量过多,造成处理效率的下降。而如果这个值过大的话,文件块的数量就会变少,自然攻击者利用文件特征获取文件原始内容的难度就会变小。当文件块数量过少时,即便攻击者不能一次性获取文件的全部内容,也可能只通过几个文件块甚至是一个文件块,就获取所需要的敏感信息,这当然是实现安全加固功能时所希望避免出现情况。因此,确定动态申请块长度时的随机值的可选范围以及每次的实际取值,是需要在实际终端处理能力、应用性能需求以及安全加固目标之间进行权衡的。
一般来说,操作系统和应用框架所提供的内存分配算法的具体实现方法,会根据不同长度的内存分配请求,在不同的预申请内存页面中来完成分配。换句话说,使用随机的内存长度,一方面可以防止攻击者根据内存块的长度来确定文件块的位置,另一方面,也可以使得分配到的内存块在用户进程空 间中的位置是不连续的,这实际上是使用碎片化的内存来保存文件内容所希望实现的主要目标。当然,为了尽量提高系统的安全性,也可以将预先申请的不同长度的内存块以随机的顺序重新编排后使用,以保证最终用于保存文件实际内容的内存块在用户进程空间中尽量地离散化。
为了能够使得应用在运行时正常访问到这些已经分配到的内存块,同时也为了保持这些文件块之间的固有的顺序关系,需要将这些文件块的地址信息和位置信息以一定的形式组织起来。实际上,这种组织方式可以是多种多样的,只要能够保证应用模块可以高效地完成连续和随机的对文件内容的读写操作,那么,该种组织方式都是可以接受的。但是,采用指针数组或对象数组这种连续数组方式来组织文件块是不可以的。原因在于,即便是对数组中的每个数据单元进行了安全处理,攻击者还是可以利用这些数据单元之间的线性关系,分析和它们相关的内存块的位置,并进而从已经转储出来的地址空间中找到目标文件块。只有当采用链表、二叉树等不连续的数据结构来保存对数据块的引用信息时,才能够保证这种碎片化的文件访问机制所带来的安全性得以真正实现。
图4是一种简单的利用双向链表实现的保存文件块引用的实现样例。在此样例中,链表中的每一个数据节点是一个自定义的结构。在此结构体中所需要保存的信息元素包括:当前节点指向的内存块的地址、该内存块的长度以及该内存块在文件中的位置。当然,为了实现双向链表数据结构,还需要在该结构中定义指向下一链表节点的地址指针和指向前一链表节点的地址指针。由于链表节点对象和内存块对象都是采用动态申请方式获取的,因此从实际用户进程运行时地址空间的角度观察,它们将以不连续的方式存放,这样就可以增大攻击者访问每一个内存块的难度。
利用双向链表来保存针对文件块引用信息可以很方便地支持对文件的顺序访问请求。这一点是很明显的,因为在链表的每一个节点中,都有指向下一个节点的地址指针。只要顺着这些指针的顺序,逐个访问每个链表节点,就可以得到全部的文件块地址指针,再根据这些文件块长度,就可以对文件内容进行读写。不过,如果应用希望完成对文件的随机读写,就需要从链表头开始逐个访问链表节点,根据该节点指向的文件块在整个文件中所处的位 置,确定要对哪个或者哪些文件块进行读写操作。尽管可以利用双向链表的特点,在程序访问到链表中间一个节点时,通过反向指针直接访问当前节点的前序节点来加快定位处理的过程,但是,每次应用的随机访问请求到达时,文件当前位置指针的位置是未知的,因此,只采用双向链表结构来保存文件块引用信息,在性能要求特别高的场合,可能是不合适的。
为此,在图5中,还给出了一种利用简单的二叉树的形式来保存文件块应用的实现样例。当然,可以选择的树形存储结构远不止二叉树一种,因此这里给出的说明可以看作是在此种功能场景中使用树形存储结构的笼统的概括。因为,即便是采用其他的树形数据结构来保存这些针对文件块的引用,和只使用简单二叉树相比,可能的不同主要在于插入节点时的算法需要根据具体的数据结构加以调整,以及在搜索和遍历节点时的算法的调整,不过,主要的思想并没有改变,那就是利用在用户进程空间中离散的节点来保存对碎片化文件块的引用信息,并且为应用提供尽量高效的访问手段。需要注意的是,当对内存的使用效率要求不高时,外部应用的访问接口中,可以无需实现对节点或者说是内存块的删除,而只需要在必要时,增加内存块或者插入节点就可以了。
从图5中可以看到,每个二叉树的节点对象中,和在双向链表实现样例中类似,也保存了指向每个内存块的地址指针,以及内存块的长度和在文件中的位置信息。不过,由于二叉树的结构特点,在每个节点对象中还设置了指向左子节点的地址指针和指向右子节点的地址指针。这里可以简单地设计为树中的每个节点都能够保存数据,也就是对应内存块的引用信息。在这种组织方式中,可以将每个内存块在文件中的位置,作为节点的键值,这样就自然保证了二叉树结构所需要的节点顺序关系。当然,也可以采用其他的键值,比如文件块的编号等等。可以将节点之间的关系设计为,所有左子树中节点所指向的文件块在文件中的位置都比当前节点所指向的要靠前,而所有右子树中节点所指向的文件块位置都比当前指向的要靠后。这样,当采用中序方式对树形结构进行遍历时,就可以通过每个节点中指向的文件块信息,完成对文件的顺序访问。而当应用需要实现对文件的随机访问时,也可以利用树形结构中节点之间有序组织的优点,减少搜索文件块时所需要访问的节 点数量。
本实施例的方案中,将文件内容保存到碎片化的内存块中,并且将指向这些内存块的引用信息单元以链表、二叉树等形式组织为离散化的节点,但这些节点中保存有指向其他节点的地址信息,尤其是保存有指向每个文件块的地址信息,还有每个文件块的长度以及在文件中的位置信息等。只要攻击者找到其中一个节点对象,并且了解了节点对象中的数据组织形式,那么还是有可能逐个地找到其他节点以及保存有文件内容的文件块。比如当攻击者根据文件头的特征定位到第一个文件块时,自然也可以得到该文件块在用户进程空间中对应的地址,而根据该地址又可以再找到对应的引用节点,那么只要攻击者对每个引用节点的组织方式有所了解的话,就可以实现将已经离散化保存的文件块再重新找到的任务。
因此,为了确保敏感信息的安全性,还可以对指向那些内存单元的引用节点的内容进行安全处理。图6中就给出了一个实现样例图。这是针对前面提到的用双向链表来组织对碎片化内存块引用节点进行组织时的加固处理实现示意。在这个实现样例中,每一个指向其他位置的地址指针都需要进行变换处理,这包括了链表节点中每一个指向后一个节点的指针以及指向前一个节点的指针,以及指向内存块的指针。这样,当直接在内存转储数据中搜索每个已知的地址信息时,是不可能准确找到对应的指针的。具体的转换算法是可以多种多样的,包括采用简单的对照表转换,或者是利用加密方法或者非线性公式对地址信息进行变换,越是不为人知的转换方法,所取得的安全加固的效果可能越好。
当然,每个节点中的空指针可以考虑不进行转换,尽管这样可能为攻击者定位节点对象提供方便,但是假如每个空指针的转换结果为相同时,那么还是可能为攻击者的分析提供了很好的线索,并且可能同时将其他地址的转换的方法也暴露了出来。当然,这是和具体使用的转换方法有关的。在采用一种转换方法时,选择对空指针进行转换得到的最终安全性更高时,自然会选择进行转换而不是加以忽略的方法。只要能够切断内存块和与之对应的引用节点之间的显式的关联,那么要根据其中一方找到另一方就变得不那么容易了。
与地址参数的转换类似,对引用节点中的内存块长度,以及内存块在文件中的位置信息进行转换处理,也可以增加具体实现的安全性。和地址转换相同的是,这里采用的转换方法,还是可以在不同的程序实现中根据实际需要加以选择。
另外,在图中,还显示了对下一节点地址指针和前一节点地址指针的不同处理。假如采用相同的转换方式,那么在内存中将出现有很强相关性的地址片段,而分析程序将可以发现这种明显的特征,并进而定位到这些地址。这样敏感信息将遭遇到暴露的危险。
由于采用了针对地址参数和内存块长度、位置等信息的转换处理,在实现对链表或者二叉树等结构的遍历和定位处理时,还需要首先对这些参数进行逆向处理,得到原始参数,这样才能够获取到指针指向的内存地址以及内存块的长度和对应的文件位置。
由于采用了上面描述的这些对文件存储的处理方式,使得实际的应用程序在读写文件内容时,不再能够只通过标准的库函数进行,而必须使用经过包装的定制接口。不论采用哪种形式的引用节点组织方式,比如链表和二叉树等,只要保持定制接口不变,应用程序在访问碎片化的文件内容时,是感受不到这种变化的。对于应用程序来说,除了必须使用指定的读写访问接口之外,甚至无需了解这些文件内容是已经以碎片化的形式来保存,还是像通常那样以一个连续的内存块来存放。
一种接口的定义样例为:
1、应用打开一个含有敏感信息的文件时,以指定的文件长度要求创建一个碎片化的存储区域:输入参数为文件长度,或者没有输入,这表明以缺省或者0长度来创建这样的文件。而返回对象为指向该存储区域的头节点的指针。
对于应用来说,还是使用标准的打开文件操作,但是在内部的库实现中,可能已经引用了这里所说的函数接口。内部库实现可能会先去解密文件,然后以解密后的文件长度作为参数来调用创建碎片化区域的函数。
2、应用以指定的长度扩展一个已经创建的碎片化存储区域:输入参数为 指向已经创建的存储区域的头节点的指针和需要扩展的文件长度。返回对象为指向该存储区域的头节点的指针。
3、当关闭一个加密文件时,应用释放一个碎片化的存储区域:输入参数为已经创建的存储区域的头节点指针,返回参数为执行成功与否的标志。
4、应用请求读碎片化存储区域中的一个指定部分或者是全部内容:输入参数自然首先是已经创建的存储区域的头节点指针,以及需要开始读取的偏移量和所需读取的数据长度以及输出缓冲区等,而输出参数为实际读取的字节数。
5、应用请求写碎片化存储区域中的一个指定部分:和读请求有着类似的输入和输出参数,包括存储区域的指针以及开始写操作针对的文件位置的偏移量和所需写的数据长度和所需写入的数据所在缓冲区。而接口返回为实际完成写入的数据的字节数。对于读请求和写请求还可以再定义一个或多个专用接口,包括专门读一个字符和专门写一个字符等,以方便应用的使用。
6、有时,外部应用需要获取文件中指定位置的地址,这时就需要设计专用的接口,以返回该指针。只是外部应用在得到该指针后,不能以连续的方式来访问内存。
如果在提供了上述接口包装函数后,应用还不能够方便地开发,或者说应用只能以标准的文件库接口形式来执行对内存文件的读写,那么就需要在上述接口基础上再进行一层包装,以标准的文件对象形式对外提供访问接口,而在文件对象内部处理时,再使用上述定制的接口。这样对于应用开发来说,几乎不再有额外的适配负担了。
由于提供了专门的接口用以访问碎片化的文件存储区域,因此这种接口实际上已经隔离了应用中所访问的原始数据和保存到内存中的数据。换句话说,即使在已经碎片化的内存块中,也未必一定要保存文件的原始内容。在前面已经提到过,如果以原始形式来保存文件内容的话,即使是在碎片化之后,攻击者还是可以直接搜索并定位到第一个文件块,除非第一个文件块足够小,不足以容纳攻击者所需要匹配的特征字节的长度。只不过,前面描述的方案已经给出了很多设计,来保证即使攻击者得到了一个小的文件片段,但是还不足以继续获取其他的敏感信息。但是,只要在这个专门的接口上做 的处理,那么甚至可以阻止攻击者获取到带有特性信息的文件块。这一步的处理是可选,只不过增加这样的处理后的确可以强化所能获得的安全性。
这种在专门接口上的安全转换处理可以理解为对已经碎片化保存的文件内容的再次加密和解密。不过,在很多对称和非对称加密处理中,需要将固定长度的内存块作为加解密处理模块的输入,比如8个字节、16个字节甚至128个字节等。这样,对于应用模块来说,对文件的随机读写的灵活度将大打折扣,或者使得专门接口上的安全转换处理过程变得复杂而低效。因此,此时选择基于单字节的转换方法,对于文件读写的效率来说,将是比较合适的。而碎片化的处理过程,已经为整体的安全性提供了必要的保证,使得这种可选的处理过程不需要过高的复杂度就能满足需求。
图7为本发明实施例的一种保护敏感信息的装置的示意图,如图所示,本实施例的装置包括:
申请模块,设置为申请多个长度随机确定的内存块,每一内存块均采用动态分配的方式获取,并以不连续的数据结构来关联所述内存块,利用所述数据结构中的多个节点分别保存所述内存块的引用信息;以及
保存模块,设置为将已解密的包含敏感信息的文件划分为相应大小的多个文件块,分别保存在所述多个内存块中。
其中,所述申请模块,还设置为将申请的用于保存文件特征信息的内存块的随机长度设定为小于所述文件特征信息的长度。
在一可选实施例中,所述装置还可以包括:
编排模块,设置为对所述申请模块申请的多个内存块以随机的顺序重新编排,然后触发所述保存模块保存所述文件块。
所述内存块的引用信息包括:指向内存块的地址指针、内存块长度和内存块所保存的文件块在所述文件中的位置信息;
所述数据结构中的节点还保存有指向上节点和/或下节点的地址指针。
在一可选实施例中,所述装置还可以包括:
第一处理模块,设置为对所述数据结构节点中保存的一项或多项信息进行转换处理,不同项采用的转换方式相同或不同。
在一可选实施例中,所述装置还可以包括:
第二处理模块,设置为在将所述数据结构提供给其他程序模块使用时,先进行安全处理。
在一可选实施例中,所述装置还可以包括:
第三处理模块,设置为在所述保存模块将所述文件划分为相应大小的多个文件块之前,或者将划分的多个文件块分别保存在所述多个内存块之前,将所述文件的数据或文件块的数据处理为不可直接使用的内容。
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序来指令相光硬件完成,上述程序可以存储于计算机可读存储介质中,如只读存储器、磁盘或光盘等。可选地,上述实施例的全部或部分步骤也可以使用一个或多个集成电路来实现。相应地,上述实施例中的各模块/单元可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。本发明不限制于任何特定形式的硬件和软件的结合。
工业实用性
通过本发明可以增加攻击者获取原始文件内容的复杂度,即攻击者不能轻易地获取到完整的原始文件内容。

Claims (15)

  1. 一种保护敏感信息的方法,包括:
    申请多个长度随机确定的内存块,每一内存块均采用动态分配的方式获取,并以不连续的数据结构来关联所述内存块,利用所述数据结构中的多个节点分别保存所述内存块的引用信息;
    将已解密的包含敏感信息的文件划分为相应大小的多个文件块,分别保存在所述多个内存块中。
  2. 如权利要求1所述的方法,其中:所述申请多个长度随机确定的内存块,包括:
    将申请的用于保存文件特性信息的内存块的随机长度设定为小于所述文件特征信息的长度。
  3. 如权利要求1所述的方法,所述申请多个长度随机确定的内存块后,所述方法还包括:
    将所述多个内存块以随机的顺序重新编排,然后再保存所述文件块。
  4. 如权利要求1所述的方法,其中:
    所述内存块的引用信息包括:指向内存块的地址指针、内存块长度和内存块所保存的文件块在所述文件中的位置信息;
    所述数据结构中的节点还保存有指向上节点和/或下节点的地址指针。
  5. 如权利要求1所述的方法,所述方法还包括:
    对所述数据结构节点中保存的一项或多项信息进行转换处理,不同项采用的转换方式相同或不同。
  6. 如权利要求1所述的方法,所述方法还包括:
    在将所述数据结构提供给其他程序模块使用时,先进行安全处理。
  7. 如权利要求1-6任一项所述的方法,
    将所述文件划分为相应大小的多个文件块之前,或者将划分的多个文件块分别保存在所述多个内存块之前,所述方法还包括:将所述文件的数据或文件块的数据处理为不可直接使用的内容。
  8. 一种保护敏感信息的装置,包括:
    申请模块,设置为申请多个长度随机确定的内存块,每一内存块均采用动态分配的方式获取,并以不连续的数据结构来关联所述内存块,利用所述数据结构中的多个节点分别保存所述内存块的引用信息;以及
    保存模块,设置为将已解密的包含敏感信息的文件划分为相应大小的多个文件块,分别保存在所述多个内存块中。
  9. 如权利要求8所述的装置,
    所述申请模块,还设置为将申请的用于保存文件特征信息的内存块的随机长度设定为小于所述文件特征信息的长度。
  10. 如权利要求8所述的装置,所述装置还包括,
    编排模块,设置为对所述申请模块申请的多个内存块以随机的顺序重新编排,然后触发所述保存模块保存所述文件块。
  11. 如权利要求8所述的装置,其中:
    所述申请模块申请的内存块的引用信息包括:指向内存块的地址指针、内存块长度和内存块所保存的文件块在所述文件中的位置信息;
    所述数据结构中的节点还保存有指向上节点和/或下节点的地址指针。
  12. 如权利要求8所述的装置,所述装置还包括,
    第一处理模块,设置为对所述数据结构节点中保存的一项或多项信息进行转换处理,不同项采用的转换方式相同或不同。
  13. 如权利要求8所述的装置,所述装置还包括,
    第二处理模块,设置为在将所述数据结构提供给其他程序模块使用时,先进行安全处理。
  14. 如权利要求8-13任一项所述的装置,所述装置还包括:
    第三处理模块,设置为在所述保存模块将所述文件划分为相应大小的多个文件块之前,或者将划分的多个文件块分别保存在所述多个内存块之前,将所述文件的数据或文件块的数据处理为不可直接使用的内容。
  15. 一种计算机可读存储介质,存储有程序指令,当该程序指令被执行时可实现权利要求1-7任一项所述的方法。
PCT/CN2015/078038 2014-09-11 2015-04-30 一种保护敏感信息的方法及装置 WO2016037488A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410461447.9A CN105468543B (zh) 2014-09-11 2014-09-11 一种保护敏感信息的方法及装置
CN201410461447.9 2014-09-11

Publications (1)

Publication Number Publication Date
WO2016037488A1 true WO2016037488A1 (zh) 2016-03-17

Family

ID=55458323

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/078038 WO2016037488A1 (zh) 2014-09-11 2015-04-30 一种保护敏感信息的方法及装置

Country Status (2)

Country Link
CN (1) CN105468543B (zh)
WO (1) WO2016037488A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112580092A (zh) * 2020-12-07 2021-03-30 北京明朝万达科技股份有限公司 一种敏感文件识别方法及装置
US11520681B2 (en) * 2018-01-23 2022-12-06 Amlogic (Shanghai) Co., Ltd. System log collection method
CN115859384A (zh) * 2022-10-12 2023-03-28 北京连山科技股份有限公司 一种网络安全设备内存敏感数据残余信息的安全保护方法

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106168883A (zh) * 2016-05-05 2016-11-30 诸葛晴凤 一种高效的数据组织与访问方法
CN106815301B (zh) * 2016-12-12 2020-10-30 北京奇虎科技有限公司 一种dex文件的存储方法和装置
CN106934280A (zh) * 2017-03-08 2017-07-07 网易(杭州)网络有限公司 内存数据处理方法、装置及网络游戏客户端
CN108900474A (zh) * 2018-06-05 2018-11-27 苏州科达科技股份有限公司 敏感信息的传输方法,装置及电子设备
CN109920044A (zh) * 2019-02-27 2019-06-21 浙江科澜信息技术有限公司 一种三维场景构建方法、装置、设备及介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5479656A (en) * 1992-05-13 1995-12-26 Rawlings, Iii; Joseph H. Method and system for maximizing data files stored in a random access memory of a computer file system and optimization therefor
CN103067157A (zh) * 2011-10-18 2013-04-24 美国博通公司 利用随机排序和随机块大小的安全数据传输
CN103118135A (zh) * 2013-02-28 2013-05-22 中国地质大学(武汉) 云计算中用户数据隐私的保护方法及系统
CN103607393A (zh) * 2013-11-21 2014-02-26 浪潮电子信息产业股份有限公司 一种基于数据分割的数据安全保护方法

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2003238876A1 (en) * 2002-06-04 2003-12-19 Georgia Tech Research Corporation System, method and computer program product for leakage-proof program partitioning
US7437530B1 (en) * 2003-04-24 2008-10-14 Network Appliance, Inc. System and method for mapping file block numbers to logical block addresses
CN100511158C (zh) * 2007-08-28 2009-07-08 中兴通讯股份有限公司 一种内存监控管理的方法及系统
DE102010010851A1 (de) * 2010-03-10 2011-09-15 Giesecke & Devrient Gmbh Ausspähungsschutz bei der Ausführung einer Operationssequenz in einem tragbaren Datenträger
US9158468B2 (en) * 2013-01-02 2015-10-13 International Business Machines Corporation High read block clustering at deduplication layer

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5479656A (en) * 1992-05-13 1995-12-26 Rawlings, Iii; Joseph H. Method and system for maximizing data files stored in a random access memory of a computer file system and optimization therefor
CN103067157A (zh) * 2011-10-18 2013-04-24 美国博通公司 利用随机排序和随机块大小的安全数据传输
CN103118135A (zh) * 2013-02-28 2013-05-22 中国地质大学(武汉) 云计算中用户数据隐私的保护方法及系统
CN103607393A (zh) * 2013-11-21 2014-02-26 浪潮电子信息产业股份有限公司 一种基于数据分割的数据安全保护方法

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11520681B2 (en) * 2018-01-23 2022-12-06 Amlogic (Shanghai) Co., Ltd. System log collection method
CN112580092A (zh) * 2020-12-07 2021-03-30 北京明朝万达科技股份有限公司 一种敏感文件识别方法及装置
CN115859384A (zh) * 2022-10-12 2023-03-28 北京连山科技股份有限公司 一种网络安全设备内存敏感数据残余信息的安全保护方法
CN115859384B (zh) * 2022-10-12 2023-11-10 北京连山科技股份有限公司 一种网络安全设备内存敏感数据残余信息的安全保护方法

Also Published As

Publication number Publication date
CN105468543A (zh) 2016-04-06
CN105468543B (zh) 2020-06-16

Similar Documents

Publication Publication Date Title
WO2016037488A1 (zh) 一种保护敏感信息的方法及装置
Priebe et al. SGX-LKL: Securing the host OS interface for trusted execution
US11809584B2 (en) File system metadata protection
US9811479B2 (en) Cryptographic pointer address encoding
CN109564553B (zh) 多阶段存储器完整性方法和装置
US10509905B2 (en) Ransomware mitigation system
US8423592B2 (en) Method and system for accessing a storage system with multiple file systems
US9152813B2 (en) Transparent real-time access to encrypted non-relational data
US20120260106A1 (en) System and method for binary layout randomization
JP6109441B1 (ja) ラウンド削減型暗号を採用するxts暗号化システムとともに使用するための動的暗号化鍵
US20180260151A1 (en) Data Storage Device and Operating Method Therefor
US7325115B2 (en) Encryption of system paging file
CN115758420B (zh) 文件访问控制方法、装置、设备及介质
US10546138B1 (en) Distributed data security
CN114611123B (zh) 一种文件透明加解密方法和系统
US20130297881A1 (en) Performing zero-copy sends in a networked file system with cryptographic signing
CN111143879A (zh) 一种Android平台SD卡文件保护方法、终端设备及存储介质
TWI791995B (zh) 軟體保護方法及其系統
US20160357470A1 (en) Computer readable medium, information processing apparatus, and method
JP7348701B2 (ja) メモリ上に実行可能イメージをロードする方法およびシステム
CN113360859B (zh) 基于Python解释器的加密文件安全控制方法和装置
Demir et al. Improving dm-crypt performance for XTS-AES mode through extended requests: first results
CN117290867A (zh) 用户敏感信息的安全隔离存储文件系统的设计方法
CN116451250A (zh) 应用程序内存文件的隔离处理方法、装置及计算设备
CN116346316A (zh) 密态计算中进程创建期间的进程对象密钥更新

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: 15840135

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: 15840135

Country of ref document: EP

Kind code of ref document: A1