Ciphertext storage method and system based on signature witness and identity encryption

By adopting a ciphertext storage method based on signature witness and identity encryption in the blockchain, the problem of ciphertext insecure in smart contracts is solved, and a high-security ciphertext storage and decryption process is realized.

CN119402187AActive Publication Date: 2025-02-07WEBANK (CHINA)
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411527845.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-02-07
Estimated Expiration
2044-10-30

AI Technical Summary

Technical Problem

In blockchain, it is difficult for existing technology to safely save secrets on smart contracts, resulting in insecure ciphertexts and affecting security.

Method used

The ciphertext storage method based on signature witness and identity encryption is adopted. By obtaining the public key of the blockchain node, the encryption results are generated and stored in a smart contract, the signature is collected after the signature event, the aggregation calculation is performed, and the ciphertext is finally decrypted.

Benefits of technology

Improve the security of blockchain ciphertexts, ensuring the secure storage of ciphertexts in smart contracts until the decryption user applies for signature and decryption, avoiding the risk of ciphertext leaks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119402187A_ABST
    Figure CN119402187A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a ciphertext storage method and system based on signature witness and identity encryption, and the method comprises the steps: obtaining the number alpha of blockchain nodes participating in the ciphertext storage, and enabling each blockchain node to select a random number xi, calculating a public key PKi of each block chain node according to a meta-parameter and a random number generated in a preset prime number bilinear group, forming a public key set by alpha public keys, and putting the public key set into a smart contract; acquiring a plurality of ciphertexts K, signature objects Ti and L, and storing the alpha < 1 > group of results in the smart contract; and obtaining alpha 1 groups of results, executing aggregation calculation according to the alpha 1 public keys and the alpha 1 signatures to obtain an aggregation signature sigma, and decrypting the encryption result ct by using the aggregation signature and the public key set U to obtain the plurality of ciphertexts K.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer software and security detection technology, and specifically relates to a ciphertext storage method and system based on signature witnessing and identity encryption. Background Art

[0002] In the blockchain, due to the transparency of the blockchain, anyone can see any content stored on the blockchain, so some secrets cannot be directly saved on the smart contract. Take asset transfer or asset custody as an example. User A wants to transfer a digital asset to user B, and there is no direct communication between user A and user B, that is, user A does not know the address of user B, so user A usually needs to use a smart contract to lock the asset under certain conditions, such as a puzzle. If user B knows the secret to solve the puzzle, he can obtain the asset. In essence, the secret needs to be converted into a non-secret form and stored on the blockchain.

[0003] The existing technology requires multiple rounds of interaction between the encryption user and the decryption user so that the decryption user can obtain the necessary information to decrypt the ciphertext. However, the users and participants of the blockchain usually do not know each other and do not trust each other. Therefore, the encryption user and the decryption user can only exchange information through smart contracts to ensure that the other party is not cheating. Therefore, the solution of the existing technology may cause the non-decryption user to see the information of the smart contract, resulting in the problem of insecure ciphertext, which affects security. Summary of the invention

[0004] The present application provides a ciphertext storage method and system based on signature witness and identity encryption, which can avoid improving the security of blockchain ciphertext.

[0005] In a first aspect, the present application provides a ciphertext storage method based on signature witnessing and identity encryption, the method comprising the following steps:

[0006] Get the number of blockchain nodes α participating in the ciphertext storage. Each blockchain node selects a random number x. i , where i∈

α

[0007] After the smart contract issues a signature event, the α1 blockchain nodes that receive the signature event will sign the object T i Sign to obtain α1 signatures, use the public key pubKey of the decryption object to encrypt the α1 signatures to obtain α1 encryption results, match the encryption results and public keys of each blockchain node together to obtain α1 groups of results, and store the α1 groups of results in the smart contract;

[0008] Get α1 group results, use the private key privKey of the decryption object to decrypt α1 encrypted results to get α1 signatures, perform aggregation calculation based on α1 public keys and α1 signatures to get the aggregate signature σ, use the aggregate signature and public key set U to encrypt the result c t Decryption is performed to obtain the multiple ciphertexts K.

[0009] The aggregate signature is: an aggregate signature obtained by aggregating signatures of multiple different data of the same signature object.

[0010] In a second aspect, a ciphertext storage system based on signature witnessing and identity encryption is provided, the system comprising:

