Key generation method, access control method, device and system
By negotiating the generation of group encryption keys and group decryption keys by participants in decentralized distributed scenarios such as blockchain, the security and efficiency of dynamic ciphertext access control are solved, and dynamic member management and security are achieved. Password access control.
Patent Information
- Application Number
- CN202411218554.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-11-12
AI Technical Summary
The existing dynamic ciphertext access control solutions have problems of insufficient security and high overhead in decentralized distributed scenarios such as blockchain, especially when users dynamically join and exit the security and efficiency of the system are difficult to ensure.
By negotiating and generating group encryption keys and group decryption keys by each participant during system initialization, dynamic members are supported to join and exit without the need for a trusted third party, and dynamic ciphertext is achieved using group encryption keys and group decryption keys. Access control, ensuring that only authorized members can decrypt the session key.
It realizes safe and convenient dynamic ciphertext access control in decentralized distributed scenarios, reduces the network load and user resource occupation of key generation, and supports dynamic member management without affecting system security.
Smart Images

Figure CN118944963A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification belong to the field of data security, and in particular, relate to a key generation method, a key-based access control method, and corresponding devices and systems. Background Art
[0002] Data security is increasingly becoming a focus of technical attention. In many technical scenarios, dynamic ciphertext access control is required. A dynamic ciphertext access control scheme is an encryption scheme that can grant decryption permissions to any set of users. The sender can specify a set S that can decrypt the ciphertext. Only members of S can decrypt the ciphertext, and other unauthorized parties cannot decrypt it. At the same time, the sender can dynamically add and delete decryptable members in S.
[0003] Dynamic ciphertext access control has strong technical requirements in distributed scenarios such as blockchain. Blockchain is a new distributed infrastructure and computing paradigm built on a peer-to-peer (P2P) network, using chain data structures to verify and store data, using distributed node consensus algorithms to generate and update data, using cryptography to ensure the security of data transmission and access, and using smart contracts composed of automated script codes to program and operate data. In blockchain systems, access control to data is a basic and common security requirement.
[0004] Therefore, it is hoped that an improved solution can be developed to achieve dynamic access control of data safely and conveniently. Summary of the invention
[0005] The purpose of the present invention is to provide a key generation method and an access control method, which can realize dynamic access control of data safely and conveniently.
[0006] A first aspect of the present specification provides a method for generating a key, which is performed by a kth participant in a target system including n participants, comprising:
[0007] Generate the kth public key part according to the first public parameter and the selected target random value, and make it public;
[0008] Combine the n-1 public key parts disclosed by n-1 other participants with the kth public key part to obtain the group encryption key shared by all parties;
[0009] Generate a private key matrix according to the first public parameter, the second public parameter and the target random value, wherein the i-th row represents a private key vector generated for the i-th participant; the second public parameter includes n parameter values representing n participants;
[0010] Exchange with n-1 other participants respectively, and obtain n-1 receiving vectors for the private key vector generated by the other party;
[0011] Generate a group decryption key of the party based on the n-1 received vectors and the private key vector for the party itself in the private key matrix.
[0012] A second aspect of the present specification provides an access control method, which is executed in a target system, wherein the target system includes n participants, and any participant holds a common group encryption key and its own group decryption key through the method of claim 1, and the method comprises:
[0013] The first participant determines a subset of participants who are entitled to obtain the plaintext of the message, including m selected participants;
[0014] The first participant generates a current random number, generates a session key based on the group encryption key and the current random number; and generates an auxiliary ciphertext based on the current random number, the first public parameter set, and m parameter values representing the m selected participants in the second public parameter set;
[0015] The first participant discloses the auxiliary ciphertext;
[0016] Any participant among the m selected participants uses the auxiliary ciphertext and the elements in its group decryption key corresponding to the m selected participants to decrypt and obtain the session key.
[0017] A third aspect of the present specification provides a device for generating a key, which is deployed in a kth participant in a target system, wherein the target system includes n participants, and the device includes:
[0018] a public key part generating unit, configured to generate a kth public key part according to the first public parameter and the selected target random value, and make it public;
[0019] an encryption key generation unit configured to combine n-1 public key parts disclosed by n-1 other parties with the kth public key part to obtain a group encryption key common to all parties;
[0020] A private key matrix generating unit is configured to generate a private key matrix according to the first public parameter, the second public parameter and the target random value, wherein the i-th row represents a private key vector generated for the i-th participant; the second public parameter includes n parameter values representing n participants;
[0021] The private key vector exchange unit is configured to exchange with n-1 other participants respectively, and obtain n-1 receiving vectors for the private key vectors generated by the other party;
[0022] The decryption key generating unit is configured to generate a group decryption key of the party based on the n-1 received vectors and the private key vector for the party in the private key matrix.
[0023] A fourth aspect of the present specification provides an access control system, the system comprising n participants, any participant holding a common group encryption key and its own group decryption key through the device of claim 15, wherein:
[0024] The first party among the n parties is used to determine a subset of parties that are entitled to obtain the plaintext of the message, including the m selected parties;
[0025] The first party is further configured to generate a current random number, generate a session key based on the group encryption key and the current random number, and generate an auxiliary ciphertext based on the current random number, the first public parameter set, and m parameter values representing the m selected parties in the second public parameter set;
[0026] The first participant is further used to disclose the auxiliary ciphertext;
[0027] Any participant among the m selected participants is used to decrypt and obtain the session key using the auxiliary ciphertext and the elements in its group decryption key corresponding to the m selected participants.
[0028] The fifth aspect of the present specification provides a computer program product, comprising a computer program / instruction, which implements the steps of the first and second aspects of the method when executed by a processor.
[0029] A sixth aspect of the present specification provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the methods described in the first and second aspects.
[0030] A seventh aspect of the present specification provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the methods described in the first and second aspects are implemented.
[0031] In an eighth aspect, the present specification provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the methods described in the first and second aspects are implemented.
[0032] The scheme provided by the above aspects supports dynamic ciphertext access control through group keys in decentralized distributed scenarios. According to the scheme, for a target system composed of n participants, when the system is initialized, there is no need to set up a trusted third party to keep the key. Instead, each participant in the system generates a group encryption key and a respective group decryption key through negotiation. In the session phase, any one of the n participants can act as a sender, specify a set of receivers, and use the group encryption key to encrypt and generate a session key, which is then published to the system. The participants in the receiver set can use their own group decryption key to decrypt the session key, thereby having the authority to decrypt the ciphertext. Participants outside the receiver set in the system cannot decrypt the session key and do not have the decryption authority. Furthermore, the generation of the group key in the scheme supports the dynamic joining and exit of members without affecting the security of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0034] Figure 1 A method for generating a key according to one embodiment is shown;
[0035] Figure 2 An example of the complete process of system initialization in one embodiment is shown;
[0036] Figure 3 A schematic diagram showing an access control method according to an embodiment;
[0037] Figure 4 A schematic diagram showing access control at the session stage in one embodiment;
[0038] Figure 5 Shows the process of updating keys when a new party joins the system;
[0039] Figure 6 A schematic diagram of the logical structure of a key generating device according to an embodiment is shown. DETAILED DESCRIPTION
[0040] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0041] Access control, also known as data access control, ciphertext access control, and dynamic permission control, is a control scheme implemented in various technical scenarios to protect data security. According to the access control scheme, the data owner will specify that the data is shared with a certain set of users, and at the same time require that other users have no right to access the data.
[0042] In a centralized scenario, the privacy of user data has various risks. In the embodiments of this specification, the access control problem in a decentralized distributed scenario is considered. A typical implementation of a decentralized distributed scenario is a blockchain system.
[0043] Blockchain is a tamper-proof, shared digital ledger that records transactions in public or private peer-to-peer networks. Turing-complete smart contracts can be run on it. Access control is a basic security requirement for blockchain applications. Data owners can share data with the people they specify without leaking any information about the original data to others in the process.
[0044] Due to the characteristics of the blockchain system itself, access control in the blockchain often involves the following issues. On the one hand, as a decentralized system, the blockchain cannot use a centralized server for unified permission management. On the other hand, the digital information records in the blockchain are permanent and cannot be tampered with, and this information is often stored in distributed nodes all over the world. The storage space of each node is limited and the information exchange between nodes is frequent. If the storage overhead required for the ciphertext is too high, it will inevitably increase the network load and occupy more user resources. In addition, because the network nodes and users in the smart contract are often dynamically changing, the dynamic joining and exit of users may affect the normal operation of the access control mechanism scheme. At the same time, it is particularly necessary to consider the situation where the adversary may collude with the system users to steal the private information of other users.
[0045] Although some solutions for dynamic ciphertext access control have been proposed in the related art, these solutions still have some shortcomings in the above-mentioned problems. For example, the Contributory Broadcast Encryption (ConBE) scheme is proposed in the related art. This scheme uses an asymmetric group key negotiation mechanism to achieve decentralization, and the ciphertext contains only two group elements. The basic idea of ConBE is to first define a revocation set (i.e., a set of users who cannot decrypt the ciphertext), and then use the public key corresponding to the set to encrypt the plaintext. Only users who do not belong to the set can decrypt the ciphertext. However, the ConBE scheme is static. If a new user joins the system, the system needs to completely reset the Setup, which has a large time and space overhead of up to O(n^3). In addition, the encryption system has a little loophole in terms of security. For example, when a new user joins the ConBE system, because he is not in the revoked user set, the user naturally has the decryption permission and cannot be revoked. Therefore, when a new user joins the system, the security of the previously transmitted ciphertext cannot be guaranteed.
[0046] Dynamic Contributory Broadcast Encryption (DConBE) is an improvement on ConBE. When the system is initialized, all users will negotiate to generate relevant keys, so that the scheme supports dynamic changes in users. However, the DConBE scheme requires the establishment of a trusted organization responsible for generating a large number of system parameters and certificates, which cannot be fully decentralized.
[0047] In view of this, in the embodiments of this specification, a new encryption scheme is proposed, which supports dynamic ciphertext access control through group keys in decentralized distributed scenarios. The distributed scenarios may include blockchain scenarios, Internet of Vehicles scenarios, Internet of Things scenarios, or other scenarios of access control between equivalent communication devices. According to the scheme, for a communication system composed of n participants, when the system is initialized, it is not necessary to set up a trusted third party to keep the key, but each participant in the system generates a group encryption key and a respective group decryption key through negotiation. In the session phase, any one of the n participants can act as a sender, specify a set of receivers, and use the group encryption key to encrypt and generate a session key, which is published to the system. The participants in the receiver set can use their own group decryption key to decrypt the session key, thereby having the authority to decrypt the ciphertext. The participants outside the receiver set in the system cannot decrypt the session key and do not have the decryption authority. Furthermore, the generation of the group key in the scheme supports the dynamic joining and exit of members without affecting the security of the system.
[0048] The following describes each stage of the above scheme respectively.
[0049] Figure 1 A method for generating a key according to an embodiment is shown, and the method is performed by the kth participant in a target system including n participants. In an example, the target system is a blockchain system, and the n participants are specifically n users or accounts in the blockchain system, represented by U = {u1,u2,…,u n}. Accordingly, the method is executed by the device where any k-th user is located. The following is described with reference to examples of blockchain, in which for the sake of intuitiveness and clarity, in some examples, users are directly used to refer to participants.
[0050] In execution Figure 1 Before the step, each user generates common initialization parameters. Specifically, each user selects the following data set in, are two cyclic groups, e is the pairing function between the two cyclic groups, and the result of the pairing function belongs to the cyclic group Each user takes and The generators g1 and g2 in constitute the first common parameter. In addition, n random The elements h1,h2,...,h n , represents the transition from user u1 to user u n , these n parameters constitute the second common parameters.
[0051] It is important to understand that the pairing function e between cyclic groups has the following properties:
[0052]
[0053] Due to the decentralized nature of users, the above public parameters, including the first public parameter and the second public parameter, are independently generated by each participant based on an agreed data source and an agreed algorithm. For example, each user can agree on a data source as a data seed (such as a common random number generator, or a publicly accessible data source), and generate public parameters based on the data seed using an agreed algorithm (such as a hash algorithm). In this way, each user holds common public parameters.
[0054] In one implementation, each user, such as user k, also generates his / her own party private key and the public keys of the participating parties For subsequent encrypted communication with other users. In one example, user k can use the ElGamal algorithm to generate a participant private key and a participant public key. Specifically, user k can select a pair of random numbers as the participant private key of his party, that is, Then, according to the first common parameters g1, g2 and a pair of random numbers (a 1,k ,a 2,k ), generate the party's public key And make it public. Specifically, the public key of the participating party can be expressed as:
[0055]
[0056] On the basis of the completion of the above preparatory work, Figure 1 Step 1, execute the process of generating the group key.
[0057] In step S11, party k generates the kth public key part according to the first public parameter and the selected target random value, and makes it public.
[0058] The target random value selected by user k is recorded as x k , then user k is based on the first public parameter g1, g2 and the random value x k , generate the kth public key part PK k Specifically, the public intermediate result is exponentially raised to the target random value x k The kth public key part is obtained by performing an operation, wherein the public intermediate result is the calculation result of the pairing function e between the two generators in the first public parameter.
[0059] The kth public key part PK calculated in this way k As shown below:
[0060]
[0061] User k can make public the kth public key part PK k , for example, publish it on the blockchain. Correspondingly, user k can also obtain the i-th public key part published by any other user i among n users from the blockchain, thereby obtaining the n-1 public key parts published by the other n-1 participants.
[0062] Therefore, in step S13, the n-1 public key parts disclosed by n-1 other participants can be combined with the kth public key part to obtain the group encryption key PK common to all parties.
[0063] Specifically, each user can obtain n-1 public key parts disclosed by n-1 other participants, as well as their own public key parts. By combining these n public key parts, the group encryption key PK can be obtained. The combination method can be multiplying the n public key parts. That is, each user calculates the group encryption key PK as follows:
[0064]
[0065] Thus, each user obtains a common group encryption key PK.
[0066] On the other hand, each user also needs to generate a corresponding group decryption key. Compared with the group encryption key PK, the generation process of the group decryption key is more complicated.
[0067] like Figure 1 As shown in step S15, the participant k calculates the random value x according to the first public parameter, the second public parameter and the target random value x. k , generate a private key matrix, where the i-th row represents the private key vector generated for the i-th participant.
[0068] Specifically, user k corresponds to n parameter values h1, h2, ..., h of n users according to the first common parameters g1, g2. n , and the aforementioned target random value x k , a private key vector is generated for each user (including itself), and n private key vectors constitute the above private key matrix. In one example, user k generates the following private key matrix:
[0069]
[0070] The bold d i,k Indicates the private key vector generated by user k for user i. The non-bold d i,j,k Represents that the vector d i,k The jth element in r i,k represents the random number selected by user k for user i.
[0071] It can be seen that the private key vector d generated by user k for any user i i,k is an n+1-dimensional vector, the first element of which is a function of the second generator g2 and the i-th random number r selected for the i-th user. i,k The next n elements are generated according to the n parameter values h1,h2,...,h n and the i-th random number r i,k Generate, and the i-th element in the last n elements is different from the others, which also depends on the first generator g1 and the target random value x k .
[0072] The above describes the private key matrix generated by user k, which contains n-1 private key vectors generated for other n-1 participants and the private key vector d generated for itself. k,k It can be understood that each of the n users in the system generates a private key matrix in the above manner.
[0073] After the private key matrix is generated as described above, in step S17, the participant k exchanges with n-1 other participants respectively, and obtains n-1 receiving vectors for the private key vectors generated by the other party.
[0074] In one example, each participant has established an encrypted communication channel with each other. At this time, participant k can exchange the private key vector generated for each other with any other participant i through the encrypted channel between the two. That is, participant k sends the private key vector d to participant i. i,k , and receives from it the private key vector d generated by participant i for participant k k,i .
[0075] In another example, each participant uses the other party's public key to encrypt the private key vector and provides it to the other party.
[0076] Specifically, in the blockchain scenario, for any other user i, user k uses the participant public key of the other user i Encrypt its corresponding private key vector d i,k , and provide the encryption vector to the user i. For example, the encryption vector can be published on the blockchain. Since it has been encrypted and can only be decrypted with the corresponding party's private key, this process does not affect the security of the private key vector.
[0077] The above uses the public key of user i Encrypt the corresponding private key vector d i,k , that is, for the private key vector d i,k Each element in is encrypted separately, and the vector formed by the encrypted elements is the encrypted vector The process can be expressed as:
[0078]
[0079] in:
[0080]
[0081]
[0082] In formula (7), t i,j,k ,s i,0,k are random values selected by user k.
[0083] Correspondingly, user k also receives encryption vectors from other users i It is the public key of the participant using user k Encrypt the private key vector d generated by user i for user k k,i The income, that is User k can use his party's private key For the above encryption vector Decrypt and restore the private key vector as the receiving vector.
[0084] Therefore, it can be understood that participant k can obtain the encryption vectors for the kth participant provided by n-1 other participants respectively, and obtain n-1 receiving vectors after decrypting them using its own participant private key.
[0085] Next, in step S19, party k generates its group decryption key based on the n-1 received vectors and its own private key vector in the private key matrix.
[0086] Specifically, the n-1 receiving vectors obtained by participant k and the private key vector for itself in the private key matrix generated by it can form n private key vectors for participant k. These n private key vectors can form another matrix, which can be called the target matrix. The dimension of the target matrix is the same as the aforementioned private key matrix, which is n*(n+1) dimensions. Participant k can combine the n private key vectors in the target matrix to obtain its group decryption key SK k Specifically, the above combination method may be a concatenated multiplication of n vectors.
[0087] For example, user k in the blockchain can calculate his group decryption key as follows:
[0088]
[0089] Among them, r k =r k,1 +…+r k,n
[0090] As you can see, the above group decryption key is also an n+1-dimensional vector, where the first element is The following n elements are based on n parameter values h1,h2,...,h n Get, which corresponds to n users in turn.
[0091] Through the above method, each participant generates its own group decryption key.
[0092] Figure 2 An example of the complete process of system initialization in one embodiment is shown. Figure 2 The example system includes n users U = {u1, u2, ..., u n}. In step (1), each of the n users in the system generates common system parameters. In step (2), each user generates a public and private key pair for each participant by using the ElGamal algorithm. Private Key Own public key Open to the public.
[0093] Then, in step (3), each user generates his or her own secret random value. As shown in the figure, user 1 generates x1, user 2 generates x2, and user k generates x k Any user k can choose a random value x according to his / her secret k , and public parameters, generate the kth public key part PK k and the private key matrix {d i,k}.
[0094] In step (4), user k performs ElGamal encryption on his private key matrix, i.e., using the ElGamal public key of user i Encrypt its corresponding private key vector d i,k In parallel, in step (5), each user sends the public key parts PK of all n users to k Aggregate to obtain the group encryption key PK.
[0095] In step (6), user k exchanges / shares the encrypted private key matrix with other users In step (7), user k uses the ElGamal private key The private key vector generated by other users Decrypt and aggregate the decrypted private key vector to obtain the kth group of decryption keys SK k .
[0096] Finally, each user has the group encryption key PK and its own group decryption key SK k It can be understood that the group encryption key and the group decryption key obtained in the above manner have only a constant size, and the key generation process adds very little to the network load and occupies very little user resources.
[0097] The following describes a method for performing access control at the session stage using the group encryption key and group decryption key generated above.
[0098] Figure 3 A schematic diagram of an access control method according to an embodiment is shown. The method is executed in the system as described above, the system includes n participants, and any participant can Figure 1 The access control process includes the following steps:
[0099] In step 31, party k determines the subset of parties that have the right to obtain the plaintext of the message. The subset S includes the participant numbers or identifiers of m selected participants. Participant k here is any participant in the system who wants to share data conditionally. He can select some participants in the system and allow them to obtain the plaintext of the message. Participant k adds these selected participants to the above subset S.
[0100] In one embodiment, the participant k discloses the subset S. For example, the subset can be disclosed to all n participants in the entire system. For example, in a blockchain scenario, the subset can be published on the chain. Alternatively, the participant k needs to at least share the subset with each selected participant in the subset.
[0101] In step 32, party k generates a current random number t, and generates a session key K based on the group encryption key PK and the current random number t.
[0102] Specifically, party k can calculate the session key as follows:
[0103] K=PK t (9)
[0104] In step 33, the participant k generates an auxiliary ciphertext according to the current random number t, the first public parameter set, and the m parameter values representing the m selected participants in the second public parameter set.
[0105] Specifically, in one embodiment, participant k generates a first ciphertext part based on the second generator g2 in the first public parameter set and the current random number t, and generates a second ciphertext part based on the m parameter values corresponding to the m selected participants and the current random number t. The first ciphertext part and the second ciphertext part constitute the auxiliary ciphertext.
[0106] For example, participant k can calculate the first ciphertext part c1 as follows:
[0107]
[0108] And calculate the second ciphertext part c2 according to the following formula:
[0109] c2=(∏ i∈S h i ) t (11)
[0110] In formula (11), the parameter value h for the selected participant i belonging to the subset S is i Perform multiplication.
[0111] In this way, participant k obtains the auxiliary ciphertext C = (c1, c2).
[0112] In step 34, party k publishes the auxiliary ciphertext.
[0113] In the blockchain scenario, user k can publish the auxiliary ciphertext on the chain so that all participants can obtain the auxiliary ciphertext. In other scenarios, participant k can make the auxiliary ciphertext public through other means, such as broadcasting within the system. The scope of public disclosure of the auxiliary ciphertext may not be limited to the participants in the subset S.
[0114] Next, in step 35, any participant among the m selected participants uses the auxiliary ciphertext and the elements in its group decryption key corresponding to the m selected participants to decrypt and obtain the session key K.
[0115] Specifically, any selected participant i can use its group decryption key SK i , and the auxiliary ciphertext performs the following decryption operation:
[0116] P=e(∏ j∈S SK i,j ,c1)e(c2,SK i,0 ) (12)
[0117] In the above formula (12), SK i,0 It's SK i The first element in SK i,j It's SK i The element corresponding to participant j in the group decryption key belongs to the subset S. That is, the pairing function e is used to perform a pairing operation on the product of the elements corresponding to the m selected participants in the group decryption key and the first ciphertext part to obtain a first pairing result. The second ciphertext part is also paired with the first element in the group decryption key to obtain a second pairing result, and the first pairing result is combined with the second pairing result to obtain a decryption result P.
[0118] It is proved below that the above decryption result P is equivalent to the session key K.
[0119]
[0120] The transformation from equation (13) to (14) utilizes the properties of the pairing function shown in equation (1).
[0121] In this way, the participants in the subset S can use the auxiliary ciphertext and their group decryption key to decrypt the session key. However, the participants who do not belong to the subset cannot decrypt the session key.
[0122] It can be understood that after the participant k generates the session key K, the session key K can be used to encrypt the target message to be transmitted, obtain the message ciphertext, and make it public. After decrypting and obtaining the session key K, any participant among the m selected participants can use the session key K to decrypt the message ciphertext and obtain the plaintext of the target message. However, the participants outside the selected participant subset S cannot decrypt the session key K, so even if they receive the message ciphertext, they cannot decrypt the message.
[0123] Therefore, dynamic ciphertext access control is achieved through the group encryption key PK and the group decryption key of each participant.
[0124] Figure 4 A schematic diagram showing access control during the session phase in one embodiment is shown. Figure 4 In step (1), the sender user k selects a receiver set, such as user 1 and user 2 shown in the figure. Then, user k uses the group encryption key to encrypt the session key K and the auxiliary ciphertext CT. In step (2), user k sends the auxiliary ciphertext CT. In step (3), the users in the receiver set each use their group decryption key to decrypt the auxiliary ciphertext CT to obtain the session key K. As a result, the users in the receiver set obtain the right to decrypt the message ciphertext.
[0125] Furthermore, the group encryption key and group decryption key generated in the above manner can not only be used to implement dynamic access control, but also support dynamic joining and exit of participants.
[0126] In one scenario, after the system of n participants is initialized, a new participant joins the system, and the new participant can be recorded as the n+1th participant. Figure 5 Shows the process of updating keys when a new party joins the system.
[0127] Before updating the key, after the n+1th participant joins the system, each participant first updates the public parameters together, for example, adding the parameter h corresponding to the n+1th participant. n+1 The n+1th participant shall Figure 1 Step S11 in the above example generates the n+1th public key part PK. n+1 , and make it public to all participants in the system.
[0128] In step S51, any participant k in the system can superimpose the n+1th public key part PK disclosed by the n+1th participant on the original group encryption key. n+1 , get the updated group encryption key.
[0129] For the group decryption key, in step S52, participant k needs to update its private key matrix so that it contains the elements related to the n+1th participant.
[0130] Specifically, in one embodiment, the participant k may add a new row in the original private key matrix, where the new row corresponds to the private key vector generated for the n+1th participant; and add a new column in the original private key matrix, where the elements in the new column are based on the new n+1th parameter value h added in the updated second public parameter. n+1 get.
[0131] For example, based on the original private key matrix of n rows and n+1 columns shown in formula (5), a row vector d generated for the n+1th participant can be added to the matrix n+1,k , and add a new column on the right, where the new column element in the original i-th row is
[0132] Then, in step S53, participant k exchanges elements related to the n+1th participant with other participants to obtain a newly added element corresponding to the n+1th participant.
[0133] Specifically, in one embodiment, participant k exchanges newly added column elements in the private key matrix with the original n-1 other participants. For the n+1th participant, participant k exchanges the private key vector (row element) generated for each other with it. That is, participant k provides d n+1,k , obtain d from the n+1th participant k,n+1 The newly added column elements obtained by exchange, and the private key vector obtained by exchange, are all newly added elements corresponding to the n+1th participant.
[0134] In step S54, participant k adds the above-added elements to the original group decryption key to obtain an updated group decryption key. Specifically, participant k adds these added elements to the original group decryption key SK according to the principle of the above formula (8). k For example, add a new private key vector d k,n+1 Each element of is multiplied by the original key element, and the key element of the n+2th dimension is added It is generated based on the newly added column elements of each participant.
[0135] In this way, participant k updates the group encryption key and its own group decryption key of the new system suitable for n+1 participants.
[0136] In another scenario, in a system with n participants, participant j exits the system. In this case, any participant k who is still in the system can remove the jth public key part PK corresponding to the jth participant from the original group encryption key PK. jSpecifically, the original group encryption key PK can be divided by the jth public key part to calculate the updated group encryption key.
[0137] For the group decryption key, participant k can obtain the original group decryption key SK k Remove the element part related to the jth participant from the SK to obtain the updated group decryption key. This process is the opposite of the above process of adding elements. Specifically, based on the original SK k Each vector element of is divided by the d provided by participant j k,j The corresponding elements in , and then delete the elements corresponding to participant j The updated group decryption key can be obtained.
[0138] Therefore, no matter new participants join the system or existing participants withdraw, the remaining participants can update based on the original group encryption key and group decryption key to quickly obtain new keys suitable for the new member composition.
[0139] It should also be understood that, although the above description is described in combination with the blockchain scenario, the distributed system to which the above solution is applicable is not limited to the blockchain, but can also be applied to other communication systems. For example, it can be applied to communication access control in the vehicle networking scenario. In this scenario, assuming that a certain road section needs to provide traffic information and navigation services about the road section for vehicles passing through, each vehicle terminal and network node located in the road section can be regarded as a participant, and they can be constructed as a system. After the system is established, each vehicle terminal generates a group encryption key and a group decryption key in the above manner. Thus, each vehicle terminal can perform encrypted communication with any vehicle terminal set S or network node of the road section, share data information, such as vehicle location, status parameters, traffic information, etc., to facilitate users to understand the road conditions in real time. In this process, only the sender can grant relevant decryption permissions, and other system users who are not in the receiver set have no right to view the data. When a vehicle enters the road section, the vehicle terminal can apply to join the system and establish communication with other terminals in the system to obtain relevant services. When a vehicle leaves the road section, the vehicle terminal will notify other vehicles or network nodes that the service has ended, cut off communication, and thus exit the system.
[0140] Similarly, the participants may also be devices in other communication scenarios, such as IoT devices, etc., which are not listed here one by one.
[0141] According to another embodiment of the present specification, a device for generating a key is also provided, which is deployed in the kth participant in the target system, wherein the target system includes n participants, wherein any participant can be implemented by any device, platform or device cluster with data storage, computing and processing capabilities. Figure 6 FIG. 2 shows a schematic diagram of the logical structure of a key generation device according to an embodiment. Figure 6 As shown, the generating device 600 includes:
[0142] A public key part generating unit 61 is configured to generate a kth public key part according to the first public parameter and the selected target random value, and make it public;
[0143] an encryption key generation unit 63 configured to combine n-1 public key parts disclosed by n-1 other participants with the kth public key part to obtain a group encryption key common to all parties;
[0144] The private key matrix generating unit 65 is configured to generate a private key matrix according to the first public parameter, the second public parameter and the target random value, wherein the i-th row represents the private key vector generated for the i-th participant; the second public parameter includes n parameter values representing n participants;
[0145] The private key vector exchange unit 67 is configured to exchange with n-1 other participants respectively, and obtain n-1 receiving vectors for the private key vectors generated by the other party;
[0146] The decryption key generating unit 69 is configured to generate a group decryption key of the party based on the n-1 received vectors and the private key vector for itself in the private key matrix.
[0147] For examples of specific implementations of the key generation device 600 and each unit therein, please refer to the above examples and descriptions in conjunction with the key generation method, which will not be repeated here.
[0148] According to another embodiment, the present specification also provides an access control system, which includes n participants, and any participant holds a common group encryption key and its own group decryption key through the aforementioned method or device. In the access control system:
[0149] The first party among the n parties is used to determine a subset of parties that are entitled to obtain the plaintext of the message, including the m selected parties;
[0150] The first party is further configured to generate a current random number, generate a session key based on the group encryption key and the current random number, and generate an auxiliary ciphertext based on the current random number, the first public parameter set, and m parameter values representing the m selected parties in the second public parameter set;
[0151] The first participant is further used to disclose the auxiliary ciphertext;
[0152] Any participant among the m selected participants is used to decrypt and obtain the session key using the auxiliary ciphertext and the elements in its group decryption key corresponding to the m selected participants.
[0153] For examples of specific implementations of the above system and each participant therein, please refer to the examples and descriptions of the aforementioned access control method, which will not be repeated here.
[0154] According to yet another embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the aforementioned key generation method and / or access control method.
[0155] According to yet another embodiment, a computer program product is provided, including a computer program / instruction, which implements the aforementioned key generation method and / or access control method when executed by a processor.
[0156] According to yet another embodiment, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the aforementioned key generation method and / or access control method is implemented.
[0157] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0158] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0159] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a server system. Of course, the present application does not exclude that with the development of computer technology in the future, the computer that implements the functions of the above embodiments may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0160] Although one or more embodiments of the present specification provide method operation steps as described in the embodiments or flow charts, more or less operation steps may be included based on conventional or non-creative means. The order of steps listed in the embodiments is only one way of executing the order of many steps, and does not represent the only execution order. When the device or terminal product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the drawings (for example, a parallel processor or a multi-threaded processing environment, or even a distributed data processing environment). The term "include", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, product or equipment including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such a process, method, product or equipment. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or equipment including the elements. For example, if the words first, second, etc. are used to represent the name, they do not represent any specific order.
[0161] For the convenience of description, the above devices are described in various modules according to their functions. Of course, when implementing one or more of the present specification, the functions of each module can be implemented in the same or more software and / or hardware, or the module implementing the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. 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 devices or units, which can be electrical, mechanical or other forms.
[0162] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatus (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 generate 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.
[0163] 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 comprising 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.
[0164] 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 The steps for the functions specified in one or more boxes.
[0165] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0166] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0167] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage, graphene storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0168] It should be understood by those skilled in the art that one or more embodiments of the present specification may be provided as a method, system or computer program product. Therefore, one or more embodiments of the present specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, one or more embodiments of the present specification 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.
[0169] One or more embodiments of the present specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0170] Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. In the description of this specification, the description of the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of this specification. In this specification, the schematic representation of the above terms does not necessarily target the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples without contradiction.
[0171] The above description is only an example of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. For those skilled in the art, one or more embodiments of the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims.
Claims
1. A method for generating a key, performed by a kth participant in a target system including n participants, comprising: Generate a kth public key part according to the first public parameter and the selected target random value, and make it public; Combine the n-1 public key parts disclosed by n-1 other participants with the kth public key part to obtain the group encryption key shared by all parties; Generate a private key matrix according to the first public parameter, the second public parameter and the target random value, wherein the i-th row represents a private key vector generated for the i-th participant; the second public parameter includes n parameter values representing n participants; Exchange with n-1 other participants respectively, and obtain n-1 receiving vectors for the private key vector generated by the other party; Generate a group decryption key of the party based on the n-1 received vectors and the private key vector for the party itself in the private key matrix.
2. The method according to claim 1, wherein: Exchange with n-1 other participants respectively, and generate private key vectors for each other, including: For any other participant, encrypt the corresponding private key vector using the participant public key of the other participant, and provide the encrypted vector to the other participant; The encryption vectors for the kth participant provided by n-1 other participants are obtained, and the n-1 receiving vectors are obtained after being decrypted using the participant's private key of the party.
3. The method according to claim 2, wherein: The target system is a blockchain system, and the n participants are n accounts in the blockchain system; Providing the encryption vector to the other party includes: Publish the cryptographic vector to the blockchain.
4. The method according to claim 2, further comprising: Select a pair of random numbers as the party's private key; Based on the first public parameter and the pair of random numbers, generate the party's public key and make it public.
5. The method according to claim 1, wherein: The first common parameter includes a first generator of the first group and a second generator of the second group; The generating of the kth public key part comprises: An operation with a power of the target random value xk is applied to the public intermediate result to obtain a kth public key part, wherein the public intermediate result is a calculation result of a preset pairing function between the first generator and the second generator.
6. The method according to claim 5, wherein: Combining the n-1 public key parts disclosed by n-1 other participants with the kth public key part includes: The n-1 public key parts are multiplied by the kth public key part.
7. The method according to claim 1, wherein: The first public parameter includes a first generator of a first group and a second generator of a second group; the private key vector generated for the i-th participant is an n+1-dimensional vector, wherein the first element is generated according to the second generator and the i-th random number selected for the i-th participant, and the next n elements are respectively generated according to the n parameter values and the i-th random number, and the i-th element among the next n elements also depends on the first generator and the target random value.
8. The method according to claim 1, wherein: Generate a group decryption key, including: The n-1 received vectors are multiplied with the private key vector for the private key matrix, and the obtained result vector is used as the group decryption key.
9. The method according to claim 1, further comprising, when the jth participant among the n participants exits the target system: removing the jth public key portion corresponding to the jth participant from the group encryption key to obtain an updated group encryption key; The element portion related to the j-th party is removed from the group decryption key to obtain an updated group decryption key.
10. The method according to claim 1, further comprising, when an n+1th participant joins the target system: superimposing the n+1th public key part disclosed by the n+1th participant on the group encryption key to obtain an updated group encryption key; Updating the private key matrix to include elements related to the n+1th participant; Exchange the elements related to the n+1th participant with other participants to obtain the newly added elements corresponding to the n+1th participant; The newly added element is superimposed on the group decryption key to obtain an updated group decryption key.
11. The method according to claim 10, wherein: Updating the private key matrix comprises: Adding a new row to the private key matrix, where the new row corresponds to the private key vector generated for the (n+1)th participant; A new column is added to the private key matrix, and the elements in the new column are obtained according to the newly added (n+1)th parameter value in the updated second public parameter.
12. The method according to claim 11, wherein: Exchange elements related to the n+1th participant with other participants, including: Exchange with the n-1 other participants the elements in the newly added columns in their respective private key matrices; Exchange with the (n+1)th participant the private key vectors generated by each other for the other party.
13. The method according to claim 1, wherein: The first public parameter and the second public parameter are independently generated by each participating party based on an agreed data source and an agreed algorithm.
14. An access control method, executed in a target system, the target system comprising n participants, any participant holding a common group encryption key and its own group decryption key through the method of claim 1, the method comprising: The first participant determines a subset of participants who are entitled to obtain the plaintext of the message, including m selected participants; The first party generates a current random number, and generates a session key based on the group encryption key and the current random number; and generating an auxiliary ciphertext according to the current random number, the first public parameter set, and m parameter values representing the m selected parties in the second public parameter set; The first participant discloses the auxiliary ciphertext; Any participant among the m selected participants uses the auxiliary ciphertext and the elements in its group decryption key corresponding to the m selected participants to decrypt and obtain the session key.
15. The method according to claim 14, further comprising: The first participant encrypts the target message using the session key to obtain a ciphertext of the message and makes it public; Any participant among the m selected participants uses the session key obtained by decryption to decrypt the message ciphertext and obtain the plaintext of the target message.
16. The method according to claim 14, wherein: The generating of auxiliary ciphertext comprises: The participant k generates a first ciphertext part according to the second generator in the first public parameter set and the current random number; A second ciphertext part is generated according to the m parameter values corresponding to the m selected participants and the current random number; the first ciphertext part and the second ciphertext part constitute the auxiliary ciphertext.
17. A device for generating a key, deployed in a kth participant in a target system, wherein the target system includes n participants, the device comprising: a public key part generating unit, configured to generate a kth public key part according to the first public parameter and the selected target random value, and make it public; an encryption key generation unit configured to combine n-1 public key parts disclosed by n-1 other parties with the kth public key part to obtain a group encryption key common to all parties; A private key matrix generating unit is configured to generate a private key matrix according to the first public parameter, the second public parameter and the target random value, wherein the i-th row represents a private key vector generated for the i-th participant; the second public parameter includes n parameter values representing n participants; The private key vector exchange unit is configured to exchange with n-1 other participants respectively, and obtain n-1 receiving vectors for the private key vectors generated by the other party; The decryption key generating unit is configured to generate a group decryption key of the party based on the n-1 received vectors and the private key vector for the party in the private key matrix.
18. An access control system, the system comprising n participants, any participant holding a common group encryption key and its own group decryption key through the apparatus of claim 15, wherein: The first party among the n parties is used to determine a subset of parties that are entitled to obtain the plaintext of the message, including the m selected parties; The first participant is further configured to generate a current random number, and generate a session key based on the group encryption key and the current random number; and generating an auxiliary ciphertext according to the current random number, the first public parameter set, and m parameter values representing the m selected parties in the second public parameter set; The first participant is further used to disclose the auxiliary ciphertext; Any participant among the m selected participants is used to decrypt and obtain the session key using the auxiliary ciphertext and the elements in its group decryption key corresponding to the m selected participants.
19. A computer program product, comprising a computer program / instructions, which, when executed by a processor, implement the steps of the method according to claims 1-14.
20. A computing device comprising a memory and a processor, wherein the memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 14 is implemented.
