[go: up one dir, main page]

CN118013547A - Memory encryption and decryption method, system and related equipment based on user layer - Google Patents

Memory encryption and decryption method, system and related equipment based on user layer Download PDF

Info

Publication number
CN118013547A
CN118013547A CN202410165916.6A CN202410165916A CN118013547A CN 118013547 A CN118013547 A CN 118013547A CN 202410165916 A CN202410165916 A CN 202410165916A CN 118013547 A CN118013547 A CN 118013547A
Authority
CN
China
Prior art keywords
file
encryption
decryption
memory
program
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.)
Pending
Application number
CN202410165916.6A
Other languages
Chinese (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.)
Third Research Institute of the Ministry of Public Security
Original Assignee
Third Research Institute of the Ministry of Public Security
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 Third Research Institute of the Ministry of Public Security filed Critical Third Research Institute of the Ministry of Public Security
Priority to CN202410165916.6A priority Critical patent/CN118013547A/en
Priority to PCT/CN2024/089282 priority patent/WO2025166911A1/en
Publication of CN118013547A publication Critical patent/CN118013547A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/604Tools and structures for managing or administering access control systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0819Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s)

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Storage Device Security (AREA)

Abstract

The invention discloses a memory encryption and decryption method, a memory encryption and decryption system and related equipment based on a user layer, and under the condition that minifilter is not used, the scheme is innovative in that an original file image in an encryption state is mapped to a designated directory in the user layer, decryption is synchronously carried out in the image mapping process, and all decryption data are stored in a program memory in a user state; on the basis, the access process of the current decrypted file is synchronously monitored, and the untrusted process or the released trusted process is intercepted. The scheme of the invention realizes that all encryption, decryption and data storage operations are completed in a user layer, and all decrypted data are stored in a program memory in a user state, so that the system efficiency can be greatly improved under the scene of needing to access big data.

Description

一种基于用户层的内存加解密方法、系统及相关设备A user-layer-based memory encryption and decryption method, system, and related equipment

技术领域Technical Field

本发明涉及数据安全技术,具体涉及数据加密技术。The present invention relates to data security technology, and in particular to data encryption technology.

背景技术Background technique

加密技术是利用技术手段将数据变成加密数据(乱码)后进行传输,等到达目的地后再进行解密,加密技术目前有着广泛的应用,尤其在经济领域,电商等被广泛使用。加密技术中最重要的即是,加密算法,不同的加密算法安全等级,加密效果均不一样。常见的加密算法分为对称加密和非对称加密。Encryption technology uses technical means to convert data into encrypted data (garbled code) before transmission, and then decrypt it after reaching the destination. Encryption technology is currently widely used, especially in the economic field, e-commerce, etc. The most important thing in encryption technology is the encryption algorithm. Different encryption algorithms have different security levels and encryption effects. Common encryption algorithms are divided into symmetric encryption and asymmetric encryption.

对称加密采用了对称密码编码技术,特点是加密和解密使用相同的密钥,即加密密钥也可以用于解密,这种加密算法使用简单,密钥较短,一个常见对称密钥加密系统是国际数据加密算法(IDEA)。Symmetric encryption uses symmetric cryptographic coding technology, which is characterized by using the same key for encryption and decryption, that is, the encryption key can also be used for decryption. This encryption algorithm is simple to use and has a short key. A common symmetric key encryption system is the International Data Encryption Algorithm (IDEA).

非对称加密算法是为了解决信息公开和密钥管理问题,在对称加密中,加密密钥可能会被共享到其他地方,拿到加密密钥后数据即可被解密,有一定的安全风险。非对称加密算法将加密密钥和解密密钥分离,变为公开密钥和私有密钥,公开密钥对数据进行加密后再用私有密钥进行解密,二者互为对称和互补,用私玥加密的数据必须用公玥解密,同理用公玥加密的数据必须用私玥解密。Asymmetric encryption algorithms are designed to solve the problems of information disclosure and key management. In symmetric encryption, the encryption key may be shared with other places. After obtaining the encryption key, the data can be decrypted, which poses certain security risks. Asymmetric encryption algorithms separate the encryption key and the decryption key into public key and private key. The public key encrypts the data and then decrypts it with the private key. The two are symmetrical and complementary. Data encrypted with the private key must be decrypted with the public key, and similarly, data encrypted with the public key must be decrypted with the private key.

传统意义上的加密一般是将数据加密后保存到硬盘中,用户需要查看时,则需要对数据进行解密查看,数据一经解密即为明文后续可无限使用,即始终处于明文状态。作为举例,如此操作与加密压缩包查看操作类似,压缩包加密后用户无法查看和打开,但是压缩包一经解密数据即为明文形式落盘,后续用户无需进行二次解密即可使用。Traditional encryption generally means encrypting data and saving it to the hard disk. When users need to view it, they need to decrypt it. Once the data is decrypted, it is in plain text and can be used unlimitedly, that is, it is always in plain text. For example, this operation is similar to viewing an encrypted compressed package. After the compressed package is encrypted, users cannot view or open it, but once the compressed package is decrypted, the data is in plain text and can be used by subsequent users without secondary decryption.

在实际应用过程中,一些数据在非查看状态下需要一直保持加密状态,即相应的数据需要特定程序解密,且程序解密查看完毕后数据应自动变为加密模式,防止其他程序恶意读取和转移。作为举例,在实际业务中的一些敏感数据,用户有对这类敏感数据进行增删查改的需求,同时还需要随时保证数据的安全性,为此就需要限制用户仅可使用特定程序进行解密编辑,且其他程序则无法访问解密数据。为此,任何人们构建一种通用程序对加密程序进行解密,且解密后数据自动还原成加密模式,传统的解密方式一般是通过密钥或者密码,将文件解密并保存到硬盘中,文件一旦解密即可无限次查看,带来一定的安全奉献,因此传统的解密方式种类单一,解密后数据也可能存在问题。In actual application, some data needs to remain encrypted when not being viewed, that is, the corresponding data needs to be decrypted by a specific program, and the data should automatically change to encrypted mode after the program is decrypted and viewed to prevent malicious reading and transfer by other programs. For example, in some sensitive data in actual business, users have the need to add, delete, check and modify such sensitive data, and at the same time, they need to ensure the security of the data at all times. For this reason, it is necessary to restrict users to only use specific programs for decryption and editing, and other programs cannot access the decrypted data. For this reason, anyone builds a general program to decrypt the encryption program, and the decrypted data is automatically restored to the encrypted mode. The traditional decryption method is generally to decrypt the file through a key or password and save it to the hard disk. Once the file is decrypted, it can be viewed unlimited times, which brings certain security sacrifices. Therefore, the traditional decryption method is single, and the decrypted data may also have problems.