[0011] The acquisition unit is used to obtain the number of blockchain nodes α participating in the ciphertext storage. Each blockchain node selects a random number x i , where i∈

α

[0012] Calculation unit, used to convert K, L, T i , α i And the public key set is input into the encryption function to calculate the encryption result c t , c t Stored in smart contracts;

[0013] The communication unit is used to send a signature event to the α1 blockchain nodes that received the signature event after the smart contract issued the signature event. i Sign and get α1 signatures;

[0014] The computing unit is further used to encrypt α1 signatures using the public key pubKey of the decryption object to obtain α1 encryption results, match the encryption result and the public key of each blockchain node together to obtain α1 group results, and store the α1 group results in the smart contract;

[0015] The computing unit is further used to obtain α1 sets of results, decrypt α1 encrypted results using the private key privKey of the decryption object to obtain α1 signatures, perform aggregation calculation based on α1 public keys and α1 signatures to obtain the aggregate signature σ, and use the aggregate signature and the public key set U to encrypt the encrypted result c t Decryption is performed to obtain the multiple ciphertexts K.

[0016] The aggregate signature is: an aggregate signature obtained by aggregating signatures of multiple different data of the same signature object.

[0017] In a third aspect, the present application provides a computer storage medium storing a computer program for electronic data exchange, wherein the computer program enables a computer to execute some or all of the steps described in the first aspect of the present application.

[0018] The embodiments of the present application have the following beneficial effects:

[0019] The encryption process of the encryptor of the technical solution of the present application does not need to obtain a signature, and only needs to use the public keys of all signers to encrypt the secret. Only when the decryptor requests a certain number of blockchain nodes to sign separately and obtains the signatures of these nodes and aggregates them, can the secret be decrypted. In addition, in the process of obtaining the decrypted sharding key (i.e., the signature of each blockchain node), no one can know the key, because these sharding keys are asymmetrically encrypted and multi-level secret protection is achieved, thereby storing the secret for an arbitrarily long time (until the decryption user wants to decrypt the secret). In this way, the secret is encrypted and stored in a transparent and public place such as a smart contract until the decryptor applies for a blockchain node to sign, and then the decryptor uses these signature shards to decrypt the ciphertext, so that the entire encryption and decryption process will not leak the ciphertext, and even if other people intercept the signature shards, they cannot steal the ciphertext. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0021] Figure 1 is a schematic diagram of the structure of a computer provided in an embodiment of the present application;

[0022] Figure 2 It is a flowchart of a ciphertext storage method based on signature witnessing and identity encryption provided by an embodiment of the present application;

[0023] Figure 3It is a schematic diagram of the encryption result calculation steps provided by this application;

[0024] Figure 4 It is a structural diagram of a ciphertext storage system based on signature witnessing and identity encryption provided in an embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0026] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, systems, products or devices.

[0027] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0028] The following is an introduction to the relevant terms involved in this application.

[0029] Blockchain: A new distributed infrastructure and computing method that uses block chain data structures to verify and store data, distributed node consensus algorithms to generate and update data, cryptography to ensure the security of data transmission and access, and smart contracts composed of automated script codes to program and operate data.

[0030] Public key system: keys are generated in pairs, each pair of keys consists of a public key and a private key. In practical applications, the private key is kept by the owner, while the public key needs to be made public.

[0031] Elliptic Curve Cryptography (ECC) is a public key cryptographic algorithm based on elliptic curve mathematics. It provides a secure way to perform cryptographic operations such as key exchange, digital signatures, and encryption.

[0032] Hash: It can also be called hash or hash. It transforms input of any length into output of fixed length through a hash algorithm, and ensures that different inputs will not have the same output with a high probability.

[0033] Key negotiation: A key negotiation algorithm widely used in computer network communications. It can securely create a shared key over an insecure channel, allowing the communicating parties to negotiate a secure communication key without any pre-shared key.

[0034] Bilinear mapping function, for a prime number bilinear group, it can be described by a quintuple (p, G1, G2, GT, e), where p is a large prime number related to a given safety constant, G1, G2, GT are all multiplicative cyclic groups of order p (the generators of G1 and G2 are g1 and g2, and the generator of GT is gT), e is a bilinear mapping function that can map two points P and Q on one or two different curves to a number: e(P, Q)→n, that is, mapping the elements in the G1 and G2 groups to the GT group.

