A multi-dimensional key mixing symmetric key encryption and decryption method for multi-users
Patent Information
- Application Number
- CN202311057025.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-22
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2043-08-22
AI Technical Summary
这类信息数据在传递过程中和消费活动结束后,容易被截获、收集,进而成为不法人员实现信息渗透的有效手段
[0023]本发明同现有技术相比,针对在非安全环境中的信息传递、发布,对具有安全需求的信息进行一定的加密处理,使得信息在传递过程中被截获或者信息载体废弃后,加载的信息依然不容易被没有对应权限的用户所读取。
Smart Images

Figure CN116915491B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data encryption and decryption technology, specifically a multi-dimensional key hybrid symmetric key encryption and decryption method for multiple users. Background Technology
[0002] In real life, to achieve a certain degree of information sharing among stakeholders, some data that should be protected by security is directly published in an unencrypted manner. For example, we are already accustomed to seeing receipts and waybills. These documents not only contain information such as the name, quantity, and amount of the purchased or delivered product, but some also contain personal privacy information such as the user's name, address, and phone number. This type of data is easily intercepted and collected during transmission and after the transaction, thus becoming an effective means for criminals to infiltrate information networks.
[0003] Currently, in similar information security scenarios, unencrypted methods are used for data transmission and publication. There is a lack of a convenient method for encrypting and decrypting information data that can be used only by designated personnel or those with permissions, and that has content scope boundaries. Summary of the Invention
[0004] To overcome the shortcomings of existing technologies, this invention provides a multi-dimensional key hybrid symmetric key encryption and decryption method for multiple users.
[0005] To achieve the above objectives, a multi-dimensional key hybrid symmetric key encryption and decryption method for multiple users is designed, characterized by the following steps:
[0006] S1, for the same piece of transmitted and published information data, divides it into several different permission quadrants according to the permissions of different users;
[0007] S2, organize and encode according to the permission quadrant, generate permission quadrant data table, and perform verification calculation on the data of each quadrant to generate verification value;
[0008] S3. A key is randomly generated for each quadrant, which serves as the symmetric key for the data in that quadrant. This key is then used to perform symmetric key encryption on the original data.
[0009] S4, Enter the single-user key P for different users. x And set the auxiliary key P n ;
[0010] S5, Calculate and generate the key length value N for each permission quadrant. y and Euler's totient function value
[0011] S6, determine the coprime integer e that can be shared, and the coprime integer e and the Euler totient function values in each quadrant. All are coprime;
[0012] S7, Calculate the modulo inverse element value d in each quadrant. y ;
[0013] S8, the symmetric key used for hybrid encryption in each quadrant is modulo inverse element value d. y Calculate the power value for the power, then divide by the key length value N. y The remainder is used as the encryption value of the symmetric key for the data in each quadrant.
[0014] The single-user key P x P is a prime number that is not less than the maximum value of the unit data to be transmitted or published. n The key must be no less than the single-user key P used in the current encryption / decryption calculation. x The prime number with the largest value.
[0015] The key length value N y The calculation method is to calculate all single-user keys P within this quadrant. x With auxiliary key P n The product of the products, the Euler totient function value The calculation method is to calculate all single-user keys P within this quadrant. x The value of -1 and the auxiliary key P n The product of -1 values.
[0016] The range of values for the shared coprime integer e is:
[0017] In step S7, the modular inverse element value d y The calculation method is as follows:
[0018] When encrypted information data is published or transmitted, the content includes a common coprime integer e, symmetric encrypted data for each permission quadrant, symmetric key encryption value, and verification value.
[0019] It also includes step S9, in which, during single-user decryption, the encrypted values of the symmetric keys in each quadrant are read, the coprime integers to the power of e are calculated, and the result is divided by the single-user key. The remainder is used as the decrypted symmetric key, and then the symmetric key is used to perform decryption calculations on the encrypted data to form the decrypted data.
[0020] It also includes step S10, which verifies the data after decryption in each quadrant according to the data verification algorithm and compares the data verification values. If the verification and comparison are consistent, the data decryption is successful; if the verification is inconsistent, the data decryption fails.
[0021] It also includes step S11, which decodes the decrypted data and allows each user to obtain information data within their authorized scope.
[0022] The symmetric key encryption operation method in step S3 includes, but is not limited to, one or more of the following symmetric encryption operations: XOR, modular addition, modular multiplication, DES, or 3DES.
[0023] Compared with existing technologies, this invention addresses the transmission and dissemination of information in insecure environments by encrypting information with security requirements. This ensures that even if the information is intercepted during transmission or the information carrier is discarded, the loaded information is still not easily read by users without the corresponding permissions. Attached Figure Description
[0024] Figure 1 This is a schematic diagram of the multi-user permission quadrant in Embodiment 1 of the present invention.
[0025] Figure 2 This is a schematic diagram of the multi-user permission quadrant and content in step S1 of embodiment one of the present invention.
[0026] Figure 3 This refers to the multi-user permission quadrant data and verification table in step S2 of embodiment one of the present invention.
[0027] Figure 4 This refers to the multi-user permission quadrant symmetric key encryption data table in step S3 of embodiment one of the present invention.
[0028] Figure 5 This is a table of multi-user permission quadrant key length values and Euler's totient function values in step S5 of embodiment one of the present invention.
[0029] Figure 6 This is a table of coprime integers and modular inverse elements shared by multiple user permission quadrants in steps S6 and S7 of Embodiment 1 of the present invention.
[0030] Figure 7 This is the table of encrypted data groups in step S8 of embodiment one of the present invention.
[0031] Figure 8 This is a table for publishing and transmitting encrypted information data, as described in Embodiment 1 of the present invention.
[0032] Figure 9 This is the multi-dimensional key decryption data table in steps S9 and S10 of Embodiment 1 of the present invention. Detailed Implementation
[0033] The present invention will now be further described with reference to the accompanying drawings.
[0034] The information security of multi-user permissions in this invention refers to granting users with different permissions corresponding to the information data content based on the different user's permission scope for information data, with content boundaries. In the transmission and publication of information in insecure environments, information with security requirements is encrypted to a certain extent, so that even if the information is intercepted during transmission or the information carrier is discarded, the loaded information is still not easily read by users without the corresponding permissions.
[0035] For the same transmitted and published information data, this embodiment takes the permissions of three different users, A, B, and C, as an example to provide a multi-dimensional key encryption and decryption method for multiple users, including the following steps: where A is the consumer, B is the seller, and C is the logistics service provider.
[0036] S1, for the same piece of transmitted and published information data, can be divided into 7 different permission quadrants according to the permissions of three users, such as... Figure 1 As shown.
[0037] S2, as Figures 2 to 3 As shown, the data is organized and encoded according to permission quadrants to generate a permission quadrant data table. During information transmission, the information data in the diagram is encrypted so that users other than those with the specified permissions cannot read the data. Once the users with the specified permissions receive the encrypted data, they can decrypt it and read the information data within their authorized scope. That is, user A can read... Figure 2 Information data numbered 1, 2, 3, and 5 can be read by user B, while information data numbered 1, 2, 4, and 6 can be read by user C. Information data numbered 1, 3, 4, and 7 cannot be read by users outside their authorized access range.
[0038] Furthermore, this embodiment demonstrates the use of data accumulation method to perform data verification calculation and generate a verification value. The verification value is 1 byte long, so that the data content can be verified after data decryption.
[0039] S3, a symmetric key is randomly generated for each quadrant, and this key is used to perform symmetric encryption operations on the original data, such as... Figure 4 As shown, the symmetric encryption operation method in this embodiment uses the XOR operation.
[0040] S4, Enter the single-user key P for different users. x And set the auxiliary key P n P x In this example, 'x' represents the sequence number of each user participating in the current encryption / decryption calculation. To increase the security parameters for mutual decomposition between users, an auxiliary key P is added when generating the password length parameters for each quadrant. n This participates in the generation of the density length parameters for each quadrant. In this embodiment, the number of single users is 3, namely PA P B P C In this embodiment, P A =1187; P B =1163, P C =1109, P n =2129.
[0041] S5, such as Figure 5 As shown, calculate the key length value N for each permission quadrant. y and Euler's totient function value
[0042] S6, such as Figure 6 As shown, determine the coprime integers e that can be shared, and the coprime integers e and the Euler totient function values in each quadrant. All are coprime.
[0043] S7, Calculate the modulo inverse element value d in each quadrant. y ;
[0044] S8, such as Figure 7 As shown, the symmetric key values in each quadrant are modulo inverse element values d. y Calculate the power value for the power, then divide by the key length value N. y The remainder is used as the symmetric key encryption value for each quadrant.
[0045] Single user key P x P is a prime number that is not less than the maximum value of the unit data to be transmitted or published; that is, when the original data is in single-byte units. x Requires a value greater than 255; P n The single-user key and auxiliary key must be prime numbers that are not less than the maximum value of the single-user key used in the current encryption / decryption calculation. When the data to be transmitted or published has high security requirements, the single-user key and auxiliary key can be very large prime numbers. In the same encryption / decryption operation, the single-user key and auxiliary key are independent and unique.
[0046] Key length value N y The calculation method is to calculate all single-user keys P within this quadrant. x With auxiliary key P n The product of the products, the Euler totient function value The calculation method is to calculate all single-user keys P within this quadrant. x The value of -1 and the auxiliary key P n The product of -1 values.
[0047] The range of values for the shared coprime integer e is:
[0048] In step S6, the modular inverse element value d y The calculation method is as follows:
[0049] When encrypted information is published or transmitted, the content includes a shared coprime integer e and symmetric encrypted data for each permission quadrant, symmetric key encryption value, and check value. Users can decrypt the encrypted data using their own single-user key to obtain the original encrypted data.
[0050] like Figures 8 to 9 As shown, after receiving multi-dimensional key encrypted transmission data, authorized users perform decryption calculations based on the coprime function value and their own single-user key, and determine the data's correctness by comparing checksums. Specifically, during single-user decryption, the symmetric key encryption values for each quadrant are read, the coprime integer to the power of e is calculated, and this value is divided by the single-user key. The remainder is used as the decrypted symmetric key, which is then used to decrypt the encrypted data. The data after decryption calculations in each quadrant is then checked against the data verification algorithm. If the verification matches, the data decryption is successful; otherwise, it fails. Finally, the decrypted data is decoded, and each user obtains the information data within their authorized scope.
[0051] The principle of the multi-dimensional key encryption and decryption algorithm of this invention is demonstrated as follows:
[0052] In the multi-dimensional key encryption and decryption method of this invention, the following parameters mainly exist, which can be respectively attributed to the key and the encryption / decryption operation:
[0053] P x A single-user key must be a prime number not less than the value of the encrypted data. The single-user keys of different users participating in encrypting the same set of published and transmitted data must be independent and unique.
[0054] P n Auxiliary key: An optional parameter, which must be a prime number not less than the value of the single-user key. It is recommended to use an auxiliary key when transmitting or publishing data through insecure communication channels to increase the difficulty of deducing the key from the source.
[0055] N: Key length value, which is the product of all single-user keys involved in data encryption and decryption and the auxiliary key (when selected). That is, when there are three single-user keys (P... A P B P C ) participates in data encryption and decryption operations, and selects an auxiliary key (P n When N = P A *P B *P C *P n ;
[0056] The Euler's totient function value of the key length. Assume the key length is three single-user keys (P...). A P B P C ) and auxiliary key (P n When multiplying the single-user key and the auxiliary key, since both are prime numbers, the Euler totient function value is...
[0057] e: a coprime integer, and For coprime integers, the range of values is:
[0058] d: e relative to The modular inverse element, namely:
[0059] m: Original data. When the amount of original data is large (e.g., strings) or the value is large (e.g., integers, long integers, floating-point numbers, double precision), it can usually be split into multiple consecutive single-byte arrays, with each single byte having a value of 0 ≤ m ≤ 255;
[0060] c: Encrypted data.
[0061] The data encryption formula in the multi-dimensional key encryption / decryption method of this patent is as follows:
[0062] m d ≡c (mod N)
[0063] That is, the method for calculating encrypted data c is to raise the original data value m to the power of d (modular inverse element), divide by N (key length value) and take the remainder.
[0064] The algorithm principle underlying this patent's multi-dimensional key encryption and decryption method is as follows:
[0065] c e ≡m(mod P x )
[0066] That is, the calculation method for data decryption is to raise the encrypted data value c to the power of e (a coprime integer), divided by P. x (Single-user key) Modulo operation.
[0067] The decryption calculation principle of this algorithm will now be demonstrated. If the decryption is proven to be correct, then the multi-dimensional key encryption and decryption method of this invention is valid.
[0068] According to encryption algorithm m d ≡c(mod N), this equation can be transformed into:
[0069] c + k * N = m d
[0070] Note: Let k be a positive integer.
[0071] c = m d -k*N
[0072] Substitute this formula into the decryption algorithm c e ≡m(mod P x In ), then:
[0073] (m d -k*N) e ≡m(mod P x )
[0074] Since N is P x For positive integer multiples of N, after splitting the polynomial on the left side of the equation, every term that has a k*N term can be P. x Divisible by integer, so after removing k*N terms, it can be simplified to:
[0075] m e*d ≡m(mod P x )
[0076] Since d is relative to e The modular inverse element, namely: but:
[0077]
[0078] Note: Let h be a positive integer.
[0079] Substituting into the previous equation:
[0080]
[0081] That is: when the equation At the time of its establishment, the multi-dimensional key encryption and decryption algorithm of this patent was correct.
[0082] Since the value of N is the product of multiple prime numbers greater than m, N and m must be coprime. According to Euler's theorem, the equation... If true, then:
[0083]
[0084] Note: Let k be a positive integer.
[0085] Since the equation remains an equation with values of the same power on both sides, that is:
[0086]
[0087] After splitting the right side of the equation, all terms containing k*N are divisible by N, so it can be transformed into:
[0088]
[0089]
[0090] Since m<N, after multiplying both sides of the equation by m, the equation still holds:
[0091]
[0092]
[0093] Since N is P x a positive integer multiple, the equation can be written as:
[0094]
[0095] Note: k' is a positive integer.
[0096] Since P x >m, it follows that:
[0097]
[0098] Therefore, the multi-key encryption and decryption algorithm of the present patent holds true.
[0099] Several other concepts related to the multi-dimensional key encryption and decryption algorithm in the present invention are described as follows:
[0100] 1. Permission quadrants and shared coprime integers. In the multi-dimensional key encryption and decryption algorithm, a plurality of data quadrants exclusively for a single user or shared by multiple users are divided according to different user permissions for transmitting and publishing information. For a single user, the quadrant data to which the user has permission all need to be encrypted with the participation of the single-user key. Only the key involved in encryption can successfully decrypt the data.
[0101] Since the data to be transmitted and published involves multiple quadrants at the same time, the method of "shared coprime integer" is adopted to set the coprime integer used for decryption in each quadrant to the same value, which can reduce the transmission of decryption parameters and improve the efficiency of decryption operation.
[0102] 2. Key value range and data confidentiality requirements. When the encrypted data can be split in units of single bytes, the encrypted data (stream) can be split into a single-byte array, and each byte in the array is used as an encryption element to be encrypted and decrypted separately. Therefore, the single-user key generally adopts a prime number greater than 255.
[0103] When the data to be encrypted has high confidentiality requirements, an extra-large prime number can be set. For example, by using a single-user key and an auxiliary key that are extra-large prime numbers of more than 384 (or more) binary bits, so that the key length value reaches a level that cannot be factorized by current computer programs, the security of the transmitted and published information can be guaranteed to a certain extent.
[0104] 3. Explanation of the differences between the multi-key encryption / decryption algorithm and the RSA algorithm: Both the multi-key encryption / decryption algorithm and the RSA algorithm originate from Euler's theorem, and there are many similarities in their principle demonstrations. However, they also have many differences: RSA is an asymmetric data encryption / decryption algorithm, where the public key used for encryption and the private key used for decryption are completely different; in the multi-key encryption / decryption algorithm, the encryption key is generated by multiple single-user keys, and each single-user key is used for decryption, thus it is not an asymmetric key algorithm. The RSA algorithm is for data encryption and decryption of a single user; the multi-key encryption / decryption algorithm is for data encryption and decryption of multiple users' data permissions in parallel, and the information permission boundaries of each user can be set separately.
[0105] This invention combines multidimensional key algorithms with symmetric key encryption. The symmetric key encrypts the original data, and the multidimensional algorithm then encrypts this key. During decryption, the multidimensional key algorithm decrypts the key, and the decrypted key is used to calculate the decryption of the original data. The purpose of this approach is twofold: First, multidimensional key encryption involves extremely large power operations, resulting in lengthy computation times. While encrypting and decrypting a single byte individually may not take much time, it adds tens or hundreds of times the time compared to ordinary symmetric encryption algorithms. When the amount of encrypted data is large, the encryption and decryption times become extremely long. Second, multidimensional key encryption produces very large data volumes. Encrypting data byte-by-byte could result in data that is ten or even tens of times larger than the original data, posing a significant challenge for data transmission and distribution. This embodiment simplifies the computation and improves efficiency by combining multidimensional key algorithms with symmetric key encryption.
Claims
1. A multi-dimensional key hybrid symmetric key encryption and decryption method for multiple users, characterized in that: Includes the following steps: S1, for the same piece of transmitted and published information data, divides it into several different permission quadrants according to the permissions of different users; S2, organize and encode according to the permission quadrant, generate permission quadrant data table, and perform verification calculation on the data of each quadrant to generate verification value; S3. A key is randomly generated for each quadrant, which serves as the symmetric key for the data in that quadrant. This key is then used to perform symmetric key encryption on the original data. S4, Enter the single-user key for different users. and set an auxiliary key ; S5, Calculate and generate the key length value for each permission quadrant. and Euler's totient function value ; S6, determine the coprime integers that can be shared. Coprime integers Euler totient function values in each quadrant All are coprime; S7, Calculate the modulo inverse element values for each quadrant. ; S8, the symmetric key used for hybrid encryption in each quadrant is modulo inverse element value. Calculate the power value for the power, then divide by the key length value. The remainder is used as the encryption value of the symmetric key for the data in each quadrant; S9, during single-user decryption, reads the symmetric key encryption values of each quadrant and calculates coprime integers. The result is raised to the power of ... The key length value The calculation method is to use all single-user keys within this quadrant. With auxiliary key The product of the products, the Euler totient function value The calculation method is to use all single-user keys within this quadrant. Values and auxiliary keys The product of the values; The aforementioned permission quadrant refers to a data quadrant that is exclusively accessible to a single user or shared by multiple users.
2. The method for multi-user, multi-dimensional key hybrid symmetric key encryption and decryption according to claim 1, characterized in that: The single-user key A prime number that is not less than the maximum value of the unit data to be transmitted or published. The key must be no less than the single-user key used in the current encryption / decryption calculation. The prime number with the largest value.
3. The method for multi-user, multi-dimensional key hybrid symmetric key encryption and decryption according to claim 1, characterized in that: The coprime integers The range of values is .
4. The method for multi-user, multi-dimensional key hybrid symmetric key encryption and decryption according to claim 1, characterized in that: In step S7, the modular inverse element value The calculation method is as follows: .
5. The method for multi-user, multi-dimensional key hybrid symmetric key encryption and decryption according to claim 1, characterized in that: When encrypted information is published or transmitted, the content includes coprime integers. And the symmetric encrypted data, symmetric key encryption value, and verification value for each permission quadrant.
6. The method for multi-user, multi-dimensional key hybrid symmetric key encryption and decryption according to claim 1, characterized in that: It also includes step S10, which verifies the data after decryption in each quadrant according to the data verification algorithm and compares the data verification values. If the verification and comparison are consistent, the data decryption is successful; if the verification is inconsistent, the data decryption fails.
7. A multi-dimensional key hybrid symmetric key encryption and decryption method for multiple users according to claim 1 or 6, characterized in that: It also includes step S11, which decodes the decrypted data and allows each user to obtain information data within their authorized scope.
8. The method for multi-user, multi-dimensional key hybrid symmetric key encryption and decryption according to claim 1, characterized in that: The symmetric key encryption operation method in step S3 includes one or more of the following: XOR, modular addition, modular multiplication, DES, and 3DES symmetric encryption operations.
Citation Information
Patent Citations
Cloud password security management method, system and device and storage medium
CN115765987A
Encryption method, decryption method, and key management method
JP2009049731A
