WO2021139075A1 - 合同的加密和解密方法、装置、设备及存储介质 - Google Patents

合同的加密和解密方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2021139075A1
WO2021139075A1 PCT/CN2020/093550 CN2020093550W WO2021139075A1 WO 2021139075 A1 WO2021139075 A1 WO 2021139075A1 CN 2020093550 W CN2020093550 W CN 2020093550W WO 2021139075 A1 WO2021139075 A1 WO 2021139075A1
Authority
WO
WIPO (PCT)
Prior art keywords
contract
encryption
decryption
key
contract document
Prior art date
Application number
PCT/CN2020/093550
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 WO2021139075A1 publication Critical patent/WO2021139075A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6209Protecting access to data via a platform, e.g. using keys or access control rules to a single file or object, e.g. in a secure envelope, encrypted and accessed using a key, or with access control rules appended to the object itself
    • 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/008Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols involving homomorphic encryption
    • 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/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0863Generation of secret information including derivation or calculation of cryptographic keys or passwords involving passwords or one-time passwords

Definitions

  • This application relates to the field of information security technology, in particular to a contract encryption and decryption method, device, equipment and storage medium.
  • Electronic files refer to different forms of information records such as text, graphics, audio, and video that are formed, handled, transmitted, and stored through computers and other electronic equipment in the process of handling official affairs of agencies, organizations, enterprises, institutions, and other organizations. With the widespread use of computers and the in-depth development of office automation, more and more confidential information exists in the form of electronic files, such as contracts. As electronic files have the characteristics of easy copying, easy modification, easy transfer, etc., as electronic files are more and more widely used, their security and sharing issues have also received more and more attention. In the entire life cycle of electronic files, it can be divided into the generation and circulation phase of electronic files and the archiving and preservation phase. The inventor realizes that most of the domestic and foreign documents mainly study the safety management of electronic document archiving and preservation.
  • This application provides a contract encryption and decryption method, device, equipment, and storage medium, the main purpose of which is to provide the user with an efficient contract encryption and decryption method when the user encrypts and decrypts the contract.
  • a contract encryption and decryption method provided by this application includes:
  • each contract document in the contract document set perform hierarchical encryption on the contract document set to obtain a target contract document set.
  • the target contract document set includes multiple target contract document subsets with different encryption levels ,
  • the encryption level corresponds to the user's viewing authority;
  • the contract file viewing request including the user viewing authority, selecting a decryption key corresponding to the user viewing authority from a set of pre-built decryption keys, and converting the target contract file according to the decryption key
  • the contract documents corresponding to the contract document viewing request are concentrated and decrypted.
  • the stepwise encryption of the contract document set to obtain the target contract document set includes:
  • the set of target contract documents includes a subset of confidential contract documents and a subset of core contract documents with successively decreasing encryption levels And a subset of ordinary contract documents.
  • the obtaining the initial secret key and generating the encryption secret key corresponding to the encryption level information includes:
  • the one-way encryption function encryption of the initial secret key includes:
  • E(M x ) represents the encrypted plaintext M x
  • E(M y ) represents the encrypted plaintext M y ;
  • the selecting a decryption key corresponding to the user viewing authority from a set of pre-built decryption keys includes:
  • this application also provides a contract encryption and decryption device, including:
  • the confidentiality rating module is used to receive the approved contract document set, perform confidentiality rating on each contract document in the contract document set according to the preset user viewing authority, and generate encryption level information for each of the contract documents;
  • the extension encryption module is used to perform hierarchical encryption on the contract document set according to the encryption level information of each contract document in the contract document set to obtain a target contract document set.
  • the target contract document set includes multiple encryption levels with different encryption levels. A subset of target contract documents, the encryption level corresponds to the user's viewing authority;
  • the extension decryption module is used to receive the contract file viewing request, the contract file viewing request includes the user viewing authority, the decryption key corresponding to the user viewing authority is selected from the pre-built decryption key set, and the decryption key corresponding to the user viewing authority is selected according to the decryption key Decrypt the target contract documents in a centralized manner corresponding to the contract document viewing request.
  • this application also provides a contract encryption and decryption device, which includes a memory and a processor, and the memory stores a contract encryption and decryption program that can run on the processor.
  • the encryption and decryption program of the contract is executed by the processor, the following steps are implemented:
  • each contract document in the contract document set perform hierarchical encryption on the contract document set to obtain a target contract document set.
  • the target contract document set includes multiple target contract document subsets with different encryption levels ,
  • the encryption level corresponds to the user's viewing authority;
  • the contract file viewing request including the user viewing authority, selecting a decryption key corresponding to the user viewing authority from a set of pre-built decryption keys, and converting the target contract file according to the decryption key
  • the contract documents corresponding to the contract document viewing request are concentrated and decrypted.
  • the stepwise encryption of the contract document set to obtain the target contract document set includes:
  • the set of target contract documents includes a subset of confidential contract documents and a subset of core contract documents with successively decreasing encryption levels And a subset of ordinary contract documents.
  • the obtaining the initial secret key and generating the encryption secret key corresponding to the encryption level information includes:
  • the one-way encryption function encryption of the initial secret key includes:
  • E(M x ) represents the encrypted plaintext M x
  • E(M y ) represents the encrypted plaintext M y ;
  • this application also provides a computer-readable storage medium on which is stored a contract encryption and decryption program, and the contract encryption and decryption program can be used by one or more
  • the processor executes the steps of the method for encrypting and decrypting the contract as described above.
  • the method, device, equipment and storage medium for encrypting and decrypting the contract of the contract proposed in this application receive the contract document set based on the approval, and perform confidentiality rating on the contract document set according to the preset user viewing authority; according to the contract For the confidentiality rating of the file set, the contract file set is hierarchically encrypted to obtain the target contract file set; when the user views the target contract file set, the user’s viewing authority is selected from the set of pre-built decryption keys The corresponding decryption key decrypts the target contract file set according to the decryption key, so that the result of the encryption and decryption of the contract can be presented to the user.
  • FIG. 1 is a schematic flowchart of a method for encrypting and decrypting a contract provided by an embodiment of the application;
  • Figure 2 is a schematic diagram of the internal structure of a contract encryption and decryption device provided by an embodiment of the application;
  • FIG. 3 is a schematic diagram of modules of the contract encryption and decryption device in the contract encryption and decryption device provided by an embodiment of the application.
  • This application provides a method for encrypting and decrypting contracts.
  • FIG. 1 it is a schematic flowchart of a contract encryption and decryption method provided by an embodiment of this application.
  • the method can be executed by a device, and the device can be implemented by software and/or hardware.
  • the encryption and decryption methods of the contract include:
  • the contract document set based on the approval is a contract template written by professional legal personnel and formed by the approval of the senior personnel of the enterprise.
  • the contract template may be a labor contract template, a sales contract template, a credit assignment contract template, and the like.
  • the preset user viewing authority in this application is set by the importance of the contract document set.
  • the preferred embodiment of the present application is divided into three levels: L1, L2, and L3 according to the importance of contract documents from low to high, and obtains the L1 contract document set, the L2 contract document set, and the L3 contract document set.
  • the division of the contract document set of three levels completes the confidentiality rating of the contract document set.
  • the L1 contract document set can be viewed by all employees of the enterprise; the L2 contract document set is visible to some departments of the enterprise, and the partial departments may be the legal department, the risk control department, and the human resources department, etc.; the L3 The contract document set is visible to some employees of the enterprise, and the some employees may be the CEO, CFO, COO, etc. of the enterprise.
  • the preferred embodiment of this application obtains the initial secret key, generates the encryption secret key corresponding to the encryption level information, and composes the encryption secret key set according to the encryption secret key corresponding to the encryption level information.
  • the key set performs hierarchical encryption on the contract document set to obtain the target contract document set, where the target contract document set includes a confidential contract document subset, a core contract document subset, and a common contract document subset with successively decreasing encryption levels set.
  • the encryption key refers to encryption keys K1, K2, and K3 from low to high levels, where the encryption keys K1, K2, and K3 correspond to the above-mentioned L1, L2, and L3 contract document sets respectively.
  • the encryption keys K 1 , K 2 and K 3 are generated from the initial key K 0 through public key encryption.
  • the public key encryption described in this application is semi-homomorphic encryption.
  • the homomorphic encryption refers to symmetric encryption, which includes: for a given plaintext (x 1 , x 2 ,..., x n ), the ciphertext c is obtained after encryption with a homomorphic encryption algorithm, and the ciphertext c is obtained after the homomorphic encryption algorithm During encryption, anyone is allowed to perform any operation f on the ciphertext c, and the ciphertext f(c) obtained after the operation is the same as the result of f(x 1 ,x 2 ,...,x n ) after the operation, and is encrypted In the process, (x 1 ,x 2 ,...,x n ), f(x 1 ,x 2 ,...,x n ) and any intermediate plaintext have not been leaked, including the input value, output value, and intermediate value have been encrypted Status.
  • the semi-homomorphic encryption refers to asymmetric encryption.
  • the encrypted plaintext is required to satisfy only additive homomorphism or multiplicative homomorphism.
  • this application uses the semi-homomorphic encryption algorithm described in the RSA encryption algorithm.
  • the initial key K 0 is encrypted by the RSA encryption algorithm to generate the encryption keys K 1 , K 2 and K 3 , and the encryption keys K 1 , K 2 and K 3 is respectively applied to the encryption of the aforementioned L1, L2, and L3 contract document sets to obtain the ordinary contract document set, the core contract document set, and the confidential contract document set.
  • the initial key K 0 is an initial password set by the user, and the initial password includes numbers, letters, and characters, such as 123, abc, and 123abc.
  • the generating of the encryption keys K 1 , K 2 and K 3 includes: obtaining the public key (PK) of the initial key ;
  • the encryption function (Epk) performs encryption and generates the encryption keys K1, K2, and K3.
  • the public key of the RSA encryption algorithm is (E, N)
  • the one-way encryption function (Epk) encryption of the initial secret key includes:
  • any plaintext M 1 , M 2 ,...M n in the initial secret key is homomorphically multiplied and encrypted to obtain:
  • the private key (SK) is generated at the same time as the public key (PK) of the encryption key is generated, and the decryption key set is constructed by the SK.
  • the one-way decryption function in the private key and the corresponding one-way encryption function are used to decrypt to generate a decryption that is not higher than its own level
  • the secret key is used to complete the decryption of the target contract document set through the decryption key, and complete the decryption of the encrypted contract below its own level.
  • the one-way encryption function (Epk) can encrypt K 0 and iteratively generate low-to-high-level keys K 1 , K 2 and K 3 , while one-way decryption
  • the function (Dsk) can start from one of K 1 , K 2 or K 3 , and iteratively generate high-level keys from high to low.
  • K 2 Epk(K 1 )
  • K 2 Dsk(K 3 )
  • K 1 Dsk(K 2 ).
  • a decryption key corresponding to the user's viewing authority is selected from a pre-built decryption key set, and the target contract document set is decrypted according to the decryption key.
  • PK public key
  • the invention also provides a contract encryption and decryption device.
  • FIG. 2 it is a schematic diagram of the internal structure of a contract encryption and decryption device 1 provided by an embodiment of this application.
  • the contract encryption and decryption device 1 may be a PC (Personal Computer, personal computer), or a terminal device such as a smart phone, a tablet computer, or a portable computer, or a server.
  • the encryption and decryption device 1 of the contract includes at least a memory 11, a processor 12, a communication bus 13, and a network interface 14.
  • the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, and the like.
  • the memory 11 may be an internal storage unit of the contract encryption and decryption device 1 in some embodiments, for example, the hard disk of the contract encryption and decryption device 1.
  • the memory 11 may also be an external storage device of the contract encryption and decryption device 1, such as a plug-in hard disk or a smart media card (SMC) equipped on the contract encryption and decryption device 1. Secure Digital (SD) card, Flash Card, etc.
  • SD Secure Digital
  • the memory 11 may also include both an internal storage unit of the contract encryption and decryption device 1 and an external storage device.
  • the memory 11 can be used not only to store application software and various data installed in the contract encryption and decryption device 1, such as the code of the contract encryption and decryption program 01, but also to temporarily store data that has been output or will be output. .
  • the processor 12 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip, for running program codes or processing stored in the memory 11 Data, such as the encryption and decryption program 01 that executes the contract, etc.
  • CPU central processing unit
  • controller microcontroller
  • microprocessor or other data processing chip, for running program codes or processing stored in the memory 11 Data, such as the encryption and decryption program 01 that executes the contract, etc.
  • the communication bus 13 is used to realize the connection and communication between these components.
  • the network interface 14 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface), and is usually used to establish a communication connection between the device 1 and other electronic devices.
  • the device 1 may also include a user interface.
  • the user interface may include a display (Display) and an input unit such as a keyboard (Keyboard).
  • the optional user interface may also include a standard wired interface and a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc.
  • the display can also be appropriately called a display screen or a display unit, which is used to display the information processed in the encryption and decryption device 1 of the contract and to display a visualized user interface.
  • Figure 2 only shows the contract encryption and decryption device 1 with components 11-14 and the contract encryption and decryption program 01. Those skilled in the art can understand that the structure shown in Figure 1 does not constitute the encryption of the contract
  • the definition of the decryption device 1 and the decryption device 1 may include fewer or more components than shown, or a combination of some components, or a different component arrangement.
  • the storage 11 stores the contract encryption and decryption program 01; when the processor 12 executes the contract encryption and decryption program 01 stored in the storage 11, the following steps are implemented:
  • Step 1 Receive a set of contract documents based on the audit, perform confidentiality ratings on the contract documents in the set of contract documents according to preset user viewing rights, and generate encryption level information for each of the contract documents.
  • the contract document set based on the approval is a contract template written by professional legal personnel and formed by the approval of the senior personnel of the enterprise.
  • the contract template may be a labor contract template, a sales contract template, a credit assignment contract template, and the like.
  • the preset user viewing authority in this application is set by the importance of the contract document set.
  • the preferred embodiment of the present application is divided into three levels: L1, L2, and L3 according to the importance of contract documents from low to high, and obtains the L1 contract document set, the L2 contract document set, and the L3 contract document set.
  • the division of the contract document set of three levels completes the confidentiality rating of the contract document set.
  • the L1 contract document set can be viewed by all employees of the enterprise; the L2 contract document set is visible to some departments of the enterprise, and the partial departments may be the legal department, the risk control department, and the human resources department, etc.; the L3 The contract document set is visible to some employees of the enterprise, and the some employees may be the CEO, CFO, COO, etc. of the enterprise.
  • Step 2 According to the encryption level information of each contract document in the contract document set, perform hierarchical encryption on the contract document set to obtain a target contract document set.
  • the preferred embodiment of this application obtains the initial secret key, generates the encryption secret key corresponding to the encryption level information, and composes the encryption secret key set according to the encryption secret key corresponding to the encryption level information.
  • the key set performs hierarchical encryption on the contract document set to obtain the target contract document set, where the target contract document set includes a confidential contract document subset, a core contract document subset, and a common contract document subset with successively decreasing encryption levels set.
  • the encryption key refers to encryption keys K1, K2, and K3 from low to high levels, where the encryption keys K1, K2, and K3 correspond to the above-mentioned L1, L2, and L3 contract document sets respectively.
  • the encryption keys K 1 , K 2 and K 3 are generated from the initial key K 0 through public key encryption.
  • the public key encryption described in this application is semi-homomorphic encryption.
  • the homomorphic encryption refers to symmetric encryption, which includes: for a given plaintext (x 1 , x 2 ,..., x n ), the ciphertext c is obtained after encryption with a homomorphic encryption algorithm, and the ciphertext c is obtained after the homomorphic encryption algorithm During encryption, anyone is allowed to perform any operation f on the ciphertext c, and the ciphertext f(c) obtained after the operation is the same as the result of f(x 1 ,x 2 ,...,x n ) after the operation, and is encrypted In the process, (x 1 ,x 2 ,...,x n ), f(x 1 ,x 2 ,...,x n ) and any intermediate plaintext have not been leaked, including the input value, output value, and intermediate value have been encrypted Status.
  • the semi-homomorphic encryption refers to asymmetric encryption.
  • the encrypted plaintext is required to satisfy only additive homomorphism or multiplicative homomorphism.
  • this application uses the semi-homomorphic encryption algorithm described in the RSA encryption algorithm.
  • the initial key K 0 is encrypted by the RSA encryption algorithm to generate the encryption keys K 1 , K 2 and K 3 , and the encryption keys K 1 , K 2 and K 3 is respectively applied to the encryption of the aforementioned L1, L2, and L3 contract document sets to obtain the ordinary contract document set, the core contract document set, and the confidential contract document set.
  • the initial key K 0 is an initial password set by the user, and the initial password includes numbers, letters, and characters, such as 123, abc, and 123abc.
  • the generating of the encryption keys K 1 , K 2 and K 3 includes: obtaining the public key (PK) of the initial key ;
  • the encryption function (Epk) performs encryption and generates the encryption keys K1, K2, and K3.
  • the public key of the RSA encryption algorithm is (E, N)
  • the one-way encryption function (Epk) encryption of the initial secret key includes:
  • any plaintext M 1 , M 2 ,...M n in the initial secret key is homomorphically multiplied and encrypted to obtain:
  • Step 3 When the user is viewing the target contract document set, the decryption key corresponding to the user's viewing authority is selected from the pre-built decryption key set, and the target contract document set is set according to the decryption key. Decrypt.
  • the private key (SK) is generated at the same time as the public key (PK) of the encryption key is generated, and the decryption key set is constructed by the SK.
  • the one-way decryption function in the private key and the corresponding one-way encryption function are used to decrypt to generate a decryption that is not higher than its own level
  • the secret key is used to complete the decryption of the target contract document set through the decryption key, and complete the decryption of the encrypted contract below its own level.
  • the one-way encryption function (Epk) can encrypt K 0 and iteratively generate low-to-high-level keys K 1 , K 2 and K 3 , while one-way decryption
  • the function (Dsk) can start from one of K 1 , K 2 or K 3 , and iteratively generate high-level keys from high to low.
  • K 2 Epk(K 1 )
  • K 2 Dsk(K 3 )
  • K 1 Dsk(K 2 ).
  • a decryption key corresponding to the user's viewing authority is selected from a pre-built decryption key set, and the target contract document set is decrypted according to the decryption key.
  • PK public key
  • the contract encryption and decryption device 100 may also be divided into one or more modules, and the one or more modules are stored in the memory 11 and are executed by one or more processors (this The embodiment is executed by the processor 12) to complete this application.
  • the module referred to in this application refers to a series of computer program instruction segments that can complete specific functions, and is used to describe the encryption and decryption program of the contract 01 in the encryption and decryption of the contract The execution process in the device 100.
  • FIG. 3 a framework diagram of the contract encryption and decryption device 100 in an embodiment of the contract encryption and decryption device 100 for this application.
  • the contract encryption and decryption device 100 can be divided Illustratively for the confidential rating module 10, the hierarchical encryption 20, and the hierarchical decryption module 30:
  • the confidentiality rating module 10 is configured to: receive a set of contract documents based on approval, perform a confidentiality rating on each contract document in the set of contract documents according to a preset user viewing authority, and generate encryption level information for each of the contract documents .
  • the hierarchical encryption module 20 is configured to: perform hierarchical encryption on the contract document set according to the encryption level information of each contract document in the contract document set to obtain a target contract document set.
  • the target contract document set includes different encryption levels. Multiple target contract document subsets at different levels, and the encryption level corresponds to the user’s viewing authority.
  • the hierarchical decryption module 30 is configured to: receive a contract file viewing request, the contract file viewing request including a user viewing authority, select a decryption key corresponding to the user viewing authority from a set of pre-built decryption keys, and according to the The decryption key decrypts the target contract file collectively and the contract file corresponding to the contract file viewing request.
  • the embodiment of the present application also proposes a computer-readable storage medium.
  • the computer-readable storage medium may be non-volatile or volatile.
  • a contract encryption and decryption program 01 is stored on the computer-readable storage medium, and the contract encryption and decryption program 01 can be executed by one or more processors 12 to implement the following operations:
  • each contract document in the contract document set perform hierarchical encryption on the contract document set to obtain a target contract document set.
  • the target contract document set includes multiple target contract document subsets with different encryption levels ,
  • the encryption level corresponds to the user's viewing authority;
  • the contract file viewing request including the user viewing authority, selecting a decryption key corresponding to the user viewing authority from a set of pre-built decryption keys, and converting the target contract file according to the decryption key
  • the contract documents corresponding to the contract document viewing request are concentrated and decrypted.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Storage Device Security (AREA)