[0035] BLS aggregate signature: BLS signature is a special type of digital signature introduced by Dan Boneh, Ben Lynn and Hovav Shachham in 2001. BLS uses elliptic curve pairing technology based on bilinear mapping to achieve signature verification and aggregation. BLS signature requires two new structures: Hashing to the curve and Curve pairing.

[0036] The following describes the system architecture of a computer related to an embodiment of the present application.

[0037] The present application also provides a computer 10, such as Figure 1 As shown, it includes at least one processor 11 and a memory 12, and may also include a communications interface 14 and a bus 13. The processor 11, the memory 12 and the communications interface 14 may communicate with each other through the bus 13. The communications interface 14 may transmit information. The processor 11 may call the logic instructions in the memory 12 to execute the method in the above embodiment.

[0038] In addition, the logic instructions in the above-mentioned memory 12 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. The above-mentioned logic instructions can also become an operating system, application program or computer program, etc.

[0039] The memory 12 is a computer-readable storage medium that can be configured to store software programs, computer executable programs, such as program instructions or modules corresponding to the methods in the embodiments of the present disclosure. The processor 11 executes functional applications and data processing by running the software programs, instructions or modules stored in the memory 12, that is, implementing the methods in the above embodiments.

[0040] The memory 12 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the computer 10, etc. In addition, the memory 12 may include a high-speed random access memory and may also include a non-volatile memory. For example, a variety of media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, may also be a transient storage medium.

[0041] It is understandable that the computer in this embodiment can be understood as a server, for example, the server includes a cloud server or an edge server, and no unique limitation is made here. Of course, in an optional technical scenario, the above-mentioned computer can also be a personal computer (PC), a tablet computer, a laptop computer, and other smart devices. This application does not limit the specific form of the above-mentioned computer, as long as the above-mentioned computer has an operating system and shortcuts.

[0042] The specific methods are introduced in detail below.

[0043] See also Figure 2 , the present application also provides a ciphertext storage method based on signature witness and identity encryption, the method comprising the following steps:

[0044] Step S201: Obtain the number of blockchain nodes α participating in the ciphertext storage. Each blockchain node selects a random number x. i , where i∈

α

[0045] Step S202: After the smart contract issues a signature event, the α1 blockchain nodes that receive the signature event sign the signature object T i Sign to obtain α1 signatures, use the public key pubKey of the decryption object to encrypt the α1 signatures to obtain α1 encryption results, match the encryption results and public keys of each blockchain node together to obtain α1 groups of results, and store the α1 groups of results in the smart contract;

[0046] Step S203, obtain α1 group results, use the private key privKey of the decryption object to decrypt α1 encryption results to obtain α1 signatures, perform aggregation calculation based on α1 public keys and α1 signatures to obtain aggregate signature σ, use the aggregate signature and public key set U to encrypt the encryption result c t Decryption is performed to obtain the multiple ciphertexts K.

[0047] The above-mentioned aggregate signature may be: an aggregate signature obtained by aggregating signatures of multiple different data of the same signature object.

[0048] The above-mentioned aggregation execution method can specifically adopt the m-of-n BLS aggregation signature algorithm. Of course, other aggregation algorithms can also be adopted, such as the BLS aggregation signature algorithm, etc.

[0049] The technical solution provided by this application can obtain the number of blockchain nodes α participating in the ciphertext storage. Each blockchain node selects a random number x. i , where i∈

α

[0050] For example, the above K, L, T i , α i And the public key set is input into the encryption function to calculate the encryption result c t Specifically, they may include:

[0051] Select α random numbers from the random number cluster, select a public key pk1 from the α public keys, calculate the hash value ε1 of the public key pk1, select the generator g2 of G2 from the prime number bilinear group, calculate c based on g2 and another random number r, calculate the signature object T1 value based on the random number α1, the hash value ε1 and c, select an element h from the group G2, calculate c0 based on h, g2 and another random number r; calculate cj based on the public key pk1, g2 and the defined function value sj; based on T i , K, g2 and Gt are calculated to get ci', h, c, c0, cj, ci', αi, T i Input the encryption function to get the encryption result ct.

