Document encryption and decryption methods based on Lagrangian key sharing

Through the Lagrangian key sharing method, the original key of the document is used as the constant term of the Lagrangian interpolation formula to generate multiple sub-keys and store them randomly. This solves the problems of high computing resource consumption and high security risks of key sharing in the existing technology, and achieves improved key security and decryption efficiency.

CN116032467BActive Publication Date: 2025-09-23SHANGHAI UNIVISTA IND SOFTWARE GRP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211668861.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-21
Publication Date
2025-09-23
Estimated Expiration
2042-12-21

AI Technical Summary

Technical Problem

In existing encryption algorithms, there is only one copy of the secret key, which consumes a lot of computing resources during backup and poses high security risks. The existing secret key sharing method consumes too much computing resources.

Method used

The Lagrange key sharing method is adopted. The original key is used as the constant term of the Lagrange interpolation formula. Multiple sub-keys are generated through XOR operation and randomly stored in multiple directories. XOR operation is used for encryption to reduce computing resource consumption.

Benefits of technology

It realizes random storage of secret keys to prevent key loss or accidental deletion, improves the security of documents, and quickly and efficiently decrypts through XOR operations, reducing computing resource consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116032467B_ABST
    Figure CN116032467B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of encryption technology, and in particular to an encryption method and a decryption method based on Lagrangian key sharing. The encryption method comprises the following steps: using the original key of a document as a constant term of a preset Lagrangian interpolation formula f(x), sequentially generating N-1 seed keys according to a preset initial subkey and f(x), thereby achieving the purpose of storing the original key in N subkeys respectively; copying each subkey of the document and R1 respectively by M times to obtain subkeys of N×M documents, thereby preventing the keys from being lost or accidentally deleted; traversing a specified directory range to obtain a total number U of directories, and randomly storing the subkeys of the N×M documents in U directories, thereby further achieving random sharing of keys and simultaneously preventing multiple subkeys of the same type from being lost or accidentally deleted, thereby improving the security of the document and reducing computing resource consumption through an exclusive-or encryption operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of encryption technology, and in particular to an encryption method and a decryption method based on Lagrange key sharing. Background Art

[0002] Document encryption is a basic requirement in current information security. Currently, encryption algorithms are divided into symmetric encryption and asymmetric encryption, such as the DES encryption algorithm, IDEA encryption algorithm, GOST encryption algorithm, and RC4 encryption algorithm. The disadvantage of these encryption algorithms is that they only have one copy of the secret key. Even if multiple keys are backed up, the contents of all backed up keys are the same. Once one key is leaked, it is equivalent to the leakage of all keys, posing a high security risk.

[0003] Currently, a commonly used method for key sharing is to perform a first type of arithmetic operation on the original key to obtain the first sub-key. This sub-key is then subjected to a second type of arithmetic operation to obtain the second sub-key. This is repeated over and over again until X sub-keys are obtained. These X sub-keys are then stored in different terminals, resulting in multiple copies of the sub-keys. However, the arithmetic operations used in this key sharing method consume a lot of computer resources. Summary of the Invention

[0004] In order to solve the above technical problems, the present invention adopts a technical solution: an encryption method based on Lagrangian key sharing, which includes:

[0005] S100, obtaining the original secret key Key of the document, where the original secret key Key is the constant term in the preset Lagrange interpolation formula f(x).

[0006] S200, obtain the initial sub-key R1 of Key, and generate N-1 seed keys R={R2,...R i-1 ,R i …,R N}, R i-1 is the i-1th seed key of Key, R i is the i-th seed key of Key, and the value of i ranges from 2 to N; among them, R i Satisfaction: R i =f(R i-1 )⊕R1, where f(R i-1 ) is the i-1th basic secret key generated according to f(x), and ⊕ is the XOR operator symbol.

[0007] S300: Copy each sub-key of Key in R and R1 into M copies, and obtain N×M sub-keys.

[0008] S400, traverse the specified directory range to obtain the total number of directories U, and satisfy U ≥ N × M; randomly store N × M sub-keys in U directories.

[0009] On the other hand, an embodiment of the present invention further provides a document decryption method based on Lagrangian key sharing, the decryption method comprising:

[0010] S10, the decryption end receives the Lagrange interpolation formula f′(x) containing unknown parameters and the initial sub-key R1 sent by the encryption end.

[0011] S20, traverse the specified directory range to obtain L sub-keys, the L sub-keys include K seed keys, the K seed keys constitute a sub-key set, where K ≥ N / 2, N is the number of sub-key types generated by the encryption end.