目前对应用程序自动加解密的技术方案,都是基于minifilter实现文件相关的保护加密。The current technical solutions for automatic encryption and decryption of applications are all based on minifilter to implement file-related protection encryption.

minifilter为windows官方推出的内核驱动过滤程序,提供了windows操作系统的钩子回调操作,用户可自行实现对系统操作的拦截放行等。minifilter中分为用户层和内核层,用户层配置权限文件等,传入到内核层,再由内核层根据配置信息对文件进行操作,如拦截或者放行,配置文件可以根据文件名,扩展名,请求进程名,请求方式等进行一定的操作,同时如果检测到文件加密会自动解密,判断文件加密或者解密的方案一般是通过判断文件头标识,在用户写入文件信息后将写入信息加密并追加到内核缓冲区,从而实现文件的实时加密保存。Minifilter is a kernel-driven filter program officially launched by Windows. It provides hook callback operations for the Windows operating system. Users can intercept and release system operations by themselves. Minifilter is divided into user layer and kernel layer. The user layer configures permission files, etc., which are passed to the kernel layer. The kernel layer then operates the file according to the configuration information, such as interception or release. The configuration file can perform certain operations based on the file name, extension name, request process name, request method, etc. At the same time, if file encryption is detected, it will be automatically decrypted. The scheme for judging file encryption or decryption is generally to judge the file header identifier. After the user writes the file information, the written information will be encrypted and appended to the kernel buffer, thereby realizing real-time encrypted storage of the file.

然而现有基于minifilter的加密保护方案在实际应用时,需要事先注册windows内核驱动,然后进行用户层和内核层的通信,由于需要配置文件加密解密逻辑,需要将配置文件传入内核层,且文件的解密依赖内核层的解密方法,当待解密缓存过大,内核层占用资源会急剧增加,导致系统卡顿;而本方案的用户配置文件在用户层定义,可以进行灵活变换,采用xml和json均可实现相似功能而不需要考虑用户层和内核层的数据传递问题。However, in actual application, the existing minifilter-based encryption protection scheme needs to register the Windows kernel driver in advance and then communicate between the user layer and the kernel layer. Since the configuration file encryption and decryption logic needs to be configured, the configuration file needs to be passed to the kernel layer, and the decryption of the file depends on the decryption method of the kernel layer. When the cache to be decrypted is too large, the resources occupied by the kernel layer will increase sharply, causing the system to freeze. The user configuration file of this scheme is defined at the user layer and can be flexibly transformed. Both xml and json can be used to achieve similar functions without considering the data transmission problem between the user layer and the kernel layer.

再者,现有基于minifilter的加密保护方案在实际应用时,必须依赖minifiler的程序必须要添加windows驱动签名方可使用,如果不带有windows官方授权签名,程序会无法在正式版windows上运行或者会警告,这样将大大增加现有方案的应用成本。Furthermore, when the existing minifilter-based encryption protection scheme is actually applied, the program that must rely on the minifiler must add the Windows driver signature before it can be used. If it does not have the official Windows authorized signature, the program will not be able to run on the official version of Windows or will warn, which will greatly increase the application cost of the existing scheme.

发明内容Summary of the invention

针对现有基于minifilter来实现文件相关保护加密方案所存在的问题,本发明的目的在于提供一种基于用户层的内存加解密方案,能够在不使用minifilter的情况下,在用户层实现文件的加密保护,从而可有效克服现有技术所存在的问题。In view of the problems existing in the existing file-related protection encryption scheme based on minifilter, the purpose of the present invention is to provide a user-layer based memory encryption and decryption scheme, which can implement file encryption protection at the user layer without using minifilter, thereby effectively overcoming the problems existing in the prior art.

为了达到上述目的,本发明提供了一种基于用户层的内存加解密方法,在用户层将任意原始目录镜像映射到任意指定空目录,并在镜像映射过程中同步对原始文件目录下所有制定文件进行解密,且监控当前解密文件的访问进程,拦截不信任进程或者放行信任进程。In order to achieve the above-mentioned purpose, the present invention provides a memory encryption and decryption method based on the user layer, which maps any original directory image to any specified empty directory at the user layer, and synchronously decrypts all specified files under the original file directory during the image mapping process, monitors the access process of the current decrypted file, intercepts untrusted processes or releases trusted processes.

本发明的一些实施方式中,所述内存加解密方法在用户层基于dokany来对加密状态的任意原始文件mount映射到其他任意指定空目录,同时进行解密,并且监控当前解密文件的访问进程。In some implementations of the present invention, the memory encryption and decryption method mounts and maps any original file in an encrypted state to any other specified empty directory based on dokany at the user layer, decrypts it at the same time, and monitors the access process of the current decrypted file.

在本发明的一些实施方式中,所述内存加解密方法在mount映射过程中提供文件的操作钩子接口,并基于操作钩子接口进行文件的io操作拦截,授权放行和加解密的操作。In some embodiments of the present invention, the memory encryption and decryption method provides a file operation hook interface during the mount mapping process, and performs file io operation interception, authorization release, and encryption and decryption operations based on the operation hook interface.