Abstract

本申请涉及一种信息安全技术,揭露了一种合同的加密和解密方法,包括:接收审核通过的合同文件集,按预设的用户查看权限对所述合同文件集中的各合同文件进行保密评级并生成每个所述合同文件的加密级别信息;根据所述合同文件集中每个合同文件的加密级别信息,将所述合同文件集进行分级加密,得到目标合同文件集;接收合同文件查看请求,所述合同文件查看请求包括用户查看权限,从预先构建的解密秘钥集中选取与所述用户查看权限对应的解密秘钥,根据所述解密秘钥将所述目标合同文件集中与所述合同文件查看请求对应的合同文件进行解密。本申请还提出一种合同的加密和解密装置以及一种计算机可读存储介质。本申请实现了合同的加密和解密。

Description

合同的加密和解密方法、装置、设备及存储介质
本申请要求于2020年01月09日提交中国专利局、申请号为202010024090.3、发明名称为“合同的加密和解密方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在申请中。
技术领域
本申请涉及信息安全技术领域,尤其涉及一种合同的加密和解密方法、装置、设备及存储介质。
背景技术
电子文件是指在机关、团体、企事业单位和其他组织在处理公务过程中,通过计算机等电子设备形成、办理、传输和存储的文字、图表、音频、视频等不同形式的信息记录。随着计算机的普遍应用和办公自动化的深入发展,越来越多的机密信息以电子文件的形式存在,例如合同。由于电子文件具有易复制、易修改、易转移等特点,使得电子文件在应用越来越广泛的同时,其安全和共享问题也受到越来越多的重视。在电子文件整个生命周期阶段里,可以把其分成电子文件的生成流转阶段和归档保存阶段。发明人意识到国内外大多数文献主要研究的是电子文件归档保存阶段的安全管理,即使有少量文献谈到电子文件生成流程中的安全控制问题,但没有结合用户来研究其安全使用问题,更没有从密码学角度来深入研究用户的分级加密多级授权的安全使用问题。因此,在合同开发时,或使用平台合同任何人可以观看以及查看,在起草后合同已不再是模板,部分合同应该有相应的保密措施,目前没有体现,对于对合同的审核改动记录,没有任何的措施。
发明内容
本申请提供一种合同的合同的加密和解密方法、装置、设备及存储介质,其主要目的在于当用户进行合同的加密和解密时,给用户提供一种高效的合同的加密和解密方法。
为实现上述目的,本申请提供的一种合同的加密和解密方法,包括:
接收审核通过的合同文件集,按预设的用户查看权限对所述合同文件集中的各合同文件进行保密评级并生成每个所述合同文件的加密级别信息;
根据所述合同文件集中每个合同文件的加密级别信息,将所述合同文件集进行分级加密,得到目标合同文件集,所述目标合同文件集包括具有不同加密级别的多个目标合同文件子集,加密级别与用户查看权限相对应;
接收合同文件查看请求,所述合同文件查看请求包括用户查看权限,从预先构建的解密秘钥集中选取与所述用户查看权限对应的解密秘钥,根据所述解密秘钥将所述目标合同文件集中与所述合同文件查看请求对应的合同文件进行解密。
可选地,所述将所述合同文件集进行分级加密,得到目标合同文件集包括:
获取初始秘钥,生成与所述加密级别信息对应的加密秘钥,并将所述加密级别信息对应的多种加密秘钥组成加密秘钥集合;
根据所述加密秘钥集合对所述合同文件集进行分级加密,得到所述目标合同文件集,其中,所述目标合同文件集包括加密级别依次递减的机密合同文件子集、核心合同文件子集以及普通合同文件子集。
可选地,所述获取初始秘钥,生成与所述加密级别信息对应的加密秘钥包括:
获取所述初始秘钥的公开秘钥,通过所述公开秘钥对所述初始秘钥的单向加密函数进行加密,以生成与所述加密级别信息对应的加密秘钥,其中,所述单向加密函数对秘钥K 0进行加密后依次迭代生成由低到高的秘钥K 1、K 2和K 3
可选地,所述对所述初始秘钥的单向加密函数加密包括:
将所述初始秘钥中任意一个明文M进行加密得到:
C=E(M)=M emod N,其中,E(M)表示加密后的明文M,e表示无限不循环小数,mod N表示加密次数;
将所述初始秘钥中任意的两个明文M x,M y进行同态相乘加密得到:
Figure PCTCN2020093550-appb-000001
其中,E(M x)表示加密后的明文M x,E(M y)表示加密后的明文M y
将所述初始秘钥中任意的明文M 1,M 2,…M n进行同态相乘加密得到:
E(M 1)*E(M 2)*…E(M n)=E(M 1*M 2*…M n)。
可选地,所述从预先构建的解密秘钥集中选取与所述用户查看权限对应的解密秘钥包括:
获取预先分配的与所述用户查看权限对应的私用秘钥;
根据所述私用秘钥中的单向解密函数解密对应的单向加密函数,以生成与所述用户查看权限对应的解密秘钥,其中,所述单向解密函数根据上述单向加密函数依次迭代产生由高到低的等级秘钥。
此外,为实现上述目的,本申请还提供一种合同的加密和解密装置,包括:
保密评级模块,用于接收审核通过的合同文件集,按预设的用户查看权限对所述合同文件集中的各合同文件进行保密评级并生成每个所述合同文件的加密级别信息;
分机加密模块,用于根据所述合同文件集中每个合同文件的加密级别信息,将所述合同文件集进行分级加密,得到目标合同文件集,所述目标合同文件集包括具有不同加密级别的多个目标合同文件子集,加密级别与用户查看权限相对应;
分机解密模块,用于接收合同文件查看请求,所述合同文件查看请求包括用户查看权限,从预先构建的解密秘钥集中选取与所述用户查看权限对应的解密秘钥,根据所述解密秘钥将所述目标合同文件集中与所述合同文件查看请求对应的合同文件进行解密。
此外,为实现上述目的,本申请还提供一种合同的加密和解密设备,该设备包括存储器和处理器,所述存储器中存储有可在所述处理器上运行的合同的加密和解密程序,所述合同的加密和解密程序被所述处理器执行时实现如下步骤:
接收审核通过的合同文件集,按预设的用户查看权限对所述合同文件集中的各合同文件进行保密评级并生成每个所述合同文件的加密级别信息;
根据所述合同文件集中每个合同文件的加密级别信息,将所述合同文件集进行分级加密,得到目标合同文件集,所述目标合同文件集包括具有不同加密级别的多个目标合同文件子集,加密级别与用户查看权限相对应;
接收合同文件查看请求,所述合同文件查看请求包括用户查看权限,从预先构建的解密秘钥集中选取与所述用户查看权限对应的解密秘钥,根据所述解密秘钥将所述目标合同文件集中与所述合同文件查看请求对应的合同文件进行解密。
可选地,所述将所述合同文件集进行分级加密,得到目标合同文件集包括:
获取初始秘钥,生成与所述加密级别信息对应的加密秘钥,并将所述加密级别信息对应的多种加密秘钥组成加密秘钥集合;
根据所述加密秘钥集合对所述合同文件集进行分级加密,得到所述目标合同文件集,其中,所述目标合同文件集包括加密级别依次递减的机密合同文件子集、核心合同文件子集以及普通合同文件子集。
可选地,所述获取初始秘钥,生成与所述加密级别信息对应的加密秘钥包括:
获取所述初始秘钥的公开秘钥,通过所述公开秘钥对所述初始秘钥的单向加密函数进行加密,以生成与所述加密级别信息对应的加密秘钥,其中,所述单向加密函数对秘钥K 0进行加密后依次迭代生成由低到高的秘钥K 1、K 2和K 3
可选地,所述对所述初始秘钥的单向加密函数加密包括:
将所述初始秘钥中任意一个明文M进行加密得到:
C=E(M)=M emod N,其中,E(M)表示加密后的明文M,e表示无限不循环小数,mod N表示加密次数;
将所述初始秘钥中任意的两个明文M x,M y进行同态相乘加密得到:
Figure PCTCN2020093550-appb-000002
其中,E(M x)表示加密后的明文M x,E(M y)表示加密后的明文M y
将所述初始秘钥中任意的明文M 1,M 2,…M n进行同态相乘加密得到:
E(M 1)*E(M 2)*…E(M n)=E(M 1*M 2*…M n)。
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有合同的加密和解密程序,所述合同的加密和解密程序可被一个或者多个处理器执行,以实现如上所述的合同的加密和解密方法的步骤。
本申请提出的合同的合同的加密和解密方法、装置、设备及存储介质,接收基于审核通过的合同文件集,按预设的用户查看权限对所述合同文件集进行保密评级;根据所述合同文件集的保密评级,将所述合同文件集进行分级加密,得到目标合同文件集;当用户进行查看所述目标合同文件集时,从预先构建的解密秘钥集中选取与所述用户的查看权限对应的解密秘钥,根据所述解密秘钥将所述目标合同文件集进行解密,从而可以给用户呈现出合同的加密和解密结果。
附图说明
图1为本申请一实施例提供的合同的加密和解密方法的流程示意图;
图2为本申请一实施例提供的合同的加密和解密设备的内部结构示意图;
图3为本申请一实施例提供的合同的加密和解密装置中合同的加密和解密装置的模块示意图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请提供一种合同的加密和解密方法。参照图1所示,为本申请一实施例提供的合同的加密和解密方法的流程示意图。该方法可以由一个装置执行,该装置可以由软件和/或硬件实现。
在本实施例中,合同的加密和解密方法包括:
S1、接收基于审核通过的合同文件集,按预设的用户查看权限对所述合同文件集中的合同文件进行保密评级并生成每个所述合同文件的加密级别信息。
本申请较佳实施例中,所述基于审核通过的合同文件集是由专业法律人员进行撰写的合同模板并由企业高层人员审核通过形成得到。其中,所述合同模板可以为劳动合同模板、买卖合同模板以及债权转让合同模板等。
较佳地,本申请中所述预设的用户查看权限通过所述合同文件集的重要程度进行设置。详细地,本申请较佳实施例按合同文件的重要程度由低到高划分为L1、L2以及L3三个级别,得到L1合同文件集、L2合同文件集以及L3合同文件集,根据所述三个级别的合同文件集的划分完成所述合同文件集的保密评级。其中,所述L1合同文件集为企业所有员工可以查看;所述L2合同文件集为企业的部分部门可见,所述部分部门可以为法律部门、风控部门、以及人力资源部门等;所述L3合同文件集为企业的部分员工可见,所述部分员工可以为企业的CEO、CFO以及COO等。
S2、根据所述合同文件集中每个合同文件的加密级别信息,将所述合同文件集进行分级加密,得到目标合同文件集。
本申请较佳实施例通过获取初始秘钥,生成与所述加密级别信息对应的加密秘钥,并将所述加密级别信息对应的多种加密秘钥组成加密秘钥集合,根据所述加密秘钥集合对所述合同文件集进行分级加密,得到所述目标合同文件集,其中,所述目标合同文件集包括加密级别依次递减的机密合同文件子集、核心合同文件子集以及普通合同文件子集。详细地,所述加密秘钥指的是由低到高级别的加密秘钥K1、K2以及K3,其中,所述加密秘钥K1、K2以及K3分别对应上述L1、L2以及L3合同文件集进行加密,并按所述合同文件集级别由低到高划分为普通合同文件子集、核心合同文件子集以及机密合同文件子集。其中,所述加密秘钥K 1、K 2以及K 3由初始秘钥K 0通过公钥加密生成。较佳地,本申请所述公钥加密为半同态加密。其中,所述同态加密指的是对称加密,包括:对给定的明文(x 1,x 2,…,x n),利用同态加密算法加密后得到密文c,在所述同态加密中允许任何人对密文c进行任何操作f,操作后得到的密文f(c)解密后与f(x 1,x 2,…,x n)的结果是一样的,并在其加密过程中所述(x 1,x 2,…,x n)、f(x 1,x 2,…,x n)以及任何中间明文没有出现泄露,包括输入值、输出值、中间值一直处于加密状态中。所述半同态加密指的是非对称加密,在所述半同态加密中要求加密明文仅满足加法同态或乘法同态。较佳地,本申请将RSA加密算法所述半同态加密的算法。
较佳地,本申请中通过所述RSA加密算法对所述初始秘钥K 0进行加密生成所述加密秘钥K 1、K 2以及K 3,根据所述加密秘钥K 1、K 2以及K 3分别应用于上述L1、L2以及L3合同文件集的加密,得到所述普通合同文件集、核心合同文件集以及机密合同文件集。其中,所述初始秘钥K 0为用户设置的初始密码,所述初始密码包括数字、字母以及字符等,比如123、abc、123abc等。
进一步地,所述生成所述加密秘钥K 1、K 2以及K 3包括:获取所述初始秘钥的公开秘钥(PK);通过所述PK对所述初始秘钥K 0的单向加密函数(Epk)进行加密,生成所述加密秘钥K1、K2和K3。其中,所述单向加密函数(Epk)对秘钥K 0进行加密后依次迭代生成由低到高的秘钥K 1、K 2和K 3,包括:K 1=Epk(K 0),K 2=Epk(K 1),K 3=Epk(K 2)。所述RSA加密算法的公钥是(E,N),所述对所述初始秘钥的单向加密函数(Epk)加密包括:
将所述初始秘钥中任意一个明文M进行加密得到:
C=E(M)=M emod N;
将所述初始秘钥中任意的两个明文M x,M y进行同态相乘加密得到:
Figure PCTCN2020093550-appb-000003
同理,将所述初始秘钥中任意的明文M 1,M 2,…M n进行同态相乘加密得到:
E(M 1)*E(M 2)*…E(M n)=E(M 1*M 2*…M n)。
S3、当用户进行查看所述目标合同文件集时,从预先构建的解密秘钥集中选取与所述用户的查看权限对应的解密秘钥,根据所述解密秘钥将所述目标合同文件集进行解密。
本申请较佳实施例中,在上述生成加密秘钥的公开秘钥(PK)的同时生成私用秘钥(SK),通过所述SK构建所述解密秘钥集。在对所述目标合同文件集解密时,根据分配的私用秘钥SK,通过私用秘钥中的单向解密函数与对应所述单向加密函数进行解密,生成不高于自身级别的解密秘钥,通过所述解密秘钥完成对所述目标合同文件集解密,完成对低于自身级别的加密合同解密。由于所述公开秘钥体制的单向性特点,所述单向加密函数(Epk)可以加密K 0依次迭代生成由低到高的等级秘钥K 1、K 2和K 3,而单向解密函数(Dsk)可以从K 1、K 2或K 3中的某个开始,依次迭代产生由高到低的等级秘钥。例如, K 2=Epk(K 1),K 2=Dsk(K 3),K 1=Dsk(K 2)。当用户进行查看所述目标合同文件集时,从预先构建的解密秘钥集中选取与所述用户的查看权限对应的解密秘钥,根据所述解密秘钥将所述目标合同文件集进行解密。其中,对于低级别的用户在没有公开秘钥PK的情况下,将无法获取高一级的解密秘钥,从而无法解密高一级的合同文档密文;而只能根据私用秘钥SK计算得到低一级的数据解密秘钥,解密低一级的合同文档,实现所述目标合同文件集分级解密,从而恢复解密后的所述目标合同文件集。
发明还提供一种合同的加密和解密设备。参照图2所示,为本申请一实施例提供的合同的加密和解密设备1的内部结构示意图。
在本实施例中,所述合同的加密和解密设备1可以是PC(Personal Computer,个人电脑),或者是智能手机、平板电脑、便携计算机等终端设备,也可以是一种服务器等。该合同的加密和解密设备1至少包括存储器11、处理器12,通信总线13,以及网络接口14。
其中,存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁性存储器、磁盘、光盘等。存储器11在一些实施例中可以是合同的加密和解密设备1的内部存储单元,例如该合同的加密和解密设备1的硬盘。存储器11在另一些实施例中也可以是合同的加密和解密设备1的外部存储设备,例如合同的加密和解密设备1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器11还可以既包括合同的加密和解密设备1的内部存储单元也包括外部存储设备。存储器11不仅可以用于存储安装于合同的加密和解密设备1的应用软件及各类数据,例如合同的加密和解密程序01的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器11中存储的程序代码或处理数据,例如执行合同的加密和解密程序01等。
通信总线13用于实现这些组件之间的连接通信。
网络接口14可选的可以包括标准的有线接口、无线接口(如WI-FI接口),通常用于在该设备1与其他电子设备之间建立通信连接。
可选地,该设备1还可以包括用户接口,用户接口可以包括显示器(Display)、输入单元比如键盘(Keyboard),可选的用户接口还可以包括标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在合同的加密和解密设备1中处理的信息以及用于显示可视化的用户界面。
图2仅示出了具有组件11-14以及合同的加密和解密程序01的合同的加密和解密设备1,本领域技术人员可以理解的是,图1示出的结构并不构成对合同的加密和解密设备1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。
在图2所示的设备1实施例中,存储器11中存储有合同的加密和解密程序01;处理器12执行存储器11中存储的合同的加密和解密程序01时实现如下步骤:
步骤一、接收基于审核通过的合同文件集,按预设的用户查看权限对所述合同文件集中的合同文件进行保密评级并生成每个所述合同文件的加密级别信息。
本申请较佳实施例中,所述基于审核通过的合同文件集是由专业法律人员进行撰写的合同模板并由企业高层人员审核通过形成得到。其中,所述合同模板可以为劳动合同模板、买卖合同模板以及债权转让合同模板等。
较佳地,本申请中所述预设的用户查看权限通过所述合同文件集的重要程度进行设置。 详细地,本申请较佳实施例按合同文件的重要程度由低到高划分为L1、L2以及L3三个级别,得到L1合同文件集、L2合同文件集以及L3合同文件集,根据所述三个级别的合同文件集的划分完成所述合同文件集的保密评级。其中,所述L1合同文件集为企业所有员工可以查看;所述L2合同文件集为企业的部分部门可见,所述部分部门可以为法律部门、风控部门、以及人力资源部门等;所述L3合同文件集为企业的部分员工可见,所述部分员工可以为企业的CEO、CFO以及COO等。
步骤二、根据所述合同文件集中每个合同文件的加密级别信息,将所述合同文件集进行分级加密,得到目标合同文件集。
本申请较佳实施例通过获取初始秘钥,生成与所述加密级别信息对应的加密秘钥,并将所述加密级别信息对应的多种加密秘钥组成加密秘钥集合,根据所述加密秘钥集合对所述合同文件集进行分级加密,得到所述目标合同文件集,其中,所述目标合同文件集包括加密级别依次递减的机密合同文件子集、核心合同文件子集以及普通合同文件子集。详细地,所述加密秘钥指的是由低到高级别的加密秘钥K1、K2以及K3,其中,所述加密秘钥K1、K2以及K3分别对应上述L1、L2以及L3合同文件集进行加密,并按所述合同文件集级别由低到高划分为普通合同文件子集、核心合同文件子集以及机密合同文件子集。其中,所述加密秘钥K 1、K 2以及K 3由初始秘钥K 0通过公钥加密生成。较佳地,本申请所述公钥加密为半同态加密。其中,所述同态加密指的是对称加密,包括:对给定的明文(x 1,x 2,…,x n),利用同态加密算法加密后得到密文c,在所述同态加密中允许任何人对密文c进行任何操作f,操作后得到的密文f(c)解密后与f(x 1,x 2,…,x n)的结果是一样的,并在其加密过程中所述(x 1,x 2,…,x n)、f(x 1,x 2,…,x n)以及任何中间明文没有出现泄露,包括输入值、输出值、中间值一直处于加密状态中。所述半同态加密指的是非对称加密,在所述半同态加密中要求加密明文仅满足加法同态或乘法同态。较佳地,本申请将RSA加密算法所述半同态加密的算法。
较佳地,本申请中通过所述RSA加密算法对所述初始秘钥K 0进行加密生成所述加密秘钥K 1、K 2以及K 3,根据所述加密秘钥K 1、K 2以及K 3分别应用于上述L1、L2以及L3合同文件集的加密,得到所述普通合同文件集、核心合同文件集以及机密合同文件集。其中,所述初始秘钥K 0为用户设置的初始密码,所述初始密码包括数字、字母以及字符等,比如123、abc、123abc等。
进一步地,所述生成所述加密秘钥K 1、K 2以及K 3包括:获取所述初始秘钥的公开秘钥(PK);通过所述PK对所述初始秘钥K 0的单向加密函数(Epk)进行加密,生成所述加密秘钥K1、K2和K3。其中,所述单向加密函数(Epk)对秘钥K 0进行加密后依次迭代生成由低到高的秘钥K 1、K 2和K 3,包括:K 1=Epk(K 0),K 2=Epk(K 1),K 3=Epk(K 2)。所述RSA加密算法的公钥是(E,N),所述对所述初始秘钥的单向加密函数(Epk)加密包括:
将所述初始秘钥中任意一个明文M进行加密得到:
C=E(M)=M emod N;
将所述初始秘钥中任意的两个明文M x,M y进行同态相乘加密得到:
Figure PCTCN2020093550-appb-000004
同理,将所述初始秘钥中任意的明文M 1,M 2,…M n进行同态相乘加密得到:
E(M 1)*E(M 2)*…E(M n)=E(M 1*M 2*…M n)。
步骤三、当用户进行查看所述目标合同文件集时,从预先构建的解密秘钥集中选取与所述用户的查看权限对应的解密秘钥,根据所述解密秘钥将所述目标合同文件集进行解密。
本申请较佳实施例中,在上述生成加密秘钥的公开秘钥(PK)的同时生成私用秘钥 (SK),通过所述SK构建所述解密秘钥集。在对所述目标合同文件集解密时,根据分配的私用秘钥SK,通过私用秘钥中的单向解密函数与对应所述单向加密函数进行解密,生成不高于自身级别的解密秘钥,通过所述解密秘钥完成对所述目标合同文件集解密,完成对低于自身级别的加密合同解密。由于所述公开秘钥体制的单向性特点,所述单向加密函数(Epk)可以加密K 0依次迭代生成由低到高的等级秘钥K 1、K 2和K 3,而单向解密函数(Dsk)可以从K 1、K 2或K 3中的某个开始,依次迭代产生由高到低的等级秘钥。例如,K 2=Epk(K 1),K 2=Dsk(K 3),K 1=Dsk(K 2)。当用户进行查看所述目标合同文件集时,从预先构建的解密秘钥集中选取与所述用户的查看权限对应的解密秘钥,根据所述解密秘钥将所述目标合同文件集进行解密。其中,对于低级别的用户在没有公开秘钥PK的情况下,将无法获取高一级的解密秘钥,从而无法解密高一级的合同文档密文;而只能根据私用秘钥SK计算得到低一级的数据解密秘钥,解密低一级的合同文档,实现所述目标合同文件集分级解密,从而恢复解密后的所述目标合同文件集。
可选地,在其他实施例中,合同的加密和解密装置100还可以被分割为一个或者多个模块,一个或者多个模块被存储于存储器11中,并由一个或多个处理器(本实施例为处理器12)所执行以完成本申请,本申请所称的模块是指能够完成特定功能的一系列计算机程序指令段,用于描述合同的加密和解密程序01在合同的加密和解密装置100中的执行过程。
例如,参照图3所示,为本申请合同的加密和解密装置100一实施例中的合同的加密和解密装置100框架图,该实施例中,所述合同的加密和解密装置100可以被分割为保密评级模块10、分级加密20以及分级解密模块30示例性地:
所述保密评级模块10用于:接收基于审核通过的合同文件集,按预设的用户查看权限对所述合同文件集中的各合同文件进行保密评级并生成每个所述合同文件的加密级别信息。
所述分级加密模块20用于:根据所述合同文件集中每个合同文件的加密级别信息,将所述合同文件集进行分级加密,得到目标合同文件集,所述目标合同文件集包括具有不同加密级别的多个目标合同文件子集,加密级别与用户查看权限相对应。
所述分级解密模块30用于:接收合同文件查看请求,所述合同文件查看请求包括用户查看权限,从预先构建的解密秘钥集中选取与所述用户查看权限对应的解密秘钥,根据所述解密秘钥将所述目标合同文件集中与所述合同文件查看请求对应的合同文件进行解密。
上述保密评级模块10、分级加密模块20以及分级解密模块30等程序模块被执行时所实现的功能或操作步骤与上述实施例大体相同,在此不再赘述。
此外,本申请实施例还提出一种计算机可读存储介质,所述计算机可读存储介质可以是非易失性,也可以是易失性。所述计算机可读存储介质上存储有合同的加密和解密程序01,所述合同的加密和解密程序01可被一个或多个处理器12执行,以实现如下操作:
接收基于审核通过的合同文件集,按预设的用户查看权限对所述合同文件集中的各合同文件进行保密评级并生成每个所述合同文件的加密级别信息;
根据所述合同文件集中每个合同文件的加密级别信息,将所述合同文件集进行分级加密,得到目标合同文件集,所述目标合同文件集包括具有不同加密级别的多个目标合同文件子集,加密级别与用户查看权限相对应;
接收合同文件查看请求,所述合同文件查看请求包括用户查看权限,从预先构建的解密秘钥集中选取与所述用户查看权限对应的解密秘钥,根据所述解密秘钥将所述目标合同文件集中与所述合同文件查看请求对应的合同文件进行解密。
本申请计算机可读存储介质具体实施方式与上述合同的加密和解密装置和方法各实 施例基本相同,在此不作累述。
需要说明的是,上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。并且本文中的术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种合同的加密和解密方法,其中,所述方法包括:
    接收审核通过的合同文件集,按预设的用户查看权限对所述合同文件集中的各合同文件进行保密评级并生成每个所述合同文件的加密级别信息;
    根据所述合同文件集中每个合同文件的加密级别信息,将所述合同文件集进行分级加密,得到目标合同文件集,所述目标合同文件集包括具有不同加密级别的多个目标合同文件子集,加密级别与用户查看权限相对应;
    接收合同文件查看请求,所述合同文件查看请求包括用户查看权限,从预先构建的解密秘钥集中选取与所述用户查看权限对应的解密秘钥,根据所述解密秘钥将所述目标合同文件集中与所述合同文件查看请求对应的合同文件进行解密。
  2. 如权利要求1所述的合同的加密和解密方法,其中,所述将所述合同文件集进行分级加密,得到目标合同文件集包括:
    获取初始秘钥,生成与所述加密级别信息对应的加密秘钥,并将所述加密级别信息对应的多种加密秘钥组成加密秘钥集合;
    根据所述加密秘钥集合对所述合同文件集进行分级加密,得到所述目标合同文件集,其中,所述目标合同文件集包括加密级别依次递减的机密合同文件子集、核心合同文件子集以及普通合同文件子集。
  3. 如权利要求2所述的合同的加密和解密方法,其中,所述获取初始秘钥,生成与所述加密级别信息对应的加密秘钥包括:
    获取所述初始秘钥的公开秘钥,通过所述公开秘钥对所述初始秘钥的单向加密函数进行加密,以生成与所述加密级别信息对应的加密秘钥,其中,所述单向加密函数对秘钥K 0进行加密后依次迭代生成由低到高的秘钥K 1、K 2和K 3
  4. 如权利要求3所述的合同的加密和解密方法,其中,所述对所述初始秘钥的单向加密函数进行加密包括:
    将所述初始秘钥中任意一个明文M进行加密得到:
    C=E(M)=M emod N,其中,E(M)表示加密后的明文M,e表示无限不循环小数,mod N表示加密次数;
    将所述初始秘钥中任意的两个明文M x,M y进行同态相乘加密得到:
    Figure PCTCN2020093550-appb-100001
    其中,E(M x)表示加密后的明文M x,E(M y)表示加密后的明文M y
    将所述初始秘钥中任意的明文M 1,M 2,…M n进行同态相乘加密得到:
    E(M 1)*E(M 2)*…E(M n)=E(M 1*M 2*…M n)。
  5. 如权利要求1至4中任意一项所述的合同的加密和解密方法,其中,所述从预先构建的解密秘钥集中选取与所述用户查看权限对应的解密秘钥包括:
    获取预先分配的与所述用户查看权限对应的私用秘钥;
    根据所述私用秘钥中的单向解密函数解密对应的单向加密函数,以生成与所述用户查看权限对应的解密秘钥,其中,所述单向解密函数根据上述单向加密函数依次迭代产生由高到低的等级秘钥。
  6. 如权利要求1所述的合同的加密和解密方法,其中,所述合同模板包括劳动合同模板、买卖合同模板以及债权转让合同模板。
  7. 如权利要求1所述的合同的加密和解密方法,其中,所述预设的用户查看权限按合同文件的重要程度由低到高划分为L1、L2以及L3三个级别,得到L1合同文件集、L2合同文件集以及L3合同文件集,根据所述三个级别的合同文件集的划分完成所述合同文件集的保密评级;
    其中,所述L1合同文件集为企业所有员工可见;所述L2合同文件集为企业的部分部门可见;所述L3合同文件集为企业的部分员工可见。
  8. 一种合同的加密和解密装置,其中,包括:
    保密评级模块,用于接收审核通过的合同文件集,按预设的用户查看权限对所述合同文件集中的各合同文件进行保密评级并生成每个所述合同文件的加密级别信息;
    分机加密模块,用于根据所述合同文件集中每个合同文件的加密级别信息,将所述合同文件集进行分级加密,得到目标合同文件集,所述目标合同文件集包括具有不同加密级别的多个目标合同文件子集,加密级别与用户查看权限相对应;
    分机解密模块,用于接收合同文件查看请求,所述合同文件查看请求包括用户查看权限,从预先构建的解密秘钥集中选取与所述用户查看权限对应的解密秘钥,根据所述解密秘钥将所述目标合同文件集中与所述合同文件查看请求对应的合同文件进行解密。
  9. 一种合同的加密和解密设备,其中,所述设备包括存储器和处理器,所述存储器上存储有可在所述处理器上运行的合同的加密和解密程序,所述合同的加密和解密程序被所述处理器执行时实现如下步骤:
    接收审核通过的合同文件集,按预设的用户查看权限对所述合同文件集中的各合同文件进行保密评级并生成每个所述合同文件的加密级别信息;
    根据所述合同文件集中每个合同文件的加密级别信息,将所述合同文件集进行分级加密,得到目标合同文件集,所述目标合同文件集包括具有不同加密级别的多个目标合同文件子集,加密级别与用户查看权限相对应;
    接收合同文件查看请求,所述合同文件查看请求包括用户查看权限,从预先构建的解密秘钥集中选取与所述用户查看权限对应的解密秘钥,根据所述解密秘钥将所述目标合同文件集中与所述合同文件查看请求对应的合同文件进行解密。
  10. 如权利要求9所述的合同的加密和解密设备,其中,所述述将所述合同文件集进行分级加密,得到目标合同文件集包括:
    获取初始秘钥,生成与所述加密级别信息对应的加密秘钥,并将所述加密级别信息对应的多种加密秘钥组成加密秘钥集合;
    根据所述加密秘钥集合对所述合同文件集进行分级加密,得到所述目标合同文件集,其中,所述目标合同文件集包括加密级别依次递减的机密合同文件子集、核心合同文件子集以及普通合同文件子集。
  11. 如权利要求10所述的合同的加密和解密设备,其中,所述获取初始秘钥,生成与所述加密级别信息对应的加密秘钥包括:
    获取所述初始秘钥的公开秘钥,通过所述公开秘钥对所述初始秘钥的单向加密函数进行加密,以生成与所述加密级别信息对应的加密秘钥,其中,所述单向加密函数对秘钥K 0进行加密后依次迭代生成由低到高的秘钥K 1、K 2和K 3
  12. 如权利要求11所述的合同的加密和解密设备,其中,所述对所述初始秘钥的单向加密函数加密包括:
    将所述初始秘钥中任意一个明文M进行加密得到:
    C=E(M)=M emod N,其中,E(M)表示加密后的明文M,e表示无限不循环小数,mod N表示加密次数;
    将所述初始秘钥中任意的两个明文M x,M y进行同态相乘加密得到:
    Figure PCTCN2020093550-appb-100002
    其中,E(M x)表示加密后的明文M x,E(M y)表示加密后的明文M y
    将所述初始秘钥中任意的明文M 1,M 2,…M n进行同态相乘加密得到:
    E(M 1)*E(M 2)*…E(M n)=E(M 1*M 2*…M n)。
  13. 如权利要求8至12中任意一项所述的合同的加密和解密设备,其中,所述从预 先构建的解密秘钥集中选取与所述用户查看权限对应的解密秘钥包括:
    获取预先分配的与所述用户查看权限对应的私用秘钥;
    根据所述私用秘钥中的单向解密函数解密对应的单向加密函数,以生成与所述用户查看权限对应的解密秘钥,其中,所述单向解密函数根据上述单向加密函数依次迭代产生由高到低的等级秘钥。
  14. 如权利要求9所述的合同的加密和解密设备,其中,所述合同模板包括劳动合同模板、买卖合同模板以及债权转让合同模板。
  15. 一种计算机可读存储介质,其中,所述计算机可读存储介质上存储有合同的加密和解密程序,所述合同的加密和解密程序可被一个或者多个处理器执行,以实现如权利要求1至7中任一项所述的合同的加密和解密方法的步骤:
    接收审核通过的合同文件集,按预设的用户查看权限对所述合同文件集中的各合同文件进行保密评级并生成每个所述合同文件的加密级别信息;
    根据所述合同文件集中每个合同文件的加密级别信息,将所述合同文件集进行分级加密,得到目标合同文件集,所述目标合同文件集包括具有不同加密级别的多个目标合同文件子集,加密级别与用户查看权限相对应;
    接收合同文件查看请求,所述合同文件查看请求包括用户查看权限,从预先构建的解密秘钥集中选取与所述用户查看权限对应的解密秘钥,根据所述解密秘钥将所述目标合同文件集中与所述合同文件查看请求对应的合同文件进行解密。
  16. 如权利要求15所述的计算机可读存储介质,其中,所述将所述合同文件集进行分级加密,得到目标合同文件集包括:
    获取初始秘钥,生成与所述加密级别信息对应的加密秘钥,并将所述加密级别信息对应的多种加密秘钥组成加密秘钥集合;
    根据所述加密秘钥集合对所述合同文件集进行分级加密,得到所述目标合同文件集,其中,所述目标合同文件集包括加密级别依次递减的机密合同文件子集、核心合同文件子集以及普通合同文件子集。
  17. 如权利要求16所述的计算机可读存储介质,其中,所述获取初始秘钥,生成与所述加密级别信息对应的加密秘钥包括:
    获取所述初始秘钥的公开秘钥,通过所述公开秘钥对所述初始秘钥的单向加密函数进行加密,以生成与所述加密级别信息对应的加密秘钥,其中,所述单向加密函数对秘钥K 0进行加密后依次迭代生成由低到高的秘钥K 1、K 2和K 3
  18. 如权利要求17所述的计算机可读存储介质,其中,所述对所述初始秘钥的单向加密函数进行加密包括:
    将所述初始秘钥中任意一个明文M进行加密得到:
    C=E(M)=M emod N,其中,E(M)表示加密后的明文M,e表示无限不循环小数,mod N表示加密次数;
    将所述初始秘钥中任意的两个明文M x,M y进行同态相乘加密得到:
    Figure PCTCN2020093550-appb-100003
    其中,E(M x)表示加密后的明文M x,E(M y)表示加密后的明文M y
    将所述初始秘钥中任意的明文M 1,M 2,…M n进行同态相乘加密得到:
    E(M 1)*E(M 2)*…E(M n)=E(M 1*M 2*…M n)。
  19. 如权利要求15至18中任意一项所述的计算机可读存储介质,其中,所述从预先构建的解密秘钥集中选取与所述用户查看权限对应的解密秘钥包括:
    获取预先分配的与所述用户查看权限对应的私用秘钥;
    根据所述私用秘钥中的单向解密函数解密对应的单向加密函数,以生成与所述用户查看权限对应的解密秘钥,其中,所述单向解密函数根据上述单向加密函数依次迭代产生由 高到低的等级秘钥。
  20. 如权利要求15所述的计算机可读存储介质,其中,所述合同模板包括劳动合同模板、买卖合同模板以及债权转让合同模板。