[0052] For example, the encryption function may be: SWE.Enc((pk j ) j∈[n] , (T i ) i∈[l] , (K i ) i∈[l]);

[0053] Among them, pk j Represents the public key of each blockchain node. For example, the public key of node 1 can be pk1, and the public key of node 2 can be pk2. i represents the signature object, for example, T1 represents the first signature object, and T2 represents the second signature object. It should be noted that the signature objects here do not necessarily represent different individuals. For example, T1 can be the signature of user A, and T2 can be the data of user A (such as asset list, asset generation time, etc.). i Represents an encryption object, for example, K1 represents the first encryption object, K2 represents the second encryption object, and L represents the number of T and K, for example, 4 or 5.

[0054] For example, the specific calculation method of the above encryption result ct is as follows Figure 3 As shown, Figure 3 The schematic diagram of the encryption result calculation steps provided for this application may include:

[0055] Step A1: Select a random number r and m random numbers r j ; where j∈(0,1…m-1); r j ∈Zp; where Zp is a set of random numbers, and the above random numbers can be prime numbers.

[0056] Step A2: Based on each PK j Calculate ε j Specific calculation methods may include:

[0057] ε j =H2(PK j );s j =f(s j );in,

[0058] f(x)=∑ m-1 j=0 r j· x j ; x is the independent variable.

[0059] Step A3: Select L random numbers α from Zp i , i∈(0,1…L-1),

[0060] Step A4: Based on α i 、T i Calculate t i ; Calculate c based on g2 and r;

[0061] t i =H(T i ) αi ;

[0062] c=g2 r , where g2 is the generator of group G2.

[0063] Step A5, select a random element h from group G2 and calculate C0;

[0064] C0=h r g2 r0 ;

[0065] Step A6: For each PKj and Sj, calculate c j ;

[0066] where c j =pk j r g2 Sj

[0067] Step A7: For each t i and K i , calculate c i '.

[0068] Among them, c i '=e(t i g2 r 0)·g T Ki ,

[0069] Step A8: Calculate the output result ct; ct = (h, c, c0, (c j ) j∈[n] , (c i ′,a i , t i ) i∈[l] ).

[0070] For example, the above-mentioned use of the aggregate signature to decrypt the encryption result to obtain the ciphertext K specifically includes:

[0071] Get the preset public key set U, calculate the hash value εj for each public key in the U set, calculate Lj for each hash value εj, calculate C* based on Lj and cj, calculate Zi based on the aggregate signature σ and C*, and bring Zi into the decryption function to get the encrypted data. When there are multiple encrypted data, combine the multiple encrypted data to get the encrypted ciphertext.

[0072] The above decryption function can be specifically: SWE.Dec(ct, (σ i ) i∈[l] , U, V),