在本发明的一些实施方式中,所述内存加解密方法中基于操作钩子接口进行文件的内存解密时,文件通过加密程序预先进行加密;同时通过读取配置文件中的加密方案进行解密,当文件打开触发钩子回调时,读取配置文件的加密算法,利用程序内置的密钥或者加密空间读取密钥对文件内容进行解密。In some embodiments of the present invention, when the memory decryption of a file is performed based on the operation hook interface in the memory encryption and decryption method, the file is encrypted in advance by an encryption program; at the same time, decryption is performed by reading the encryption scheme in the configuration file. When the file is opened and the hook callback is triggered, the encryption algorithm of the configuration file is read, and the file content is decrypted using the program's built-in key or the encryption space reading key.

在本发明的一些实施方式中,所述内存加解密方法中基于操作钩子接口进行权限拦截与授权放行时,授予权限通过用户层配置;当打开文件时,则主动触发dokany的文件io读取回调接口,文件io读取回调接口通过判断由用户层传过来的配置信息进行判断,是否对当前操作拦截或放行,当权限认证通过后会进入到解密逻辑中实现文件的内存解密,并返回给用户层打开,当授权不通过时会直接拦截该io操作,且文件保持加密状态。In some embodiments of the present invention, when the memory encryption and decryption method performs permission interception and authorization release based on the operation hook interface, the permission is granted through the user layer configuration; when the file is opened, the file io read callback interface of dokany is actively triggered, and the file io read callback interface determines whether to intercept or release the current operation by judging the configuration information passed by the user layer. When the permission authentication is passed, it will enter the decryption logic to implement the memory decryption of the file and return it to the user layer for opening. When the authorization is not passed, the io operation will be directly intercepted, and the file will remain encrypted.

在本发明的一些实施方式中,所述内存加解密方法中对解密文件的访问权限策略由用户层读取配置策略文件生成,然后写入到用户层程序后进行文件的权限管理。In some implementations of the present invention, the access permission policy for the decrypted file in the memory encryption and decryption method is generated by the user layer reading the configuration policy file, and then written into the user layer program to perform file permission management.

为了达到上述目的,本发明还提供了一种基于dokany的内存加解密系统,包括处理器、存储器及存储在存储器上并可在处理器上运行的程序,所述程序由所述处理器加载并执行上述的内存加解密方法的步骤。In order to achieve the above-mentioned purpose, the present invention also provides a memory encryption and decryption system based on dokany, including a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program is loaded by the processor and executes the steps of the above-mentioned memory encryption and decryption method.

为了达到上述目的,本发明提供了一种计算机可读存储介质,其上存储有程序,该程序被处理器执行时实现上述基于dokany的内存加解密方法的实现步骤。In order to achieve the above-mentioned object, the present invention provides a computer-readable storage medium on which a program is stored, and when the program is executed by a processor, the implementation steps of the above-mentioned dokany-based memory encryption and decryption method are implemented.

为了达到上述目的,本发明提供了一种处理器,所述处理器用于运行程序,所述程序运行时执行上述基于dokany的内存加解密方法的实现步骤。In order to achieve the above object, the present invention provides a processor, which is used to run a program, and when the program is running, the implementation steps of the above-mentioned dokany-based memory encryption and decryption method are executed.

为了达到上述目的,本发明提供了一种终端设备,设备包括处理器、存储器及存储在存储器上并可在处理器上运行的程序,所述程序代码由所述处理器加载并执行以实现上述基于dokany的内存加解密方法的实现步骤。In order to achieve the above-mentioned purpose, the present invention provides a terminal device, which includes a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program code is loaded and executed by the processor to implement the implementation steps of the above-mentioned dokany-based memory encryption and decryption method.

为了达到上述目的,本发明提供了一种计算机程序产品,当在数据处理设备上执行时,适于执行上述基于dokany的内存加解密方法的实现步骤。In order to achieve the above-mentioned object, the present invention provides a computer program product, which, when executed on a data processing device, is suitable for executing the implementation steps of the above-mentioned dokany-based memory encryption and decryption method.

本发明提供的基于dokany的内存加解密方案,实现将所有加密解密和数据保存操作均在用户层完成,所有的解密数据保存于用户态的程序内存中,这样能够在需要访问大数据的场景下可以极大提升系统效率;从而能够有效克服因为数据文件大小取决的内存,造成传统minifilter方案无法支持大数据的读取分析,由于内核级的内存较小,无法提供大量数据的解密方案的问题。The dokany-based memory encryption and decryption solution provided by the present invention realizes that all encryption, decryption and data storage operations are completed at the user level, and all decrypted data is stored in the program memory of the user state, which can greatly improve the system efficiency in the scenario where big data needs to be accessed; thereby effectively overcoming the problem that the traditional minifilter solution cannot support the reading and analysis of big data because the size of the data file depends on the memory, and cannot provide a decryption solution for a large amount of data due to the small kernel-level memory.

再者,相对于现有基于minifilter的加密保护方案,本发明方案中用户配置文件在用户层定义,可以进行灵活变换,采用xml和json均可实现相应功能而不需要考虑用户层和内核层的数据传递问题。Furthermore, compared with the existing minifilter-based encryption protection scheme, the user configuration file in the scheme of the present invention is defined at the user layer and can be flexibly transformed. Both XML and JSON can be used to implement corresponding functions without considering data transmission issues between the user layer and the kernel layer.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

以下结合附图和具体实施方式来进一步说明本发明。The present invention is further described below in conjunction with the accompanying drawings and specific embodiments.

图1为本发明实例中基于dokany进行内存加解密的示例图。FIG1 is an example diagram of memory encryption and decryption based on dokany in an example of the present invention.

具体实施方式Detailed ways

为了使本发明实现的技术手段、创作特征、达成目的与功效易于明白了解,下面结合具体图示,进一步阐述本发明。In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, the present invention is further explained below with reference to specific diagrams.

名称解释:Name explanation:

Intel的x86处理器是通过Ring级别来进行访问控制的,级别共分4层,从Ring0到Ring3(后面简称R0、R1、R2、R3)。R0层拥有最高的权限,R3层拥有最低的权限。按照Intel原有的构想,应用程序工作在R3层,只能访问R3层的数据;操作系统工作在R0层,可以访问所有层的数据;而其他驱动程序位于R1、R2层,每一层只能访问本层以及权限更低层的数据Intel's x86 processor uses Ring level to control access, which is divided into 4 levels, from Ring0 to Ring3 (hereinafter referred to as R0, R1, R2, R3). The R0 layer has the highest permissions, and the R3 layer has the lowest permissions. According to Intel's original concept, the application works in the R3 layer and can only access data in the R3 layer; the operating system works in the R0 layer and can access data in all layers; and other driver programs are located in the R1 and R2 layers, and each layer can only access data in the current layer and the layers with lower permissions.