PCT/CN2020/093550 2020-01-09 2020-05-29 合同的加密和解密方法、装置、设备及存储介质 WO2021139075A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010024090.3 2020-01-09
CN202010024090.3A CN111259435A (zh) 2020-01-09 2020-01-09 合同的加密和解密方法、装置及计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2021139075A1 true WO2021139075A1 (zh) 2021-07-15

Family

ID=70950313

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/093550 WO2021139075A1 (zh) 2020-01-09 2020-05-29 合同的加密和解密方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN111259435A (zh)
WO (1) WO2021139075A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112769868A (zh) * 2021-02-07 2021-05-07 深圳市欧瑞博科技股份有限公司 通信方法、装置、电子设备及存储介质
CN113792324B (zh) * 2021-11-16 2022-04-05 聊城高新生物技术有限公司 基于联邦学习的农产品数据交互方法、装置及电子设备
CN114239081A (zh) * 2022-02-25 2022-03-25 华中科技大学同济医学院附属协和医院 一种业务凭证处理方法、系统及电子设备
CN116090028B (zh) * 2023-04-07 2023-08-04 深圳天谷信息科技有限公司 可配置保密等级的电子合同管理方法、装置、设备及介质
CN116089986B (zh) * 2023-04-07 2023-08-25 深圳天谷信息科技有限公司 可配置保密策略的电子文档管理方法、装置、设备及介质
CN117390646A (zh) * 2023-10-23 2024-01-12 上海合见工业软件集团有限公司 一种集成电路源文件加密方法、电子设备及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101938497A (zh) * 2010-09-26 2011-01-05 深圳大学 多级保密文档组结构及其文件访问控制和密钥管理用户终端、服务终端、系统和方法
CN109614792A (zh) * 2018-11-29 2019-04-12 中国电子科技集团公司第三十研究所 一种分级文件密钥管理方法
CN110502918A (zh) * 2019-07-09 2019-11-26 杭州电子科技大学 一种基于分级安全加密的电子文件访问控制方法和系统

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101938497A (zh) * 2010-09-26 2011-01-05 深圳大学 多级保密文档组结构及其文件访问控制和密钥管理用户终端、服务终端、系统和方法
CN109614792A (zh) * 2018-11-29 2019-04-12 中国电子科技集团公司第三十研究所 一种分级文件密钥管理方法
CN110502918A (zh) * 2019-07-09 2019-11-26 杭州电子科技大学 一种基于分级安全加密的电子文件访问控制方法和系统

