Identity-based encryption method and system, electronic equipment and storage medium
By using new preimage sampling technology and aspherical Gaussian sampling technology in the identity-based encryption algorithm, the problem of high decryption error rate caused by noise introduced by the sampling algorithm is solved, and the efficiency and security of the encryption algorithm are improved.
Patent Information
- Application Number
- CN202410762356.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2024-09-06
AI Technical Summary
When the lattice-based encryption algorithm is applied to the identity-based encryption algorithm, the decryption error rate is high due to the approximate noise introduced by the sampling algorithm, and it cannot be decrypted correctly.
Using new pre-image sampling technology and aspherical Gaussian sampling technology, smaller noise is introduced when generating user private keys, reducing the decryption error rate, and improving the efficiency and security of the encryption algorithm.
Through the new private key generation method, the decryption error rate is reduced, the efficiency and security of the identity-based encryption algorithm are improved, and it is suitable for identity-based encryption applications.
Smart Images

Figure CN118606972A
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of information security technology, and in particular relates to an identity-based encryption method, system, electronic equipment and storage medium. Background Art
[0002] Shor's quantum algorithm can completely crack public key cryptographic algorithms such as RSA and ECDSA based on large number decomposition, discrete logarithm, and elliptic curve group structure in polynomial time. Quantum computers based on ion traps and superconductors are developing rapidly, and it is urgent to design "post-quantum cryptography" algorithms that resist quantum attacks. Post-quantum public key cryptography mainly includes five technical directions: lattice-based, coding, multivariable equations, curve homology, and hash signatures. Among them, lattice cryptography has the best comprehensive performance. Although the existing most space-efficient sampling algorithm on the ideal lattice can be used to design efficient digital signature algorithms, it cannot be used to directly design identity-based encryption algorithms because the approximate noise introduced by the sampling algorithm will cause the decryption error rate to be too high and cannot be correctly decrypted.
[0003] Identity-based cryptographic algorithms can effectively solve the key management problem in public key cryptographic algorithms based on public key infrastructure (PKI). By using the user's identity as the public key, there is no need for complex certificate exchange and management, making the security system easier to deploy and use, and more suitable for Internet applications. The SM9 algorithm is a commercial identity-based algorithm standard independently developed by my country. It has high security and simple key management, but the difficult problems it relies on at the bottom cannot resist quantum attacks. Summary of the invention
[0004] The main purpose of the present invention is to provide an identity-based encryption method, system, computer device and storage medium, which solves the problem that when a lattice-based encryption algorithm is applied to an identity-based encryption algorithm, the approximate noise introduced by the sampling algorithm will lead to a high decryption error rate and cannot be correctly decrypted.
[0005] To achieve the above object, the technical solution adopted by the present invention is:
[0006] In a first aspect, the present invention discloses an identity-based encryption method, comprising the steps of:
[0007] Step 1: Generate the master public key mpk and the master private key msk after initialization;
[0008] Step 2: Use the master private key msk to generate any user identity id∈{0,1} * Generate private key sk id ;
[0009] Step 3: Encrypt the plaintext μ∈{0,1} using the master public key mpk and user identity id;
[0010] Step 4: Use the private key sk id Decrypt the ciphertext ct to restore the plaintext.
[0011] Preferably, the step 1 specifically comprises the steps of:
[0012] Step 1.1: Let the matrix Among them I n represents the n-th order identity matrix, Represents an integer The ring modulo Q, n is a positive integer, Q = p·q is the modulus, p and q are two positive integers, express On the n×2n matrix, yes Each element of the n-order square matrix on Uniform random distribution on ;
[0013] Step 1.2: Let b be an integer, Construction tool matrix in represents the tensor product, f t =p·[1,b,…,b w-1 ] represents the transpose of the vector f, and selects the trapdoor matrix Each element of the matrix follows a sub-Gaussian distribution with parameter η. Where m = (2 + w) n;
[0014] Step 1.3: Order represents the covariance matrix of the approximate original image, where Be two real numbers, let
[0015]
[0016] represents the covariance matrix of the disturbance vector p, where σ represents the smooth parameter of G-lattice;
[0017] Judgment∑ p Is it a positive definite matrix? If ∑ p If positive, execute step 1.4. If ∑ p If it is not positive definite, return to step 1.2 and repeat until Σ p is a positive definite matrix;
[0018] Step 1.4: Let the check matrix A = [I n |A'], output the master public key mpk=A', the master private key msk=R.
[0019] Preferably, the step 2 specifically comprises the steps of:
[0020] Step 2.1: Calculation in represents a collision-resistant hash function, n-dimensional integer column vector representing the modulus Q;
[0021] Step 2.2: Sample the perturbation vector Represents an m-dimensional integer vector space Σ p is the discrete Gaussian distribution of the covariance matrix, where represents the Gaussian function, Represents the Gaussian function In m-dimensional integer vector space The sum of
[0022] Step 2.3: Order Calculate the target vector in Indicates the nearest integer operation, and then in the coset of G-lattice According to the discrete Gaussian distribution Sampling is performed to obtain the target vector z, where σ = b·r represents the smoothness parameter of G-lattice, and r represents the m-dimensional integer vector space The smoothing parameter of
[0023] Step 2.4: Calculation And discard the first n components of x to get the vector
[0024] Step 2.5: Output x' as the private key sk of user id id .
[0025] Preferably, the step 3 specifically comprises the steps of:
[0026] Step 3.1: Select Each of its components follows a sub-Gaussian distribution with parameter η';
[0027] Step 3.2: Calculation
[0028] Step 3.3: Output ct = (c0, c1) as the ciphertext of plaintext μ.
[0029] Preferably, the step 4 specifically comprises the steps of:
[0030] Step 4.1: Calculation
[0031] Step 4.2: If Output 1; otherwise, output 0.
[0032] In a second aspect, the present invention discloses an identity-based encryption system, characterized in that it includes:
[0033] An initial generation module, the initial generation module is used to generate a master public key mpk and a master private key msk after initialization;
[0034] A private key generation module is used to generate a private key for any user identity id∈{0,1} using the master private key msk * Generate private key sk id ;
[0035] An encryption module, the encryption module is used to encrypt the plaintext μ∈{0,1} using the master public key mpk and the user identity id;
[0036] Decryption module, the decryption module is used to use the user's private key sk id Decrypt the ciphertext to restore the plaintext.
[0037] In a third aspect, the present invention discloses a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned method when executing the program.
[0038] In a fourth aspect, the present invention discloses a computer-readable storage medium having a computer program stored thereon, wherein the program is executed by a processor to implement the method as described above.
[0039] Compared with the prior art, the identity-based encryption method, system, electronic device and storage medium of the present invention have at least the following beneficial effects:
[0040] 1. The present invention uses a new original image sampling technology in the process of calculating the private key for the user, because it introduces less noise and is therefore more suitable for the design of identity-based encryption algorithms.
[0041] 2. The identity-based encryption algorithm designed by the present invention in combination with the aspheric Gaussian sampling technology in [] has higher efficiency and security. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A schematic diagram of a flow chart of an identity-based encryption method of the present invention;
[0043] Figure 2 It is a schematic diagram of the structure of the identity-based encryption system of the present invention;
[0044] Figure 3 This is a circuit module connection diagram of the computer device of the present invention.
[0045] In the figure: 101, initial generation module; 102, private key generation module; 103, encryption module; 104, decryption module.
[0046] 300, bus; 301, receiver; 302, processor; 303, transmitter; 304, memory; 306, bus interface. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0048] Embodiment 1
[0049] This embodiment combines Figure 1 The flowchart of illustrates how identity-based encryption methods are used in practical applications. In this demonstration scenario, the key generation center KGC generates a private key for the receiver R, the sender S uses the identity ID of the receiver R to encrypt the plaintext μ, and the receiver R decrypts the ciphertext with its own private key after receiving it. The specific process is as follows:
[0050] Step 1: The key generation center KGC generates the master public key mpk and the master private key msk:
[0051] This step specifically includes:
[0052] Step 1.1: Let the matrix Among them I n represents the n-th order identity matrix, yes Each element of the n-order square matrix on A uniform random distribution on a, where Q = p·q is the modulus, p and q are two positive integers, Represents an integer Rings modulo Q, where n is a positive integer representing the security parameter, express The n×2n matrix on .
[0053] Step 1.2: Let b be an integer, That is, integer q = b w Is the power of b; construct tool matrix in represents the tensor product, f t =p·[1,b,…,b w-1 ] represents the transpose of vector f; select the trapdoor matrix Each element of the matrix follows a sub-Gaussian distribution with parameter η. Where m = (2 + w)·n.
[0054] Step 1.3: Order represents the covariance matrix of the approximate original image, where Be two real numbers, let
[0055]
[0056] represents the covariance matrix of the disturbance vector p, where σ represents the smooth parameter of G-lattice;
[0057] Judgment∑ p Is it a positive definite matrix? If ∑ p is a positive definite matrix, then execute step 1.4. If ∑ p If it is not positive definite, repeat step 1.2 until Σ p is a positive definite matrix.
[0058] Step 1.4: Let the check matrix A = [I n |A'], output the master public key mpk=A', the master private key msk=R.
[0059] Step 2: The key generation center KGC uses the master public key mpk and the master private key msk to generate a private key sk for the identity identifier id of the receiver R id The specific steps include:
[0060] Step 2.1: Calculation in represents a collision-resistant hash function, n-dimensional integer column vector representing the modulus Q.
[0061] Step 2.2: Sample the perturbation vector Represents an m-dimensional integer vector space Σ p is the discrete Gaussian distribution of the covariance matrix, where represents the Gaussian function, Represents the Gaussian function In m-dimensional integer vector space The specific sampling method of this step is as follows:
[0062] Step 2.2.1: Let matrix C represent the matrix Σ p -I m Cholesky decomposition, CC t =Σ p -I m ;
[0063] Step 2.2.2: Let the vector Each component y i Obey standard normal distribution;
[0064] Step 2.2.3: Calculate y'=Cy=(y'1,…,y' m );
[0065] Step 2.2.4: For i=1,…,m, take y' i Centered on The smooth parameter r is the Gaussian parameter, and discrete Gaussian sampling is performed on Z to obtain the integer p i ;
[0066] Step 2.2.5: Let p = (p1,…,p m ).
[0067] Step 2.3: Order Calculate the target vector in Indicates the nearest rounding operation; then in the coset of G-lattice According to the discrete Gaussian distribution Sampling is performed to obtain the target vector z, where σ = b·r represents the smoothness parameter of G-lattice, and r represents the m-dimensional integer vector space The smoothing parameter.
[0068] Among them, the specific steps of G-lattic upsampling are as follows:
[0069] (1) Order
[0070] (2) For i = 1, ..., n, the sampling vector Satisfy t ·z i =v i mod q, the specific steps are:
[0071] (2.1) For j = 1, ..., w, sampling And update v i The value of
[0072] (2.2) Order
[0073] (3) Let z = (z1,…,z n ).
[0074] Step 2.4: Calculation And discard the first n components of x to get the vector
[0075] Step 2.5: Output x' as the private key sk of user id id .
[0076] Step 3: The sender S uses the identity id of the receiver R to encrypt the plaintext μ∈{0,1}:
[0077] Step 3.1: Select Each of its components obeys a sub-Gaussian distribution with parameter η'.
[0078] Step 3.2: Calculation
[0079] Step 3.3: Output ct = (c0, c1) as the ciphertext of plaintext μ.
[0080] Step 4: The receiver R uses the private key sk id Encrypt the ciphertext ct:
[0081] Step 4.1: Calculation
[0082] Step 4.2 If Output 1; otherwise, output 0. It should be noted that for the convenience of description, only one bit is output here: 1 or 0; under normal circumstances, hundreds of bits are generally output, which can be achieved by repeating the above process hundreds of times.
[0083] Compared with existing technologies, we have the following advantages:
[0084] (1) The present invention uses a new pre-image sampling technology in the process of calculating the private key for the user, which is a generalization of the existing sampling technology, provides more flexible parameter selection, and provides a compromise solution for security and key size.
[0085] (2) The present invention further combines the aspherical Gaussian sampling technology, which can reduce the size of the Gaussian parameter as a whole, thereby reducing the Euclidean norm of the user's private key and reducing the decryption error rate.
[0086] (3) Under the same security, the present invention uses smaller parameters, thereby improving space efficiency and time efficiency.
[0087] (4) The key technology of the present invention can also be applied to other lattice cryptographic applications, such as identity-based signature, attribute-based encryption, etc., which can improve space efficiency and time efficiency.
[0088] Embodiment 2
[0089] See also Figure 2 , corresponding to the first embodiment, this embodiment discloses a primary image Gaussian sampling system, which includes:
[0090] Initial generation module 101, the initial generation module 101 is used to generate a master public key mpk and a master private key msk after initialization;
[0091] The private key generation module 102 is used to generate a private key for any user identity id∈{0,1} using the master private key msk * Generate private key sk id ;
[0092] The encryption module 103 is used to encrypt the plaintext μ∈{0,1} using the master public key mpk and the user identity id;
[0093] Decryption module 104, decryption module 104 is used to use the user private key sk id Decrypt the ciphertext to restore the plaintext.
[0094] The above four steps are used to respectively execute the four implementation steps of the first embodiment.
[0095] The original image Gaussian sampling system of this embodiment is used to execute and implement the identity-based encryption method of the first embodiment, so this embodiment will not elaborate on it.
[0096] Embodiment 3
[0097] See also Figure 3 This embodiment discloses a computer device, which includes a memory 304, a processor 302, and a computer program stored in the memory and executable on the processor, wherein the processor 302 implements the steps of the method described in the first embodiment when executing the program.
[0098] Further, in Figure 3 In the embodiment, the present invention also includes a bus architecture (represented by bus 300), which can include any number of interconnected buses and bridges, and bus 300 links various circuits including one or more processors represented by processor 302 and memory represented by memory 304. Bus 300 can also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. Bus interface 306 provides an interface between bus 300 and receiver 301 and transmitter 303. Receiver 301 and transmitter 303 can be the same element, namely a transceiver, providing a unit for communicating with various other devices on a transmission medium. Processor 302 is responsible for managing bus 300 and general processing, while memory 304 can be used to store data used by processor 302 when performing operations.
[0099] Embodiment 4
[0100] This embodiment provides a computer-readable storage medium on which a computer program is stored. The program is executed by a processor to implement the method described in the first embodiment.
[0101] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0102] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0103] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0104] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0105] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0106] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. An identity-based encryption method, It is characterized in that Includes steps: Step 1: Generate the master public key mpk and the master private key msk after initialization; Step 2: Use the master private key msk to generate any user identity id∈{0,1} * Generate private key sk id ; Step 3: Encrypt the plaintext μ∈{0,1} using the master public key mpk and user identity id; Step 4: Using the private key Sk id Decrypt the ciphertext ct to restore the plaintext.
2. The identity-based encryption method of claim 1, It is characterized in that The step 1 specifically includes the following steps: Step 1.1: Let the matrix Among them I n represents the n-th order identity matrix, Represents an integer The ring modulo Q, n is a positive integer, Q = p·q is the modulus, p and q are two positive integers, express On the n×2n matrix, yes Each element of the n-order square matrix on Uniform random distribution on ; Step 1.2: Let b be an integer, Construction Tool Matrix in represents the tensor product, f t =p·[1, b, ..., b w-1 ] represents the transpose of the vector f, and selects the trapdoor matrix Each element follows a sub-Gaussian distribution with parameter η, let the check matrix A = Where m = (2 + w) n; Step 1.3: Order represents the covariance matrix of the approximate original image, where Be two real numbers, let represents the covariance matrix of the disturbance vector p, where σ represents the smooth parameter of G-lattice; Judgment∑ p Is it a positive definite matrix? If ∑ p If positive, execute step 1.
4. If ∑ p If it is not positive definite, return to step 1.2 and repeat until ∑ p is a positive definite matrix; Step 1.4: Let the check matrix A = [I n |A′], output the master public key mpk=A′, the master private key msk=R.
3. The identity-based encryption method of claim 2, It is characterized in that The step 2 specifically includes the following steps: Step 2.1: Calculation in represents a collision-resistant hash function, n-dimensional integer column vector representing the modulus Q; Step 2.2: Sample the perturbation vector Represents an m-dimensional integer vector space The discrete Gaussian distribution with ∑p as the covariance matrix, where represents the Gaussian function, Represents the Gaussian function In m-dimensional integer vector space The sum of Step 2.3: Let g t =[1, b, ..., b w-1 ], Calculate the target vector in Indicates the nearest integer operation, and then in the coset of G-lattice According to the discrete Gaussian distribution Sampling is performed to obtain the target vector z, where σ = b·r, r represents the m-dimensional integer vector space The smoothing parameter of Step 2.4: Calculation And discard the first n components of x to get the vector Step 2.5: Output x′ as the private key sk of user id id .
4. The identity-based encryption method of claim 3, It is characterized in that The step 3 specifically includes the following steps: Step 3.1: Select Each of its components follows a sub-Gaussian distribution with parameter η′; Step 3.2: Calculation Step 3.3: Output ct = (c 0 , c 1 ) as the ciphertext of plaintext μ.
5. The identity-based encryption method of claim 4, It is characterized in that The step 4 specifically includes the steps of: Step 4.1: Calculation Step 4.2: If Output 1; Otherwise, output 0.
6. An identity-based encryption system, It is characterized in that include: An initial generation module, the initial generation module is used to generate a master public key mpk and a master private key msk after initialization; A private key generation module is used to generate a private key for any user identity id∈{0,1} using the master private key msk * Generate private key sk id ; An encryption module, the encryption module is used to encrypt the plaintext μ∈{0,1} using the master public key mpk and the user identity id; Decryption module, the decryption module is used to use the user's private key sk id Decrypt the ciphertext to restore the plaintext.
7. A computer device, It is characterized in that The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium, It is characterized in that A computer program is stored thereon, and the program is executed by a processor to implement the method according to any one of claims 1 to 5.