用户层:普通应用的运行环境为用户层,可访问有限的资源和接口,为了安全性,用户层不可访问驱动,系统内核等资源。User layer: The operating environment of ordinary applications is the user layer, which can access limited resources and interfaces. For security reasons, the user layer cannot access resources such as drivers and system kernels.

内核层:操作系统工作在R0层,可以访问所有层的数据;而其他驱动程序位于R1、R2层,每一层只能访问本层以及权限更低层的数据。Kernel layer: The operating system works at the R0 layer and can access data in all layers; other drivers are located at the R1 and R2 layers, and each layer can only access data at its own layer and lower layers.

本发明方案在不使用minifilter的情况下,创新的在用户层将加密状态的任意原始目录下的文件镜像映射到任意指定空目录,并在镜像映射过程中同步对原始文件目录下所有制定文件进行解密,将所有的解密数据保存于用户态的程序内存中;在此基础上同步监控当前解密文件的访问进程,拦截不信任进程或者放行信任进程。这里的原始文件目录和指定目录均可由用户自行指定,可以是目录,也可以是整个盘符。The solution of the present invention innovatively maps the file image of any original directory in the encrypted state to any specified empty directory at the user level without using minifilter, and synchronously decrypts all the specified files in the original file directory during the image mapping process, and saves all the decrypted data in the program memory of the user state; on this basis, synchronously monitors the access process of the current decrypted file, intercepts untrusted processes or releases trusted processes. The original file directory and the specified directory here can be specified by the user, which can be a directory or an entire drive letter.

具体的,本发明方案基于dokany来实现在不使用minifilter的情况下,在用户层实现文件的加密保护。本发明方案在用户层基于dokany来对加密状态的任意目录的原始文件,Mount映射到其他任意指定空目录,同时进行解密,并且监控当前解密文件的访问进程,截不信任进程或者放行信任进程。Specifically, the solution of the present invention is based on dokany to implement encryption protection of files at the user level without using minifilter. The solution of the present invention uses dokany at the user level to mount the original files of any directory in the encrypted state to any other specified empty directory, decrypt them at the same time, and monitor the access process of the current decrypted file, intercept untrusted processes or release trusted processes.

在本发明的一些实施方式中,本发明方案在mount过程中提供文件的操作钩子接口,该文件的操作钩子接口能够用于和用户层进行数据交互,从而实现进程监控,文件加解密等核心功能。In some embodiments of the present invention, the scheme of the present invention provides an operation hook interface for the file during the mount process, and the operation hook interface for the file can be used to interact with the user layer for data, thereby realizing core functions such as process monitoring and file encryption and decryption.

据此,本方案基于该文件的操作钩子接口来实现文件的io操作拦截,授权放行和加解密的操作。Accordingly, this solution implements the file's IO operation interception, authorization release, and encryption and decryption operations based on the file's operation hook interface.

在本发明的一些实施方式中,本发明方案中基于该文件的操作钩子接口来进行文件的内存解密时,文件通过加密程序预先进行加密,这里的加密方案和加密密钥均独立设置,加密方案和加密密钥均不依赖本发明方案涉及到的程序;与此同时,本发明方案通过读取配置文件中的加密方案进行解密,当文件打开触发钩子回调时,程序读取配置文件的加密算法,利用程序内置的密钥或者加密空间读取密钥来对文件内容进行解密。由于文件内容一般均为字符串,其可适配目前常见的加密算法,包括对称和非对称加密,但是必须是可逆加密。In some embodiments of the present invention, when the memory decryption of the file is performed based on the operation hook interface of the file in the scheme of the present invention, the file is encrypted in advance by an encryption program, and the encryption scheme and encryption key here are independently set, and the encryption scheme and encryption key do not rely on the program involved in the scheme of the present invention; at the same time, the scheme of the present invention decrypts by reading the encryption scheme in the configuration file, and when the file is opened to trigger the hook callback, the program reads the encryption algorithm of the configuration file, and uses the program's built-in key or the encryption space to read the key to decrypt the file content. Since the file content is generally a string, it can be adapted to the currently common encryption algorithms, including symmetric and asymmetric encryption, but it must be reversible encryption.

在本发明的一些实施方式中,本发明方案中基于操作钩子接口进行权限拦截与授权放行时,授予权限通过用户层配置,具体包含进程可访问的黑白名单,可访问类型;In some embodiments of the present invention, when the permission interception and authorization release are performed based on the operation hook interface in the solution of the present invention, the permission is granted through the user layer configuration, specifically including the black and white lists accessible by the process and the accessible type;

在从基础上,当用户打开文件时,则会主动触发dokany的文件io读取回调接口,同时该文件io读取回调接口通过判断由用户层传过来的配置信息进行判断,是否对当前操作拦截或放行:On the basis, when the user opens a file, dokany's file io read callback interface will be actively triggered. At the same time, the file io read callback interface determines whether to intercept or release the current operation by judging the configuration information passed by the user layer:

当权限认证通过后会进入到解密逻辑中实现文件的内存解密,并返回给用户层打开;When the permission authentication is passed, the file will be decrypted in memory and returned to the user layer for opening.

当授权不通过时会直接拦截该io操作,且文件保持加密状态。When authorization fails, the IO operation will be directly intercepted and the file will remain encrypted.

作为进一步优选,当授权不通过时会直接拦截该io操作时,可进一步配置成提示用户无权限打开。As a further preference, when the authorization is not passed, the io operation will be directly intercepted, and it can be further configured to prompt the user that he has no permission to open it.