[0073] Where V = (pk1, pk2…pk n ) is the public key set of all blockchain nodes, U=(pk1'’ ,pk2'…pk k ') is the public key of the k blockchain nodes participating in the signature. It should be noted that the subscripts in the V set and the subscripts in the U set are not one-to-one corresponding, but are just the order of the public keys in their respective sets; σ i is the signature of each node on Ti (S Tij ) i∈

L

k

[0074] The specific method for obtaining the above K may include the following steps:

[0075] Step B1: For each public key in the set U, calculate ε j ; j here represents the subscript of the public key, and I represents the number of public keys in the set U;

[0076] The above ε j The calculation formula of can refer to the description of the above step A2, which will not be repeated here.

[0077] Step B2: For each ε j , calculate Lj respectively;

[0078] in,

[0079]

[0080] i and j can be adjacent values ​​or interval values, for example, j=1, i=2 (adjacent selection), and j=3.i=1 (interval selection)

[0081] Step B3, calculate C*;

[0082]

[0083] Step B4: For each c i ′,a i , t i , σ i , calculate z i =c i ′·e(σ i , a i ) / e(t i , c*);

[0084] Step B5: For each Zi, calculate The obtained K i ′, i∈[l] are combined to form the decrypted secret K;

[0085] dlog gt The (Zi) calculation represents finding the multiplier of Zi corresponding to gT.

[0086] Embodiment 1

[0087] The first embodiment of the present application provides a ciphertext storage method based on signature witness and identity encryption. The above method is the encryption of the ciphertext between Alice and Bob. The number of blockchain nodes in this embodiment is n=5. Only when Bob obtains the correct signatures of more than or equal to 3 nodes can he obtain the key to unlock the secret, so m=3. The technical scenario implemented in this embodiment may include: selecting a prime bilinear group (p, G1, G2, GT, e) and a hash function H: {0, 1}→G1 that conforms to the hash to elliptic curve and a hash function H2: {0, 1}→Z that hashes to a positive integer within a prime number p P .

[0088] Select a public-private key asymmetric encryption and decryption algorithm PKE, such as EC-ElGamal and SM3 algorithm, which includes an encryption algorithm PKE.Enc(pubKey, S)→ct and a decryption algorithm PKE.Dec(privKey, ct)→s.

[0089] Deploy a smart contract on the blockchain as a place to store secrets (encrypted) and other public information. Select 5 participating blockchain nodes (selected at random), and each of these 5 blockchain nodes selects a random number x i , i∈[5], x i ∈Z p ' as the private key, and then calculate the respective public keys Finally, put all the public keys V = (pk1, pk2, ... pk5) in the smart contract. Randomly select the value of the signature object T. For the sake of simplicity, since this example is to encrypt a secret K, you only need to select one T as the common signature object for all nodes and store it in the smart contract. (The solution of this embodiment supports encryption and decryption of multiple secrets at the same time. According to the above principle, a corresponding number of signature objects are required, but each signature object is not required to be different. In addition, encrypting and decrypting multiple secrets at the same time is equivalent to connecting multiple secrets in series, and finally encrypting and decrypting one secret. Therefore, the example here only uses one signature object and one secret). The above method includes the following steps:

[0090] Step S31, Alice calls the encryption function SWE.Enc((pk j ) i∈[n] , (T i ) i∈[l] , (K i ) i∈[l] ), input n = 5, l = 1, T, K and each public key PK i , we can get the output ct = (h, c, c0, (c j ) j∈[5], (c i ′,a i , t i ) i∈[1] ), and then store ct in the smart contract.

[0091] Step S32: Before applying for decryption, Bob first generates a pair of public and private keys (privKey, pubKey). Bob applies for decryption to the smart contract and stores the public key pubKey in the smart contract.

[0092] Step S33: The smart contract issues a signature event. Due to the characteristics of blockchain, all blockchain nodes will receive this event. Assume that three of the nodes (whose public keys are pk1′, pk2′, and pk3′) sign the signature object T immediately after receiving the event: Then use the public key pubKey stored by Bob in the smart contract to encrypt the signature: Finally, combine the encryption result with your own public key Send to smart contract.

[0093] Step S34: Bob obtains the encryption result of the previous step from the smart contract First use the private key to decrypt separately: Get the signatures S1, S2, and S3 of the three blockchain nodes; then aggregate these three signatures to get the aggregate signature σ: For the participating signatures pk1′, pk2′, and pk3′, calculate the corresponding ε j =H2(pk j ), j∈3, we get (ε1, ε2, ε k ). For each ε j Recalculate Finally, we get the aggregate signature

[0094] Step S35. Bob finally uses the aggregate witness signature decryption function SWE.Dec(ct, σ, U, V), where U = (pk1′, pk2′, pk3′), to obtain the original ciphertext K encrypted by Alice’s lock.

[0095] The encryption process of the encryptor of the technical solution of the present application does not need to obtain a signature, and only needs to use the public keys of all signers to encrypt the secret. Only when the decryptor requests a certain number of blockchain nodes to sign separately and obtains the signatures of these nodes and aggregates them, can the secret be decrypted. In addition, in the process of obtaining the decrypted sharding key (i.e., the signature of each blockchain node), no one can know the key, because these sharding keys are asymmetrically encrypted and multi-level secret protection is achieved, thereby storing the secret for an arbitrarily long time (until the decryption user wants to decrypt the secret). In this way, the secret is encrypted and stored in a transparent and public place such as a smart contract until the decryptor applies for a blockchain node to sign, and then the decryptor uses these signature shards to decrypt the ciphertext, so that the entire encryption and decryption process will not leak the ciphertext, and even if other people intercept the signature shards, they cannot steal the ciphertext.

[0096] See also Figure 4 , Figure 4 A ciphertext storage system based on signature witnessing and identity encryption is provided for this application, and the system includes:

[0097] The acquisition unit 401 is used to obtain the number of blockchain nodes α participating in the storage of the ciphertext. Each blockchain node selects a random number x. i , where i∈

α

[0098] The calculation unit 402 is used to convert K, L, T i , α i And the public key set is input into the encryption function to calculate the encryption result c t , c t Stored in smart contracts;

[0099] Communication unit 403, used for receiving the signature event of the α1 blockchain nodes to sign the object T after the smart contract issues the signature event i Sign and get α1 signatures;

[0100] The computing unit 402 is further used to encrypt α1 signatures using the public key pubKey of the decryption object to obtain α1 encryption results, match the encryption result and the public key of each blockchain node together to obtain α1 group results, and store the α1 group results in the smart contract;

[0101] The calculation unit 402 is further used to obtain α1 group results, use the private key privKey of the decryption object to decrypt α1 encryption results to obtain α1 signatures, perform aggregation calculation based on α1 public keys and α1 signatures to obtain the aggregate signature σ, and use the aggregate signature and the public key set U to encrypt the encryption result c t Decryption is performed to obtain the multiple ciphertexts K.

[0102] The aggregate signature is: an aggregate signature obtained by aggregating signatures of multiple different data of the same signature object.

[0103] For example,

[0104] The calculation unit 402 is specifically used to select α random numbers from the random number cluster, select a public key pk1 from the α public keys, calculate the hash value ε1 of the public key pk1, select the generator g2 of G2 from the prime number bilinear group, calculate c according to g2 and another random number r, calculate the signature object T1 value according to the random number α1, the hash value ε1 and c, select an element h from the group G2, calculate C0 according to h, g2 and another random number r; calculate cj according to the public key pk1, g2 and the defined function value sj; calculate cj according to T i , K, g2 and Gt are calculated to obtain ci', h, c, C0, cj, ci', αi, T i Input the encryption function to get the encryption result ct.

[0105] For example, the calculation unit 402 is specifically configured to select a random number r and m random numbers r j , where j∈(0,1…m-1); r j ∈Zp; where Zp is a set of random numbers;

[0106] Perform hash calculation on each public key PKj to obtain the εj corresponding to each public key, and execute the custom function f(x) on each public key PKj to calculate S j ; For each PKj and S j calculate Cj ;

[0107] Select L random numbers a from Zp i ,i∈(0,1…L-1), for each a i、 T i Calculate t i , calculate c based on g2 and r; calculate C0, where C0 is equal to the product of h to the power of r times g2 to the power of r0;

[0108] Calculate ci', where ci' is equal to t iMultiply the product of the bilinear function value of the product of g2 to the power of r0 and Gt to the power of Ki, and change h, c, C0, cj, ci', αi, T i , t i Collect them together to get the encrypted result ct.

[0109] For example, the calculation unit 402 is specifically used to obtain a preset public key set U, calculate a hash value εj for each public key in the U set, calculate Lj for each hash value εj, calculate C* based on Lj and cj, calculate Zi based on the aggregate signature σ and C*, and bring Zi into the decryption function to obtain encrypted data. When there are multiple encrypted data, the encrypted ciphertext is obtained by combining the multiple encrypted data.

[0110] For example, the calculation unit 402 is specifically used to select the corresponding εi for each εj, calculate the difference between εj and εi, and calculate the ratio of -εi to the difference, where Lj is the direct product value of each εj ratio, where i and j are adjacent selections or interval selections.

[0111] For example, the calculation unit 402 is specifically configured to calculate C*, where C* is the direct product value of cj to the Ljth power.

[0112] For example, the calculation unit 402 is specifically used to calculate σ, a i The bilinear function of t1 and C* is used to obtain the first value, the bilinear function of t1 and C* is used to obtain the second value, the ratio of the first value to the second value is calculated, and Zi is the product of t1' and the ratio.

[0113] An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps of any method described in the above method embodiments, and the above computer includes an electronic device.

[0114] The embodiment of the present application also provides a computer program product, the computer program product includes a non-transitory computer-readable storage medium storing a computer program, the computer program is operable to cause a computer to execute some or all of the steps of any method described in the method embodiment. The computer program product may be a software installation package, and the computer includes an electronic device.

[0115] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0116] In the several embodiments provided in the present application, it should be understood that the disclosed methods, systems and systems can be implemented in other ways. For example, the system embodiments described above are merely schematic; for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation; for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of systems or units, which can be electrical, mechanical or other forms.