[0012] S30, recover the basic keys corresponding to the K seed keys according to R1, where the jth subkey R in the subkey set is j The corresponding basic secret key f(R j ), f(R j )satisfy:

[0013] f(R j )=R j ⊕R1.

[0014] S40, calculate the unknown parameters in f′(x) based on the obtained K basic secret keys, and obtain the Lagrange interpolation formula f(x) of the encryption end, where the constant term of f(x) is the original secret key Key obtained by decryption.

[0015] The present invention has significant advantages over the prior art. By utilizing the above-mentioned technical solution, the data processing system provided by the present invention can achieve considerable technological advancement and practicality, and has wide industrial application value. It has at least the following advantages:

[0016] First, the present invention provides a document encryption method based on Lagrangian key sharing. The encryption method uses the original key of the document as the constant term of a preset Lagrangian interpolation formula f(x), and generates N-1 seed keys in sequence according to the preset initial sub-key and f(x). This method can achieve the purpose of storing the original key in N sub-keys respectively, and can reduce the consumption of computing resources by encrypting through an XOR operation; each sub-key of the document and R1 are copied M times to obtain N×M sub-keys of the document, which can prevent the key from being lost or accidentally deleted; traverse the specified directory range to obtain the total number of directories U, and randomly store the sub-keys of the N×M documents in U directories, which can further achieve random sharing of the key and can simultaneously prevent multiple sub-keys of the same type from being lost or accidentally deleted, thereby improving the security of the document.

[0017] Second, the present invention provides a document decryption method based on Lagrangian key sharing. The decryption method receives the Lagrangian interpolation formula f′(x) containing unknown parameters and the initial sub-key R1 sent by the encryption end, traverses the specified directory range to obtain K seed keys to obtain a sub-key set, and restores the basic keys corresponding to the K seed keys according to R1; restores the Lagrangian interpolation formula f(x) according to the K basic keys and obtains the original key Key. This decryption method can quickly and effectively decrypt the document to ensure the security of the document. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0019] Figure 1 A flowchart of an encryption method based on Lagrangian key sharing provided by an embodiment of the present invention;

[0020] Figure 2 A flowchart of a decryption method based on Lagrangian key sharing provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0021] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present invention.

[0022] Example 1

[0023] See also Figure 1 , Figure 1 A flowchart of an encryption method based on Lagrangian key sharing is shown. The method includes:

[0024] Next steps:

[0025] S100, obtaining the original key of the document, where the original key is the constant term in the preset Lagrange interpolation formula f(x).

[0026] Among them, the original key of the document is the complete key.

[0027] Among them, the preset Lagrange interpolation formula is:

[0028] f(x)=∑ n i=1 b i (x-a1)…(xa i-1 )(xa i+1 )…(xa n+1 ) / (a-a1)…(aa i-1 )(aa i )…(aa n+1 )

[0029] The constant term after expanding f(x) is the original secret key, and the original secret key is used as the constant term in the Lagrange interpolation formula, where the parameter b i ,a,a1,…,a i-1 , a i+1 ,…,a n+1 is assigned a definite value, so f(x) is a definite curve equation.

[0030] S200, obtain the initial sub-key R1 of Key, and generate N-1 seed keys R={R2,...R i-1 ,R i …,R N}, R i-1 is the i-1th seed key of Key, R i is the i-th seed key of Key, and the value of i ranges from 2 to N; among them, R i Satisfaction: R i =f(R i-1 )⊕R1, where f(R i-1 ) is the i-1th base key generated from f(x), and ⊕ is the XOR operator. XOR encryption can be used to encrypt the base key, and XOR encryption solves the problem of excessive computing resource consumption caused by arithmetic operations in existing encryption techniques.

[0031] It is understood that when the original secret key is different, the corresponding sub-secret key generated is different. Multiple identical or different original secret keys can be generated in one system.

[0032] Optionally, the initial subkey R1 of the original key Key is a specified value. As a preferred embodiment, the initial subkey R1 of Key is a random initial value.

[0033] It is understandable that when x=R i-1 When calculating f(R i-1 ) to obtain the basic secret key. According to the basic secret key f(R i-1 ) and the initial sub-key R1 of the original secret key Key can be further obtained by the XOR operation R iThen R i As a variable of f(x), calculate f(R i ), and then according to f(R i ) and R1 to calculate R i+1 , and so on, to obtain all the sub-keys. It should be noted that the number N of sub-keys is a preset value.