在本发明的一些实施方式中,本发明方案中对解密文件的访问权限策略由用户层读取配置策略文件生成,然后写入到用户层程序后进行文件的权限管理。In some implementations of the present invention, the access permission policy for decrypted files in the solution of the present invention is generated by the user layer reading the configuration policy file, and then written into the user layer program to perform file permission management.

作为进一步说明,这里的文件权限包含删除,编辑,访问,更名权限,可由用户进行自由配置。其中不同的文件权限对应一个或者多个回调钩子函数,程序通过读取用户层传过来的配置文件,在特定权限的钩子回调中进行拦截,实现特定权限的访问控制。As a further explanation, the file permissions here include delete, edit, access, and rename permissions, which can be freely configured by the user. Different file permissions correspond to one or more callback hook functions. The program reads the configuration file passed from the user layer and intercepts it in the hook callback of a specific permission to implement access control for specific permissions.

具体的,这里的拦截策略可以根据策略文件定义,策略文件中包含文件名,文件扩展黑白名单,访问进程名,pid的黑白名单,访问用户的黑白名单,访问时间访问次数的配置。Specifically, the interception strategy here can be defined according to a policy file, which contains the configuration of the file name, file extension black and white list, access process name, pid black and white list, access user black and white list, access time and access count.

作为进一步说明,在具体实现时,该拦截策略由用户自行定义,所有的配置均会汇总为一段json数据或者xml,ini等结构化数据,程序启动后读取对应配置文件信息,传入内核层进行访问拦截控制。As a further explanation, in the specific implementation, the interception strategy is defined by the user, and all configurations will be summarized into a piece of json data or xml, ini and other structured data. After the program is started, the corresponding configuration file information is read and passed to the kernel layer for access interception control.

在基础上,本发明方案实现将所有的配置解析和加密解密解析操作迁移到用户层完成,有效克服现有minifilter方案中对于文件的拦截hook操作都必须在内核层体现,存在效率和占用等问题。本发明方案基于dokany的基础上实现对文件的内存解密,通过dokany形成的文件操作钩子接口,在文件信息读取接口中进行解密,通过进程访问策略防止不信任进程访问解密数据,实现对文件的所有操作均在用户层执行,解密数据保存在程序内存中,而内核层的文件接口仅用作和用户层的交互,由此使得本方案实现更加灵活,成本很低,且开发迅速,使得大部分开发仅需在用户态完成,避免了内核错误导致的系统崩溃问题,同时能够有效实现大数据的加解密保护。完全不同于传统的minifilter方案,所有解密数据保存于内核态,需要执行或者访问的文件资源过大,会导致系统崩溃。On the basis of this, the scheme of the present invention realizes the migration of all configuration parsing and encryption and decryption parsing operations to the user layer, effectively overcoming the problems of efficiency and occupancy in the existing minifilter scheme that the interception hook operation of the file must be reflected in the kernel layer. The scheme of the present invention realizes the memory decryption of the file based on dokany, and decrypts it in the file information reading interface through the file operation hook interface formed by dokany. The process access policy prevents untrusted processes from accessing the decrypted data, and realizes that all operations on the file are executed at the user layer. The decrypted data is stored in the program memory, and the file interface of the kernel layer is only used for interaction with the user layer, thereby making the implementation of this scheme more flexible, low cost, and rapid development, so that most of the development only needs to be completed in the user state, avoiding the system crash caused by kernel errors, and can effectively realize the encryption and decryption protection of big data. Completely different from the traditional minifilter scheme, all decrypted data is stored in the kernel state, and the file resources that need to be executed or accessed are too large, which will cause the system to crash.

针对本发明方案给出的基于用户层的内存加解密方案,在具体应用时,可构成相应的软件程序,形成相应的基于用户层的内存加解密系统。该软件程序在运行时,将执行上述的基于用户层的内存加解密方法,同时存储于相应的存储介质中,以供处理器调取执行。The user-layer-based memory encryption and decryption scheme provided by the present invention can be used to form a corresponding software program in specific applications to form a corresponding user-layer-based memory encryption and decryption system. When the software program is running, it will execute the above-mentioned user-layer-based memory encryption and decryption method and store it in a corresponding storage medium for the processor to retrieve and execute.

由此形成的基于用户层的内存加解密系统在运行时,能够基于dokany来在用户层对文件进行加密保护,权限控制,内存解密以及自动写回。The user-level memory encryption and decryption system thus formed can encrypt and protect files, perform permission control, memory decryption, and automatic write back at the user level based on dokany during runtime.

参见图1,其所示为通过本发明内存加解密系统对文件进行内存加解密操作的流程图。Referring to FIG. 1 , it is a flow chart showing the memory encryption and decryption operation of a file by the memory encryption and decryption system of the present invention.

由图可知,本内存加解密系统在对文件进行内存加解密操作时,dokany以镜像映射的方式启动,将被保护的加密状态原始文件映射到镜像目录(即镜像映射到任意指定空目录),由用户访问镜像目录进行查看,在经过dokany的镜像映射后自动解密,且监控当前解密文件的访问进程,拦截不信任进程或者放行信任进程。As can be seen from the figure, when this memory encryption and decryption system performs memory encryption and decryption operations on files, dokany is started in the form of mirror mapping, and the protected encrypted original file is mapped to the mirror directory (that is, the mirror is mapped to any specified empty directory). The user accesses the mirror directory for viewing, and it is automatically decrypted after dokany's mirror mapping, and the access process of the current decrypted file is monitored, intercepting untrusted processes or releasing trusted processes.

具体的,相应的原始文件通过加密程序预先进行加密,且加密方案和加密密钥可以不依赖本方案程序自行加密,也可以利用本程序自带的加密方案。文件加密后可更改其扩展名或者名称,方便程序识别加密文件。Specifically, the corresponding original file is encrypted in advance by the encryption program, and the encryption scheme and encryption key can be encrypted independently of the program, or the encryption scheme provided by the program can be used. After the file is encrypted, its extension or name can be changed to facilitate the program to identify the encrypted file.