[0117] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0118] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be physically included separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0119] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform some steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a volatile memory or a non-volatile memory. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM) or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM) and direct RAM bus RAM (DR RAM). Various media that can store program code are available.

[0120] Although the present invention is disclosed as above, the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions without departing from the spirit and scope of the present invention, and can make various changes and modifications, including the combination of the above-mentioned different functions and implementation steps, including software and hardware implementation methods, all of which are within the scope of protection of the present invention.

Claims

1. A ciphertext storage method based on signature witness and identity encryption, characterized in that: The method comprises the following steps: Get the number of blockchain nodes α participating in the ciphertext storage. Each blockchain node selects a random number x. i , where i∈【α】, the public key PK of each blockchain node is calculated based on the generator parameters and random numbers in the preset prime bilinear group i , put α public keys into a public key set and put it into the smart contract; obtain multiple ciphertexts K and signature objects T i and L, where L is T i and the quantity value of K, K, L, T i , α i And the public key set is input into the encryption function to calculate the encryption result c t , c t Stored in smart contracts; After the smart contract issues a signature event, the α1 blockchain nodes that receive the signature event will sign the object T i Sign to obtain α1 signatures, use the public key pubKey of the decryption object to encrypt the α1 signatures to obtain α1 encryption results, match the encryption results and public keys of each blockchain node together to obtain α1 groups of results, and store the α1 groups of results in the smart contract; Get α1 group results, use the private key privKey of the decryption object to decrypt α1 encrypted results to get α1 signatures, perform aggregation calculation based on α1 public keys and α1 signatures to get the aggregate signature σ, use the aggregate signature and public key set U to encrypt the result c t Decrypting to obtain the multiple ciphertexts K; The aggregate signature is: an aggregate signature obtained by aggregating signatures of multiple different data of the same signature object.