[0034] As a preferred embodiment, the N seed keys composed of R1 and R respectively have corresponding category identifiers Tag = {Tag1, Tag2, ..., Tag i ,…,Tag N}, Tag i is the i-th seed key R i The decryption end uses the category identifier to determine whether the number of collected sub-keys meets the decryption requirements.

[0035] It should be noted that during decryption, at least N / 2 subkey types are required to recover the original key. This method stores the original key in different subkeys, and each subkey is not a complete key. Leaking one or fewer than N / 2 keys will not result in the original key being compromised. This significantly reduces the risk of leaking the original key if any one key is compromised, compared to existing techniques where multiple backups of a single key are used, thus improving document security.

[0036] S300: Copy each sub-key of Key in R and R1 into M copies, and obtain N×M sub-keys.

[0037] It should be noted that the initial subkey R1 of the initial key Key and the N-1 subkeys generated based on R1 are collectively used as the N subkeys of the original key. The step of copying the same M subkeys of each type of subkey can prevent the loss of the key caused by the deletion of a 5-key, thereby enhancing the robustness of the key.

[0038] S400, traverse the specified directory range to obtain the total number of directories U, and satisfy U ≥ N × M; randomly store the sub-keys of N × M keys into U directories.

[0039] Optionally, the specified directory range can be a directory range selected by the user based on their needs. Typically, directories on the server that are not easily deleted by other users or applications are selected. Optionally, the specified directory range can also be the entire disk storage.

[0040] As a preferred embodiment, the specified directory range is the system directory and its first-level, second-level, or multiple-level subdirectories; or the root directory and its first-level, second-level, or multiple-level subdirectories. By specifying the directory range as the system directory or the root directory, traversal and storage efficiency can be improved compared to full disk storage.

[0041] It should be noted that randomly storing sub-keys in different sub-directories can further prevent key leakage and enhance document security.

[0042] 5 Furthermore, there can be multiple original keys. Each original key is generated into multiple sub-keys through steps S100-S300 and copied to obtain multiple copies. Then, the sub-keys of each original key are randomly stored according to S400. Optionally, multiple sub-keys corresponding to the same original key are randomly stored in different directories within a specified directory range. Within a preset time period, the sub-keys of different original keys are stored in different directories. As a preferred embodiment, each directory within the specified directory range has

[0043] At least one subkey is stored in the same directory, and any two subkeys stored in the same directory belong to subkeys of different original keys. As a preferred embodiment, the step of randomly storing N×M subkeys in U directories includes:

[0044] S410: Number each directory according to the order of the traversed directories.

[0045] S420, when U ≥ H0, the directory number CON of the randomly assigned i+1th sub-key i+1 satisfy:

[0046] CON i+1 =A0×CON i mod H0

[0047] Among them, A0 is the preset constant, H0 is the maximum value of the total number of preset directories, CON i is the directory number of the randomly assigned subkey 5, and mod is the modulo operator.

[0048] It should be noted that CON iThe random initial value CON0 is the server timestamp. When the preset value of A0 is 48271 and the preset value of H0 is 2147483647, the randomness of the randomly generated directory number sequence is optimal. The formula in S420 is also called a linear congruential generator. A random directory number sequence can be generated by the linear congruential generator, and each target number is the position where the corresponding sub-key needs to be placed. The sub-keys are assigned to the corresponding directory numbers in a preset order. The preset order can be the order in which the sub-keys are generated, the order in which they are rearranged after being copied, or another order specified by the user.

[0049] As a preferred embodiment, the step S410 further includes:

[0050] S430, when U<H0, CON i+1 satisfy:

[0051] CON i+1 =A0×CON i mod U

[0052] When the total number of directories U actually traversed is less than the maximum value H0 of the preset total number of directories, the value of the modulus in the linear congruential generator is adjusted according to the total number of directories actually traversed U to prevent the randomly generated numbers from overflowing to non-existent directory numbers.

[0053] It is understandable that when directory numbers are randomly assigned to multiple sub-keys of an original key each time the directory is traversed, the sub-keys of each original key need to traverse all directories within the directory range when storing them, allowing sub-keys of different original keys to be stored in the same directory.

[0054] As a preferred embodiment, when multiple subkeys corresponding to an original key initiate storage requests within the same time period, the Q subkeys of the original key are randomly assigned corresponding directory numbers in sequence according to S420 or S430, where 2≤Q≤W, and W is the maximum preset number of original keys to be stored in each traversal. Storing the Q subkeys of the original key only requires traversing all directories within the directory range once, which improves the efficiency of traversing and storing subkeys.