进一步地,在程序中配置访问权限,并启动。程序通过读取配置中的加密方案进行解密,当用户打开文件触发钩子回调时,程序读取配置的加密算法,利用程序内置的密钥(或者加密空间读取密钥)对文件内容进行解密。Furthermore, the access rights are configured in the program and started. The program decrypts by reading the encryption scheme in the configuration. When the user opens the file and triggers the hook callback, the program reads the configured encryption algorithm and uses the program's built-in key (or the encryption space reading key) to decrypt the file content.

由于文件内容一般均为字符串,如此方案可适配目前常见的加密算法,包括对称和非对称加密,但是必须是可逆加密。Since file contents are generally strings, this solution can be adapted to currently common encryption algorithms, including symmetric and asymmetric encryption, but it must be reversible encryption.

当文件权限通过放行后,文件正常打开,但不同于传统的文件,当前打开的文件内容是通过内核层解密后展示在文件上,不存在于硬盘中而是内存上,因此大大增加了文件安全性。When the file permissions are released, the file opens normally, but unlike traditional files, the content of the currently opened file is decrypted by the kernel layer and displayed on the file. It does not exist on the hard disk but in the memory, thus greatly increasing the security of the file.

进一步地,本发明方案在实施过程中,解密文件经过dokany mount解密后,并实时监控当前访问程序时,文件的访问权限策略由用户层读取配置策略文件(json或者xml)生成,然后写入到用户层程序后实现文件的权限管理。这里的权限配置由用户自行指定,本发明方案中权限配置通过程序内部变量进行传递,也可以通过文件传递(安全性会变低,因为配置文件会被篡改),用户指定访问策略后程序通过变量将配置策略传递到dokany内核中,用户层和内核层的交互在系统层面是利用共享内存实现,即配置变量写入到共享内存中,再由内核驱动读取。Furthermore, during the implementation of the scheme of the present invention, after the decrypted file is decrypted by dokany mount and the current access program is monitored in real time, the access permission policy of the file is generated by the user layer reading the configuration policy file (json or xml), and then written to the user layer program to implement the file permission management. The permission configuration here is specified by the user. In the scheme of the present invention, the permission configuration is transferred through program internal variables, and can also be transferred through files (security will be reduced because the configuration file will be tampered with). After the user specifies the access policy, the program passes the configuration policy to the dokany kernel through variables. The interaction between the user layer and the kernel layer is implemented at the system level using shared memory, that is, the configuration variables are written to the shared memory and then read by the kernel driver.

进一步地,本发明方案在实施过程中,对于文件解密过程,优选采用对称加密算法,且需要同步加密和解密密钥,解密算法和密钥已经在程序中内置。这里的程序内部预设好常见的加密算法类,其中包括加解密密钥,加密方案,加密函数等,程序可直接调用加密或者加密算法。Furthermore, in the implementation of the scheme of the present invention, for the file decryption process, a symmetric encryption algorithm is preferably used, and encryption and decryption keys need to be synchronized, and the decryption algorithm and key are already built into the program. Common encryption algorithm classes are preset inside the program here, including encryption and decryption keys, encryption schemes, encryption functions, etc. The program can directly call encryption or encryption algorithms.

进一步地,本发明方案在实施过程中,对于加解密逻辑判断,仅涉及到文件解密,默认文件已经被加密成功。文件加密后会在文件头新增标识,当dokany判断到文件头匹配后会对文件解密,其余文件不解密和展示,即mount之后的解密文件仅包含需要解密的文件。Furthermore, during the implementation of the scheme of the present invention, the encryption and decryption logic judgment only involves file decryption, and the default file has been successfully encrypted. After the file is encrypted, a new identifier will be added to the file header. When dokany determines that the file header matches, it will decrypt the file, and the remaining files will not be decrypted and displayed, that is, the decrypted files after mounting only contain the files that need to be decrypted.

作为进一步说明,这里的文件的加密可以由用户自行加密,或者直接采用本程序的预设加密方案,在加密后程序需要识别原始目录下加密的文件与非加密文件,因此预设加密方案中文件加密后会自动改变其文件头标识,程序通过配置文件头来判断哪些文件需要解密。如果是用户自行加密,可以改变其文件名,文件扩展名来进行标识,程序同样经过文件名或者扩展名的正则匹配后进行判断解密。As a further explanation, the encryption of the files here can be done by the user, or directly use the preset encryption scheme of this program. After encryption, the program needs to identify the encrypted files and non-encrypted files in the original directory. Therefore, the file header identification will be automatically changed after the file is encrypted in the preset encryption scheme. The program determines which files need to be decrypted by configuring the file header. If the user encrypts it by himself, he can change the file name and file extension to identify it. The program also determines the decryption after the regular matching of the file name or extension.

进一步地,本发明方案在实施过程中,对于文件的自动写回部分,在用户获取权限打开解密文件后,当dokany拦截到用户写入操作,程序自动将写入部分加密并追加到缓冲区中,待用户关闭文件后,原始加密文件同时刷新到最新。这里写回的钩子函数一般是flush文件更新接口,该接口读取当前文件写入的数据,将数据进行加密后追加写入到原始文件中,从而实现文件的自动写回操作。Furthermore, during the implementation of the scheme of the present invention, for the automatic write-back part of the file, after the user obtains permission to open the decrypted file, when dokany intercepts the user's write operation, the program automatically encrypts the written part and appends it to the buffer, and after the user closes the file, the original encrypted file is refreshed to the latest at the same time. The write-back hook function here is generally the flush file update interface, which reads the data written by the current file, encrypts the data and appends it to the original file, thereby realizing the automatic write-back operation of the file.

进一步地,本发明方案在实施过程中,对于文件的解密依赖本方案的解密程序,该程序为普通windows进程,该程序利用c#对接dokany接口,打包后可直接执行,程序依赖dokany驱动包可在打包后进行自动安装,即使该程序被无意杀掉,解密文件会自动消失,不影响文件的安全性,即使原始文件被拷贝也是密文,无法查看,且当解密程序开启后会拦截系统explore操作,防止用户手动拷贝解密文件。Furthermore, during the implementation of the scheme of the present invention, the decryption of the file relies on the decryption program of the scheme, which is an ordinary Windows process. The program uses C# to connect to the dokany interface and can be directly executed after packaging. The program relies on the dokany driver package and can be automatically installed after packaging. Even if the program is accidentally killed, the decrypted file will automatically disappear without affecting the security of the file. Even if the original file is copied, it is ciphertext and cannot be viewed. When the decryption program is started, the system explore operation will be intercepted to prevent users from manually copying the decrypted file.