2. The ciphertext storage method based on signature witness and identity encryption according to claim 1 is characterized in that: The K, L, T i , α i And the public key set is input into the encryption function to calculate the encryption result c t Specifically, they may include: Select α random numbers from the random number cluster, select a public key pk1 from the α public keys, calculate the hash value ε1 of the public key pk1, select the generator g2 of G2 from the prime number bilinear group, calculate c based on g2 and another random number r, calculate the signature object T1 value based on the random number α1, the hash value ε1 and c, select an element h from the group G2, calculate C0 based on h, g2 and another random number r; calculate cj based on the public key pk1, g2 and the defined function value sj; based on T i , K, g2 and Gt are calculated to obtain ci', h, c, C0, cj, ci', αi, T i Input the encryption function to get the encryption result ct.

3. The ciphertext storage method based on signature witness and identity encryption according to claim 2 is characterized in that: h, c, C0, cj, ci', αi, T i Input the encryption function to obtain the encryption result ct, which specifically includes: Choose a random number r and m random numbers r j , where j∈(0,1…m-1); r j ∈Zp; where Zp is a set of random numbers; Perform hash calculation on each public key PKj to obtain the εj corresponding to each public key, and execute the custom function f(x) on each public key PKj to calculate S j ; For each PKj and S j calculate Cj ; Select L random numbers a from Zp i ,i∈(0,1…L-1), for each a i、 T i Calculate t i , calculate c based on g2 and r; calculate C0, where C0 is equal to the product of h to the power of r times g2 to the power of r0; Calculate ci', where ci' is equal to t i Multiply the product of the bilinear function value of the product of g2 to the power of r0 and Gt to the power of Ki, and change h, c, C0, cj, ci', αi, T i , t i Collect them together to get the encrypted result ct.

4. The ciphertext storage method based on signature witness and identity encryption according to claim 1 is characterized in that: The method of using the aggregate signature to decrypt the encryption result to obtain the ciphertext K specifically includes: Get the preset public key set U, calculate the hash value εj for each public key in the U set, calculate Lj for each hash value εj, calculate C* based on Lj and cj, calculate Zi based on the aggregate signature σ and C*, and substitute Zi into the decryption function to obtain the encrypted data; when there are multiple encrypted data, combine the multiple encrypted data to obtain the encrypted ciphertext.