[0055] It should be noted that generating random directory numbers through steps S410-S420 or S410-S430 can disrupt the order of the sub-keys and randomly select different directories for storage, thereby randomly storing N×M sub-keys of an original key in a specified directory, preventing the key from being leaked, and preventing the key from being accidentally deleted, maintaining robustness, and improving the security of the document.

[0056] In summary, the present invention provides a document encryption method based on Lagrangian key sharing, in which the original key of the document is used as the constant term of the preset Lagrangian interpolation formula f(x), and N-1 seed keys are generated in sequence according to the preset initial sub-key and f(x), which can achieve the purpose of storing the original key in N sub-keys respectively; each sub-key of the document and R1 are copied M times to obtain N×M sub-keys of the document, which can prevent the key from being lost or accidentally deleted; the specified directory range is traversed to obtain the total number of directories U, and the sub-keys of the N×M documents are randomly stored in U directories, which can further achieve random sharing of keys and can simultaneously prevent multiple sub-keys of the same type from being lost or accidentally deleted, thereby improving the security of the document.

[0057] Based on the same inventive concept as the above encryption method, an embodiment of the present invention also provides a matching decryption method.

[0058] Example 2

[0059] See also Figure 2 , which shows a document decryption method based on Lagrangian key sharing provided by an embodiment of the present invention

[0060] Flowchart, the decryption method includes:

[0061] S10, the decryption end receives the Lagrange interpolation formula f′(x) containing unknown parameters and the initial sub-key R1 sent by the encryption end.

[0062] It should be noted that the parameters in f′(x): b i ,a,a1,…,a i-1 , a i+1 ,…,a n+1 Unknown. Sent by the encryption end

[0063] Compared to f(x) on the encryption side, f′(x) has the same functional form, and f′(x) is equivalent to a public key. The difference between f′(x) and the Lagrangian formula f(x) in Example 1 is that the parameters in f′(x) are unknown and are parameters to be decrypted.

[0064] The initial sub-key R1 is the same as the R1 of the encryption end in the first embodiment.

[0065] S20, traverse the specified directory range to obtain L sub-keys, the L sub-keys include K seed keys, the K seed keys constitute a sub-key set, where K ≥ N / 2, N is the number of sub-key types generated by the encryption end.

[0066] It should be noted that the specified directory range traversed in S20 is the same as the range of storage keys specified in S400 of the first embodiment. As a preferred embodiment, the specified directory range is the directory range sent by the encryption end when sending f'(x) and R1.

[0067] The range is a directory range specified in advance between the encryption end and the decryption end. All sub-keys transmitted by the encryption end and the decryption end are stored in the specified directory range.

[0068] The L subkeys obtained through traversal may include multiple subkeys of the same type. If the number of key types contained in the L subkeys is less than N / 2, decryption cannot be completed.

[0069] 5 It can be understood that from the Lagrange interpolation formula, when N / 2 seed keys are obtained, the original key can be restored.

[0070] Since the original key is broken up into multiple sub-keys, even if some types of sub-fragments are hijacked, the original key cannot be restored without a recovery formula. Therefore, this decryption process can reduce the risk of sub-keys being hijacked.

[0071] S30, recover the base keys corresponding to the K seed keys according to R1, where the jth subkey in the subkey set is

[0072] R j The corresponding basic secret key f(R j-1 ), f(R j-1 ) satisfies: f(R j-1 )=R j ⊕R1.

[0073] 0, ⊕ is the exclusive OR operation, for R j After the XOR operation, f(R j ) is restored. As can be seen from Example 1:

[0074] The j-th sub-key R generated on the encryption side j Satisfaction: R j =f(R j-1 )⊕R1, on the decryption side, R j Perform XOR operation again, then we have: R j ⊕R1=f(R j-1 )⊕R1⊕R1=f(R j-1 ), that is, recover the corresponding basic secret key f(R j-1 ).

[0075] It should be noted that during the decryption process, only a simple XOR operation is required to decrypt, which reduces resource consumption and solves the problem of computing resource consumption at the decoding end.

[0076] 5S40, calculate the unknown parameters in f′(x) based on the obtained K basic secret keys, and obtain the Lagrange interpolation formula of the encryption end

[0077] Formula f(x), where the constant term of f(x) is the original secret key obtained by decryption.

