Multifunctional block chain editing method
Through the multifunctional blockchain editing method, the problems of blockchain security, privacy and decentralization are solved, the high flexibility and editability of the blockchain are achieved, and the privacy protection and supervision of the blockchain are provided. demand, improving the security and decentralization features of the blockchain.
Patent Information
- Application Number
- CN202410737785.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-06-07
AI Technical Summary
It is difficult for existing editable blockchain technology to solve the "ternary paradox" problems of blockchain security, privacy and decentralization at the same time in a single solution, especially when mainstream encryption solutions such as CP-ABE have poor performance in terms of security and decentralization. There are design bottlenecks in performance that are difficult to solve in a short time.
Adopt a multifunctional blockchain editing method, including system initialization, generation of periodic and revocable keys, blockchain editing steps, system initialization through the key center KGC, generation of long-term conversion key pairs and periodic updates Key, users perform hash calculation and verification based on editing conditions, users with editing permissions perform rewriting and updating, and KGC performs audit and revocation operations to make blocks editable and revocable.
It realizes a highly flexible and multi-functional editable blockchain within a single solution, which can generate, re-edit and revoke blocks, provides the privacy protection and supervision requirements of the blockchain, and improves the security and deletion of the blockchain. Centralized features.
Smart Images

Figure CN118764155A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to cyberspace security technology, and specifically relates to blockchain editing technology. Background Art
[0002] The current research on editable blockchains mainly focuses on fine-grained editing and decentralized editing operations and their related security. For example, the study of revoking blockchain editing permissions, achieving traceability and anonymity of the editing process, etc. However, the research in the above aspects is difficult to implement in a single solution. This is mainly due to the "trilemma" problem of solving the problems faced by blockchain "security, privacy and decentralization" at the same time. In addition, since the current scheme mainly involves cryptographic primitives such as attribute-based encryption CP-ABE based on ciphertext strategy and chameleon hash CH. Solving the above problems often means improving the transformation of existing CP-ABE and CH schemes. Obviously, mainstream encryption schemes such as CP-ABE face design bottlenecks in terms of security and performance, which are difficult to solve in a short time. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide a multifunctional blockchain editing method for adapting to the privacy protection needs and regulatory requirements of the blockchain, targeting the single functional design of the existing editable blockchain.
[0004] The technical solution adopted by the present invention to solve the above technical problems is a multifunctional blockchain editing method, comprising the steps of:
[0005] 1) System initialization steps:
[0006] The key center KGC initializes the system, initializes the revocation list, and outputs the system public parameters and master key;
[0007] 2) Steps for generating periodic and revocable keys:
[0008] The key center KGC generates a long-term conversion key pair based on the user identity id and attribute set and converts the long-term conversion key pair Send to the corresponding user; Update the key according to the master key, time t, revocation list and status generation cycle;
[0009] The server converts the public key according to the long-term and periodically update the key to generate a short-term conversion key;
[0010] The user's private key is converted based on long-term and time t to generate the short-term decryption key dk for the ciphertext after server-assisted decryption id,t ;
[0011] 3) Blockchain editing steps:
[0012] Calculate hash step: The user performs the calculation hash, according to the editing condition mode of public editing or private editing R Get the corresponding hash auxiliary aux H , outputs the Chameleon hash used to generate the block and random numbers And temporary trapdoor etd, complete block generation;
[0013] Verification hash step: User verification includes Chameleon hashing Original code M, random number The validity of the Chameleon hash pair at time t. If the block verification is valid, proceed to the next step, otherwise the process ends;
[0014] Rewrite the hashing step: hold editing permissions and long-term conversion key pairs and the short-term decryption key dk id,t The user acts as a modifier according to the long-term conversion private key Hash auxiliary aux H , Chameleon Hash Pair Rewrite the code M′ and the temporary trapdoor etd to obtain the random number used for rewriting Using random numbers Complete block rewriting;
[0015] Update hashing step: The modifier converts the private key based on the long term Hash auxiliary aux H , Chameleon Hash Pair Update time t′ and temporary trap door etd to get the random number used for update Using random numbers Complete block update;
[0016] Audit Steps: KGC uses long-term conversion private keys Check whether the server provides decryption services correctly and whether the decryption behavior of the server exceeds the limit;
[0017] Revocation step: KGC revokes the user's editing permissions by periodically updating the revocation list; the revocation list contains all revoked user IDs within time t.
[0018] The beneficial effect of the present invention is to propose a multifunctional editable blockchain solution with high flexibility, which can realize editable block generation, block re-editing, and revocable editing permissions within a single solution. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a flow chart of the present invention. DETAILED DESCRIPTION
[0020] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solution 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 making creative work are within the scope of protection of the present invention.
[0021] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0022] like Figure 1 As shown, an embodiment of the present invention provides a multifunctional blockchain editing method, comprising the following steps:
[0023] S1 System Initialization: The key center KGC initializes the system and outputs the system public parameter mpk ch and the master key msk ch , specifically:
[0024] The key center KGC initializes a binary tree BT with at least N leaf nodes, where N represents the maximum number of users in the system. Set the state st = BT. Maintain an empty list named rl to store revoked users, called rl the revocation list.
[0025] Choose two multiplicative groups and Their order is a prime number p. Select the random generator Represents the multiplication group Randomly select real numbers from . is a p-element finite field. Represents the multiplicative cyclic group of reversible integers modulo p. The generator of is g, and the bilinear map is → indicates mapping. Use the attribute universe U to represent the namespace of all user attributes, and set The namespace for all times t is Generate random numbers Set the hash function to
[0026] In addition, two functions F1 and F2 are defined: F1(y)=u y ·h and y is the independent variable, The elements in are mapped to For ease of presentation, the system public parameters used for attribute-based encryption are set to D and E are intermediate quantities, and the system private key for encrypting the attribute base is msk abe =α. Assume is an input key Collision-resistant hash function.
[0027] Run NIZK's sub-algorithm NIZK.GenZK to initialize the non-interactive zero-knowledge proof NIZK (Non-Interactive Zero-Knowledge Proof), and derive the public character reference string crs. Here, the existing non-interactive zero-knowledge proof NIZK = (GenZK, Prove, Verify, SimGen, SimProve) consists of five sub-algorithms.
[0028] The time-controlled encryption TPKE (Time-Release Public-Key Encryption) sub-algorithm TGen is used to obtain the TPKE public and private key pair (pk tpke ,sk tpke Here, the existing TPKE = (TGen, Enc, FDec, SDec) consists of four sub-algorithms. The time-controlled private key sk TPKE Will be used for fast decryption.
[0029] Output system public parameters and the master key msk ch =α.
[0030] S2 user key generation: KGC generates a key pair (pk ch ,sk ch ), specifically:
[0031] KGC runs the user key generation algorithm to generate a key pair (pk ch ,sk ch ). Select a random number Calculate secret number from Random selection As the user's private key, calculate run Calculate NIZK Proof The algorithm outputs the hash public key and the hashed private key
[0032] S3: Long-term conversion key generation: KGC executes the algorithm to output the long-term conversion public key corresponding to the user identity id and long-term conversion private key
[0033] KGC executes the long-term conversion key generation algorithm. Input user identity id and attribute set is S = (A1,…,A k ), where k is the total number of attributes. Then, an undefined leaf node θ is selected from the binary tree BT and the user algorithm ID is stored in this node. For each node x∈Path(θ), Path(θ) refers to the set of all nodes on the path from node θ to the root of the binary tree. And calculate Get g x Refers to a value initially stored in the binary tree BT node x. If the value of node x is not defined yet, a value should be randomly selected Calculate the median value And g x Stored in node x. Randomly selected calculate Output the long-term conversion public key of the user id and long-term conversion private key
[0034] S4: Periodic key generation: KGC executes the algorithm and outputs the periodic key ku t and status st;
[0035] KGC executes a periodic update key generation algorithm. From each node x∈KUNodes(BT,rl,t), obtain g x Here, KUNodes is the minimum node combination required for non-revoked users to decrypt ciphertext within a specified time period t. calculate Output ku t =(x,Q x,0 ,Q x,1 ) x∈KUNodes(BT,rl,t) and st.
[0036] S5: short-term conversion key generation: the server executes the algorithm and outputs the short-term conversion key tk id,t ;
[0037] The server executes the short-term conversion key generation algorithm. Assume that θ is a leaf node storing the user ID. Let I = (x:x∈Path(θ)) and J = (x:x∈KUNodes(BT,rl,t)). If Return ⊥. ⊥ means to terminate the current process. Otherwise, there must be a node x∈I∩J to calculate tk0=P x,0 Q x,0 ,tk1=P x,1 , tk4=Q x,1 ,tk5=P x,4 ,tk6=P x,5 For each tk id,t , initialize the decryption counter ctr = 0 and an empty set Set tk7 = csi as the current state information. Output short-term conversion key tk id,t =(tk0,tk1,(tk i,2 ,tk i,3 ) i∈[k] ,tk4,tk5,tk6,tk7).
[0038] S6: Short-term decryption key generation: The user executes the short-term decryption key generation algorithm and outputs the short-term decryption key dk id,t .
[0039] The user executes the short-term decryption key generation algorithm. Enter the user ID and long-term conversion private key Random Selection And output the short-term decryption key
[0040] S7: Calculate hash: User runs the calculation hash, according to different editing conditions mode R , output chameleon hash and random numbers Temporary trapdoor Specifically:
[0041] According to the public edit mode R = "public" or private editing mode R = "private", set different hash auxiliary H for:
[0042]
[0043] Where (M, ρ) is the access structure of the linear secret sharing scheme LSSS, M is the first element of the access structure, which is the original code; ρ is the second element of the access structure; t is the time;
[0044] Next, run to check the correctness of the NIZK proof. If the output is 0, it returns ⊥. Check Is it true? If not, return ⊥. Select a random number and temporary trapdoor Calculate h = g etd and π h =NIZK1.Prove(crs,(etd,h=getd )). Then, calculate the hash value Hash value and proof We denote the encoding and decoding methods as and is the cyclic group of the quadratic residue used for instantiation. M,M′,M″ are The elements in .
[0045] S8: Verify Hash: User runs Verify Hash to detect Chameleon hash pair Validity at time t, output ⊥, 0 or 1;
[0046] The user runs this algorithm to verify the validity of the Chameleon hash pair. or or Then return ⊥. Calculate and check whether it satisfies: If not satisfied, return ⊥, if satisfied, calculate the verification value Then determine whether it is satisfied If it is satisfied, output 1, if not, check t′≠t and Is it true? If true, output 0, otherwise output ⊥. Output 0 means that the test or verification failed, and output 1 means that the verification or test passed.
[0047] S9: Rewrite Hash: The modifier runs the rewrite hash algorithm to calculate a new Chameleon hash collision and outputs a new set of random numbers
[0048] The modifier runs this algorithm to compute new Chameleon hash collisions. Algorithm input: If M = M', then return M' is the rewrite code.
[0049] Otherwise, enter the hash helper If mode R = "private": Runs a verification algorithm to check the hash pair and time If the output is 0, it returns ⊥. Calculation and if Direct return, For the partially decrypted ciphertext CT', the modifier enters the short-term decryption key dk id,t to the decryption algorithm ABE.Decrypt to recover M from CT. If the output is ⊥, then return ⊥. Otherwise, run get calculate and hash value Run ABE.Offline.Enc on t to get IT'. Run get Run ABE.Online.Enc((M,ρ),M′,IT′), Get CT and certification If mode R = "public": Run the verification algorithm If the output is not 1, then output ⊥. Otherwise, calculate if Direct return Otherwise, run TPKE.SDec on CT to get M. If SDec outputs ⊥, return ⊥. Otherwise, run get calculate run Get M'. Run TPKE.Enc on M' to get CT'. Run get Finally, rewrite the algorithm to output a new set of random numbers Hash value, partially decrypted ciphertext CT',
[0050] S10: The modifier runs the update hash algorithm to update the time corresponding to the chameleon hash pair and outputs a new set of random numbers
[0051] The time at which the modifier runs this algorithm to update the chameleon hash pair. Algorithm input: If t′=t, then return Otherwise, continue if mode R = "private": run Algorithm. If the output is 0 or ⊥, then return ⊥. Then, calculate if return Similarly, the editor enters dk id,t (or sk (2) ) to ABE.Decrypt to recover M from CT. If it outputs ⊥, then return ⊥. Otherwise, run get calculate Run ABE.Offline.Enc((M,ρ),t′) to get IT″. Run get Finally, run ABE.Online.Enc((M,ρ),M″,IT″) and We obtain CT″ and If mode R = "public": run If the output is 0 or ⊥, return ⊥. Otherwise, calculate if return Run TPKE.SDec(pk tpke ,CT) to get M. If TPKE.SDec outputs ⊥, return ⊥. Otherwise, run get calculate run Get Updated Finally, run TPKE.Enc(pk tpke ,M″) to get CT″. Run get This update algorithm outputs
[0052] S11: Audit algorithm: KGC executes the audit algorithm to check whether the cloud server provides decryption services correctly and returns 0 or 1;
[0053] KGC executes the algorithm: Input secret long-term conversion key If mode C ≠"part-dec", then output ⊥. Otherwise, check whether If not, output 0 to indicate an incorrect decryption. Otherwise, output 1 to indicate a correct decryption.
[0054] S12: Revocation algorithm: KGC executes the revocation algorithm and outputs a new revocation list rl′.
[0055] KGC executes the algorithm: revoke the user id in time period t, add all nodes x and (x, t) associated with the identity id to the list rl, and output a new list rl′.
[0056] Define offline encryption ABE.Offline.Enc: The user calculates the offline ciphertext as follows during the offline phase: Represent (M,ρ) as an LSSS (Linear Secret Sharing Scheme, commonly used to define access policies for attribute-based encryption) access structure, where M is a Matrix. Calculation C0=g γ Then, for Random Selection And calculate C5=Q γ ,for calculate The output intermediate ciphertext is
[0057] Define the online encryption algorithm ABE.Online.Enc: The user calculates the offline ciphertext as follows during the offline phase: Randomly select a vector Where T represents the transpose of the matrix. Calculate a set of vector partitions of γ Calculate C = M key, C i,7 =λ i -λ′ i ,C i,8 =μ i ·(ρ(i)-x i ). The output of the complete ciphertext is
[0058] Define the ciphertext transformation algorithm Transform: The server executes this algorithm to partially decrypt the ciphertext: If the following conditions are not met, it returns ⊥: (1) And only if in every model that makes S true, is also true. (2) and (3)ctr+1≤σ, where σ is the service. (2) and (3) ctr+1≤σ, where σ is the maximum number of decryption times that the server can provide. If it exceeds the limit, it is considered as excessive illegal decryption behavior. (4) If Next, if the user is revoked at time t, return ⊥; otherwise, calculate the set I = (i:ρ(i)∈S) and the constant So that∑ i∈I w i M i =(1,0,…,0), where M i is the i-th row of M. Calculate Let (C′, C′0, C′4) = (C / B, C0, C4), CT′ = CT||(C′, C′0, C′4), modeC←“part-dec”. Output (CT′, mode C ).
[0059] Define the user decryption algorithm ABE.Dec: The user executes the algorithm: Calculate M as follows: If mode C = "part-dec": use dk id,t Decryption is as follows: Otherwise, return ⊥. Next, perform different operations according to different editing conditions: (1) If mode R = "private": set Run IT←ABE.Offline.Enc((M,ρ),t). Run CT←ABE.Online.Enc((M,ρ),M,IT). (2) If mode R = "public": Run Run CT←TPKE.Enc(pk tpke ,M).
[0060] The algorithm outputs a chameleon hash and a random number and a temporary trapdoor:
[0061] Embodiments can be implemented within a single solution:
[0062] (1) Efficient generation of editable blocks: With the help of offline pre-computation, the online computation overhead can be ignored on the user side;
[0063] (2) Efficient block re-editing: With the help of cloud servers to assist in decrypting ciphertext, the re-editing overhead on the user side can be ignored;
[0064] (3) Revocable editing permissions: The user's editing permissions are indirectly revocable with the help of the server. The user's editing permissions on the block are divided into valid periods;
[0065] (4) Revocable editing results: Breaking the uniqueness of Chameleon Hash (a security property), the update algorithm is used to achieve traceability and revocability of editing results (Chameleon Hash value). Together with the revocability of editing permissions, a dual (more stable) editing management architecture is formed.
[0066] (5) Public and private editing: By introducing time-controlled encryption TPKE, all users are allowed to publicly edit the content of the problem block after a certain period of time. This achieves complete decentralized editing. Together with attribute-based encryption-based editing, it forms a (public-private) optional editing strategy.
[0067] The embodiments described above are only descriptions of the preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.
Claims
1. A multifunctional blockchain editing method, characterized in that: The following steps are involved: 1) System initialization steps: The key center KGC initializes the system, initializes the revocation list and status, and outputs the system public parameters and master key; 2) Steps for generating periodic and revocable keys: The key center KGC generates a long-term conversion key pair based on the user identity id and attribute set and converts the long-term conversion key pair Send to the corresponding user; Update the key according to the master key, time t, revocation list and status generation cycle; The server converts the public key according to the long-term and periodically update the key to generate a short-term conversion key; The user's private key is converted based on long-term and time t to generate the short-term decryption key dk for the ciphertext after server-assisted decryption id,t ; 3) Blockchain editing steps: Calculate hash step: The user performs the calculation hash, according to the editing condition mode of public editing or private editing R Get the corresponding hash auxiliary aux H , outputs the Chameleon hash used to generate the block and random numbers And temporary trapdoor etd, complete block generation; Verification hash step: User verification includes Chameleon hashing Original code M, random number The validity of the Chameleon hash pair at time t. If the block verification is valid, proceed to the next step, otherwise the process ends; Rewrite the hashing step: hold editing permissions and long-term conversion key pairs and the short-term decryption key dk id,t The user acts as a modifier according to the long-term conversion private key Hash auxiliary aux H , Chameleon Hash Pair Rewrite code M ′ And the temporary trap door etd obtains the random number used for rewriting Using random numbers Complete block rewriting; Update hashing step: The modifier converts the private key based on the long term Hash auxiliary aux H , Chameleon Hash Pair Update time t ′ And the temporary trap door etd gets the random number for update Using random numbers Complete block update; Audit Steps: KGC uses long-term conversion private keys Check whether the server provides decryption services correctly and whether the decryption behavior of the server exceeds the limit; Revocation step: KGC revokes the user's editing permissions by periodically updating the revocation list; the revocation list contains all revoked user IDs within time t.
2. The method according to claim 1, characterized in that: Calculate the hash auxiliary aux in the hash step H The calculation method is: Among them, "public" is a public editor, "private" is a private editor, || is a string connection symbol, Z p is a p-element finite field in the system public parameters, p is a prime number, (M,ρ) is the access structure of the linear secret sharing scheme LSSS, M is the first element of the access structure, is the original code; ρ is the second element of the access structure.
3. The method according to claim 1, characterized in that: In the hash calculation step, hash verification step, hash rewriting step and hash update step, non-interactive zero-knowledge proof is first performed, and after the correctness is proved, the corresponding steps are processed.
Citation Information
Patent Citations
Forward security editable blockchain construction method suitable for alliance chain
CN111526009A
Distributed public key infrastructure construction method based on editable blockchain
CN112187455A
Time-locking-based chameleon hash method for block chain construction
CN116614237A
Block chain data editing method based on chameleon hash function
CN117134919A
Block chain dynamic editing method based on distributed key supervision
CN117372015A
Cited By
Editable block chain architecture supporting anonymous editing and permission revocation and implementation method thereof
CN119155015A
Editable block chain method supporting dynamic trap door
CN119402165A
A method of a key regression based editable blockchain
CN120415750B