5. The ciphertext storage method based on signature witness and identity encryption according to claim 4 is characterized in that: The calculation of Lj for each hash value εj specifically includes: For each εj, select the corresponding εi, calculate the difference between εj and εi, and calculate the ratio of -εi to the difference. The Lj is the direct product value of each εj ratio, where i and j are adjacent selections or interval selections.

6. The ciphertext storage method based on signature witness and identity encryption according to claim 4 is characterized in that: The specific calculation of C* based on Lj and cj includes: C* is the direct product of cj to the power of Lj.

7. The ciphertext storage method based on signature witness and identity encryption according to claim 4 is characterized in that: Zi is calculated based on the aggregate signature σ and C* and specifically includes: Calculate σ, a i The bilinear function of t1 and C* is used to obtain the first value, the bilinear function of t1 and C* is used to obtain the second value, the ratio of the first value to the second value is calculated, and Zi is the product of t1' and the ratio.

8. A ciphertext storage system based on signature witness and identity encryption, characterized in that: The system comprises: The acquisition unit is used to obtain the number of blockchain nodes α participating in the ciphertext storage. Each blockchain node selects a random number x i , where i∈【α】, the public key PK of each blockchain node is calculated based on the generator parameters and random numbers in the preset prime bilinear group i , put α public keys into a public key set and put it into the smart contract; obtain multiple ciphertexts K and signature objects T i and L, where L is T i and the number of K values; Calculation unit, used to convert K, L, T i , α i And the public key set is input into the encryption function to calculate the encryption result c t , c t Stored in smart contracts; The communication unit is used to send a signature event to the α1 blockchain nodes that received the signature event after the smart contract issued the signature event. i Sign and get α1 signatures; The computing unit is further used to encrypt α1 signatures using the public key pubKey of the decryption object to obtain α1 encryption results, match the encryption result and the public key of each blockchain node together to obtain α1 group results, and store the α1 group results in the smart contract; The computing unit is further used to obtain α1 sets of results, decrypt α1 encrypted results using the private key privKey of the decryption object to obtain α1 signatures, perform aggregation calculation based on α1 public keys and α1 signatures to obtain the aggregate signature σ, and use the aggregate signature and the public key set U to encrypt the encrypted result c t Decrypting to obtain the multiple ciphertexts K; The aggregate signature is: an aggregate signature obtained by aggregating signatures of multiple different data of the same signature object.

9. The ciphertext storage system based on signature witness and identity encryption according to claim 8 is characterized in that: The computing unit is specifically used to select α random numbers from a random number cluster, select a public key pk1 from α public keys, calculate the hash value ε1 of the public key pk1, select a generator g2 of G2 from a prime number bilinear group, calculate c based on g2 and another random number r, calculate the signature object T1 value based on the random number α1, the hash value ε1 and c, select an element h from the group G2, calculate C0 based on h, g2 and another random number r; calculate cj based on the public key pk1, g2 and the defined function value sj; calculate cj based on T i , K, g2 and Gt are calculated to obtain ci', h, c, C0, cj, ci', αi, T i Input the encryption function to get the encryption result ct.

10. The ciphertext storage system based on signature witness and identity encryption according to claim 9 is characterized in that: The calculation unit is specifically used to select a random number r and m random numbers r j , where j∈(0,1…m-1); r j ∈Zp; where Zp is a set of random numbers; Perform hash calculation on each public key PKj to obtain the εj corresponding to each public key, and execute the custom function f(x) on each public key PKj to calculate S j ; For each PKj and S j calculate Cj ; Select L random numbers a from Zp i ,i∈(0,1…L-1), for each a i、 T i Calculate t i , calculate c based on g2 and r; calculate C0, where C0 is equal to the product of h to the power of r times g2 to the power of r0; Calculate ci', where ci' is equal to t i Multiply the product of the bilinear function value of the product of g2 to the power of r0 and Gt to the power of Ki, and change h, c, C0, cj, ci', αi, T i , t i Collect them together to get the encrypted result ct.

Citation Information

Patent Citations

  • Blockchain key management method, multi-person common signature method and electronic device

    CN111639361A

  • Digital identity signing and issuing method and device based on block chain and medium

    CN111935075A

  • Random number generation method and apparatus based on blockchain

    WO2023109520A1