[0078] In summary, Example 2 provides a document decryption method based on Lagrangian key sharing. The decryption method receives the Lagrangian interpolation formula f′(x) containing unknown parameters and the initial sub-key R1 sent by the encryption end, traverses the specified directory range to obtain K seed keys to obtain a sub-key set, and restores the basic keys corresponding to the K seed keys according to R1; restores the Lagrangian interpolation formula f(x) according to the K basic keys and obtains the original key Key. This decryption method can quickly and effectively decrypt and ensure the security of the document.

[0079] Although some specific embodiments of the present invention have been described in detail by way of example, it will be understood by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It will also be understood by those skilled in the art that various modifications may be made to the embodiments without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.

Claims

1. The encryption method based on Lagrangian key sharing is characterized by: The method comprises: S100, obtaining the original secret key Key of the document, wherein the original secret key Key is the constant term in the preset Lagrange interpolation formula f(x); the original secret key is a complete secret key; S200, obtain the initial sub-key R1 of Key, and generate N-1 seed keys R={R2,…R i-1 ,R i …,R N }, R i-1 is the i-1th seed key of Key, R i is the i-th seed key of Key, and the value of i ranges from 2 to N; among them, R i Satisfaction: R i =f(R i-1 )⊕R1, where f(R i-1 ) is the i-1th basic secret key of Key generated according to f(x), ⊕ is the XOR operator symbol; S300: Copy each subkey of Key in R and R1 M times to obtain N×M subkeys. S400, traverse the specified directory range to obtain the total number of directories U, and satisfy U ≥ N × M; randomly store N × M sub-keys in U directories.

2. The encryption method according to claim 1, wherein: The step of randomly storing N×M sub-keys into U directories includes: S410, numbering each directory according to the order of the traversed directories; S420, when U ≥ H0, the directory number CON of the randomly assigned i+1th sub-key i+1 satisfy: WITH i+1 =A0×CON i mod H0 Among them, A0 is the preset constant, H0 is the maximum value of the total number of preset directories, CON i is the directory number of the randomly assigned i-th subkey, and mod is the modulo operator.

3. The encryption method according to claim 2, wherein: After S410, the following steps are further included: S430, when U<H0, CON i+1 satisfy: CON i+1 =A0×CON i mod U。 4. The encryption method according to claim 2 or 3, characterized in that: When multiple sub-keys corresponding to the original key initiate storage requests within the same time period, the Q sub-keys of the original key are randomly assigned corresponding directory numbers in sequence, where 2≤Q≤W, and W is the maximum preset number of original keys stored in each traversal.

5. The encryption method according to claim 1, wherein: The specified directory range is the system directory of the system directory and the first-level, second-level or multi-level subdirectories under the system directory; or the root directory and the first-level, second-level or multi-level subdirectories under the root directory.

6. The encryption method according to claim 1, wherein: The initial sub-key R1 of the Key is a random initial value.

7. The encryption method according to claim 1, wherein: Within the specified directory range, at least one subkey is stored in each directory, and any two subkeys stored in the same directory are subkeys of different original keys.

8. The encryption method according to claim 1, wherein: The N seed keys composed of R1 and R have corresponding category identifiers Tag={Tag1, Tag2,…, Tag i ,…,Tag N }, Tag i is the i-th seed key R i Category identifier.

9. The document decryption method based on Lagrangian key sharing is characterized in that: The decryption method comprises: S10, the decryption end receives the Lagrange interpolation formula f´(x) containing unknown parameters and the initial sub-key R1 sent by the encryption end; S20, traverse the specified directory range to obtain L subkeys, where the L subkeys include K seed keys, and the K seed keys constitute a subkey set, where K ≥ N / 2, where N is the number of subkey types generated by the encryption end; S30, recover the basic keys corresponding to the K seed keys according to R1, where the jth subkey R in the subkey set is j The corresponding basic secret key f(R j-1 ), f(R j-1 ) satisfies: f(R j-1 )=R j ⊕R1; S40, calculating the unknown parameters in f´(x) based on the obtained K basic secret keys, and obtaining the Lagrange interpolation formula f(x) of the encryption end, where the constant term of f(x) is the original secret key Key obtained by decryption.

10. The decryption method according to claim 9, characterized in that: The specified directory range is the directory range sent by the encryption end when sending f´(x) and R1, or the directory range specified in advance between the encryption end and the decryption end. All sub-keys transmitted by the encryption end and the decryption end are stored in the specified directory range.

Citation Information

Patent Citations

  • Method for separately storing and recovering (K, N) meaningful images based on triple backup

    CN104702814A

  • Method of assigning member secret information, method of key agreement using the assigned secret information, and method of member authentication using the assigned secret information

    KR1020050116425A