需要说明的,本发明方案中具体基于dokany来实现,在本发明方案原理的指导下,还可以采用memfs来实现。It should be noted that the solution of the present invention is specifically implemented based on dokany. Under the guidance of the principle of the solution of the present invention, memfs can also be used to implement it.

本发明实施例还提供了一种计算机可读存储介质,其上存储有程序,该程序被处理器执行时实现上述基于用户层的内存加解密方法的实现步骤。An embodiment of the present invention further provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the implementation steps of the above-mentioned user-layer-based memory encryption and decryption method are implemented.

本发明实施例还提供了一种处理器,所述处理器用于运行程序,其中,所述程序运行时执行上述基于用户层的内存加解密方法的实现步骤。An embodiment of the present invention further provides a processor, which is used to run a program, wherein when the program is running, the implementation steps of the above-mentioned user-layer-based memory encryption and decryption method are executed.

本发明实施例还提供了一种终端设备,设备包括处理器、存储器及存储在存储器上并可在处理器上运行的程序,所述程序代码由所述处理器加载并执行以实现上述基于用户层的内存加解密方法的实现步骤。An embodiment of the present invention also provides a terminal device, which includes a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program code is loaded and executed by the processor to implement the implementation steps of the above-mentioned user-layer-based memory encryption and decryption method.

本发明还提供了一种计算机程序产品,当在数据处理设备上执行时,适于执行上述基于用户层的内存加解密方法的实现步骤。The present invention also provides a computer program product, which, when executed on a data processing device, is suitable for executing the implementation steps of the above-mentioned user-layer-based memory encryption and decryption method.

在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and modules described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

本发明是参照本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to the flowchart and/or block diagram of the method, device (system), and computer program product of the embodiment of the present invention. It should be understood that each process and/or box in the flowchart and/or block diagram, as well as the combination of the process and/or box in the flowchart and/or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.

在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPU), input/output interfaces, network interfaces, and memory.

存储器可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。存储器是计算机可读介质的示例。The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and/or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

本领域技术人员应明白,本发明的实施例可提供为方法、系统或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

以上显示和描述了本发明的基本原理、主要特征和本发明的优点。本行业的技术人员应该了解,本发明不受上述实施例的限制,上述实施例和说明书中描述的只是说明本发明的原理,在不脱离本发明精神和范围的前提下,本发明还会有各种变化和改进,这些变化和改进都落入要求保护的本发明范围内。本发明要求保护范围由所附的权利要求书及其等效物界定。The above shows and describes the basic principles, main features and advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.

Claims (10)

1.一种基于用户层的内存加解密方法,其特征在于,在用户层将加密状态的原始文件镜像映射到任意指定空目录,并且在镜像映射过程中同步对原始文件目录下所有制定文件进行解密,且监控当前解密文件的访问进程,拦截不信任进程或者放行信任进程。1. A user-layer-based memory encryption and decryption method, characterized in that the original file in an encrypted state is mirrored to any specified empty directory at the user layer, and all specified files under the original file directory are decrypted synchronously during the mirror mapping process, and the access process of the current decrypted file is monitored to intercept untrusted processes or release trusted processes. 2.根据权利要求1所述的基于用户层的内存加解密方法,其特征在于,所述内存加解密方法在用户层基于dokany来对加密状态的任意目录的原始文件mount映射到其他指定空目录,同时进行解密,并且监控当前解密文件的访问进程。2. According to the user-layer memory encryption and decryption method of claim 1, it is characterized in that the memory encryption and decryption method uses dokany at the user layer to mount and map the original file of any directory in an encrypted state to other specified empty directories, decrypts at the same time, and monitors the access process of the current decrypted file. 3.根据权利要求2所述的基于用户层的内存加解密方法,其特征在于,所述内存加解密方法在mount映射过程中提供文件的操作钩子接口,并基于操作钩子接口进行文件的io操作拦截,授权放行和加解密的操作。3. According to the user layer-based memory encryption and decryption method of claim 2, it is characterized in that the memory encryption and decryption method provides a file operation hook interface during the mount mapping process, and performs file io operation interception, authorization release and encryption and decryption operations based on the operation hook interface. 4.根据权利要求3所述的基于用户层的内存加解密方法,其特征在于,4. The user-layer-based memory encryption and decryption method according to claim 3 is characterized in that: 所述内存加解密方法中基于操作钩子接口进行文件的内存解密时,文件通过加密程序预先进行加密;同时通过读取配置文件中的加密方案进行解密,当文件打开触发钩子回调时,读取配置文件的加密算法,利用程序内置的密钥或者加密空间读取密钥对文件内容进行解密。In the memory encryption and decryption method, when the memory decryption of the file is performed based on the operation hook interface, the file is encrypted in advance by an encryption program; at the same time, decryption is performed by reading the encryption scheme in the configuration file. When the file is opened and the hook callback is triggered, the encryption algorithm of the configuration file is read, and the file content is decrypted using the program's built-in key or the encryption space reading key. 5.根据权利要求3所述的基于用户层的内存加解密方法,其特征在于,所述内存加解密方法中基于操作钩子接口进行权限拦截与授权放行时,授予权限通过用户层配置;当打开文件时,则主动触发dokany的文件io读取回调接口,文件io读取回调接口通过判断由用户层传过来的配置信息进行判断,是否对当前操作拦截或放行,当权限认证通过后会进入到解密逻辑中实现文件的内存解密,并返回给用户层打开,当授权不通过时会直接拦截该io操作,且文件保持加密状态。5. According to the user layer-based memory encryption and decryption method of claim 3, it is characterized in that when the memory encryption and decryption method performs permission interception and authorization release based on the operation hook interface, the permission is granted through the user layer configuration; when the file is opened, the file io read callback interface of dokany is actively triggered, and the file io read callback interface determines whether to intercept or release the current operation by judging the configuration information transmitted from the user layer. When the permission authentication is passed, it will enter the decryption logic to realize the memory decryption of the file and return it to the user layer for opening. When the authorization is not passed, the io operation will be directly intercepted, and the file will remain encrypted. 6.根据权利要求2所述的基于用户层的内存加解密方法,其特征在于,所述内存加解密方法中对解密文件的访问权限策略由用户层读取配置策略文件生成,然后写入到用户层程序后进行文件的权限管理。6. According to the user layer-based memory encryption and decryption method of claim 2, it is characterized in that the access permission policy for the decrypted file in the memory encryption and decryption method is generated by the user layer reading the configuration policy file, and then written into the user layer program to perform file permission management. 7.一种基于dokany的内存加解密系统,包括处理器、存储器及存储在存储器上并可在处理器上运行的程序,其特征在于,所述程序由所述处理器加载并执行权利要求1-6中任一项所述的内存加解密方法的步骤。7. A memory encryption and decryption system based on dokany, comprising a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program is loaded by the processor and executes the steps of the memory encryption and decryption method according to any one of claims 1 to 6. 8.一种计算机可读存储介质,其上存储有程序,其特征在于,所述程序被处理器执行时实现权利要求1-6中任一项所述的基于dokany的内存加解密方法的实现步骤。8. A computer-readable storage medium having a program stored thereon, wherein when the program is executed by a processor, the implementation steps of the dokany-based memory encryption and decryption method according to any one of claims 1 to 6 are implemented. 9.一种终端设备,设备包括处理器、存储器及存储在存储器上并可在处理器上运行的程序,其特征在于,所述程序代码由所述处理器加载并执行以实现权利要求1-6中任一项所述的基于dokany的内存加解密方法的实现步骤。9. A terminal device, comprising a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program code is loaded and executed by the processor to implement the implementation steps of the dokany-based memory encryption and decryption method described in any one of claims 1 to 6. 10.一种计算机程序产品,当在数据处理设备上执行时,其特征在于,适于执行权利要求1-6中任一项所述的基于dokany的内存加解密方法的实现步骤。10. A computer program product, when executed on a data processing device, is characterized in that it is suitable for executing the implementation steps of the dokany-based memory encryption and decryption method according to any one of claims 1 to 6.
CN202410165916.6A 2024-02-05 2024-02-05 Memory encryption and decryption method, system and related equipment based on user layer Pending CN118013547A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202410165916.6A CN118013547A (en) 2024-02-05 2024-02-05 Memory encryption and decryption method, system and related equipment based on user layer
PCT/CN2024/089282 WO2025166911A1 (en) 2024-02-05 2024-04-23 Memory encryption and decryption method and system based on user layer, and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410165916.6A CN118013547A (en) 2024-02-05 2024-02-05 Memory encryption and decryption method, system and related equipment based on user layer