Also Published As

Publication number Publication date
CN111259435A (zh) 2020-06-09

Similar Documents

Publication Publication Date Title
WO2021139075A1 (zh) 合同的加密和解密方法、装置、设备及存储介质
US11146541B2 (en) Hierarchical data access techniques using derived cryptographic material
US10425223B2 (en) Multiple authority key derivation
US9882883B2 (en) Method and system for securing communication
US9872067B2 (en) Source identification for unauthorized copies of content
US9172533B2 (en) Method and system for securing communication
US10320765B2 (en) Method and system for securing communication
US11790106B1 (en) Methods for protecting data
CN104079574A (zh) 云环境下基于属性和同态混合加密的用户隐私保护方法
El Bouchti et al. Encryption as a service for data healthcare cloud security
US20120131351A1 (en) Managing access to a secure digital document
Babel et al. Bringing data minimization to digital wallets at scale with general-purpose zero-knowledge proofs
CN110889121A (zh) 防止数据泄露的方法、服务器及存储介质
Thilakanathan et al. Secure multiparty data sharing in the cloud using hardware-based TPM devices
US11343080B1 (en) System and method for data privacy and authentication
Setiawan et al. Design of secure electronic disposition applications by applying blowfish, SHA-512, and RSA digital signature algorithms to government institution
US11997191B2 (en) System and method for protecting secret data items using multiple tiers of encryption and secure element
WO2019178981A1 (zh) 自定义规则密码管理方法、装置、终端设备及存储介质
Devassy Research Project Questions
TW201032084A (en) System for managing the external access of electronic file and method of the same
EP2680486A1 (en) Key management
Gajghate et al. Secure Document Sharing and Access Control on Cloud for Corporate User
Saurabh et al. EXPLORING THE APPLICATION AND DIFFERENT ALGORITHMS OF DATA ENCRYPTION
Jain ClOud CrypTOgraphy TO EnsurE sECurITy and prIVaCy In ClOud
EP3557469A1 (en) System, method and computer program for secure data exchange

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

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

Country of ref document: EP

Kind code of ref document: A1