Publications (1)

Publication Number Publication Date
CN118013547A true CN118013547A (en) 2024-05-10

Family

ID=90958020

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410165916.6A Pending CN118013547A (en) 2024-02-05 2024-02-05 Memory encryption and decryption method, system and related equipment based on user layer

Country Status (2)

Country Link
CN (1) CN118013547A (en)
WO (1) WO2025166911A1 (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6052780A (en) * 1996-09-12 2000-04-18 Open Security Solutions, Llc Computer system and process for accessing an encrypted and self-decrypting digital information product while restricting access to decrypted digital information
US9740637B2 (en) * 2007-10-30 2017-08-22 Vmware, Inc. Cryptographic multi-shadowing with integrity verification
US9064131B2 (en) * 2010-07-28 2015-06-23 Nextlabs, Inc. Protecting documents using policies and encryption
CN105574431B (en) * 2015-12-10 2018-08-03 武汉理工大学 It is a kind of based on mostly as the encrypted file system of file
CN113591107A (en) * 2021-06-30 2021-11-02 中孚安全技术有限公司 System and method for realizing file redirection encryption and decryption

Also Published As

Publication number Publication date
WO2025166911A1 (en) 2025-08-14

Similar Documents

Publication Publication Date Title
US11809584B2 (en) File system metadata protection
CN104392188B (en) A kind of secure data store method and system
US11675919B2 (en) Separation of managed and unmanaged data in a computing device
US10007793B2 (en) Secure object having protected region, integrity tree, and unprotected region
US7908476B2 (en) Virtualization of file system encryption
US10261919B2 (en) Selective memory encryption
KR101067399B1 (en) One or more computer readable media storing a method, system and a plurality of instructions implemented in a computing device for storage and retrieval of data based on symmetric key encryption.
EP2510442B1 (en) System and method for secured backup of data
CN107016288B (en) Trusted Execution Environment
US20020194389A1 (en) Secure machine platform that interfaces to operating systems and customized control programs
US9152813B2 (en) Transparent real-time access to encrypted non-relational data
KR20030082484A (en) Saving and retrieving data based on public key encryption
US20070180257A1 (en) Application-based access control system and method using virtual disk
Ayoade et al. Secure data processing for IoT middleware systems
CN102609667A (en) Automatic file encryption and decryption system and automatic file encryption and decryption method based on filter drive program
CN115758420A (en) File access control method, device, equipment and medium
CN114912138A (en) Architecture, system and method for secure computing using hardware security level
WO2025153866A1 (en) Fully encrypted database system, data processing method, security control apparatus, and device
CN107330336B (en) Instant encryption and decryption method and system for memory page of Linux operating system
CN118013547A (en) Memory encryption and decryption method, system and related equipment based on user layer
CN116860666A (en) A GPU memory protection method, device, chip and electronic equipment
KR20050077664A (en) Secure kernel system supporting encryption
Yang et al. A Design of Code Protection Scheme Based on the Combination of OPTEE and Encrypted File System
CN108965573A (en) A kind of guard method of Android mixed mode mobile application internal resource and device
JP2023154825A (en) Distributed information processing system, and distributed information processing method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination