Anonymous trusted access control method based on verifiable credentials and zero-knowledge proof

Through an anonymous trusted access control method based on verifiable credentials and zero-knowledge proof, it solves the problems of large access control granularity and privacy information leakage in large-scale IoT scenarios with traditional access control technology, and achieves decentralized fine-grained access authorization. and high reliability, protecting user privacy.

CN115694838BActive Publication Date: 2024-09-27CHONGQING UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211346797.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-31
Publication Date
2024-09-27
Estimated Expiration
2042-10-31

AI Technical Summary

Technical Problem

Traditional access control technology has the problems of large access control granularity, poor scalability, and inflexible management in large-scale IoT scenarios. In addition, there is a risk of untrustworthiness and excessive leakage of private information during the storage and verification process of user attribute information.

Method used

Adopting an anonymous trusted access control method based on verifiable credentials and zero-knowledge proof, by designing user attribute verifiable credential management and anonymous attribute verification methods, combined with the distributed access control process of the blockchain, decentralized fine-grained, Dynamically adjust access authorization and ensure the credibility and non-tamperability of the access requester's attribute information.

Benefits of technology

It realizes the provision of fine-grained and dynamic access authorization under untrusted networks, improves the credibility and privacy security of the access control system, reduces the impact of single point failure of the system, and protects the privacy of user identity information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115694838B
    Figure CN115694838B
Patent Text Reader

Abstract

The present invention relates to an anonymous trusted access control method based on verifiable credentials and zero-knowledge proof, and belongs to the field of information security. The method includes: designing an attribute verifiable credential management method to store user attribute information in the form of verifiable credentials; designing an anonymous user attribute verification method based on zero-knowledge proof to complete the attribute verification of the access requester without exposing the user's real identity information; combining the attribute verifiable credential management and the zero-knowledge proof attribute verification method, designing a distributed access control process based on blockchain to achieve access authorization for anonymous access requesters. The present invention realizes decentralized fine-grained and dynamic access control through blockchain technology, solves the problem of the trustworthiness and tamper-proofness of the attributes of the access subject in the distributed access control model by using attribute verifiable credentials, and uses zero-knowledge proof to perform anonymous attribute verification, providing privacy protection for the access subject during the verification process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of information security and relates to an anonymous trusted access control method based on verifiable credentials and zero-knowledge proof. Background Art

[0002] With the rapid development of the Internet of Things and cloud computing, in the era of the Internet of Everything, all kinds of services people enjoy are inseparable from data sharing. Therefore, it is necessary to ensure information security in the process of data sharing and interaction, and access control is a key link. Access control is an important mechanism that can ensure the safe sharing of data and resources. It ensures that the resource access rights owned by users correspond to the actual resource usage rights through specific access policy management, preventing users from illegally accessing data resources without relevant permissions.

[0003] Traditional access control technologies such as discretionary access control (DAC), mandatory access control (MAC), and role-based access control (RBAC) have problems such as large access control granularity, poor scalability, and inflexible management. They cannot meet the needs of more flexible and fine-grained access control mechanisms in large-scale IoT scenarios. Attribute-based access control (ABAC) is a more flexible, dynamic, and fine-grained method that makes access control decisions based on whether the user's attribute distribution meets the resource access policy. At the same time, it can dynamically adjust the access control domain as the scale continues to expand, and has high scalability.

[0004] However, like the traditional centralized access control method, the ABAC model also adopts a centralized management method, where the policy decision point makes unified decisions on all access requests. It is overly dependent on the centralized policy decision point, and there is a problem of transparency in access rights decisions. At the same time, in the traditional ABAC model, the access requester attribute information is directly applied for by the user, centrally stored in the system database, and uniformly managed by the policy information point (PIP). There may be problems such as the visitor's attributes being unreliable and tampered with. In addition, the user's real identity and attribute information are directly exposed to the public network environment during the storage and verification process, and there is a risk of excessive leakage of user privacy information.

[0005] Blockchain applies technologies such as point-to-point communication, asymmetric encryption, distributed consensus, digital signatures, and realizes smart contracts. It has the characteristics of decentralization, openness, transparency, and immutability. It can break the trust barriers between unfamiliar nodes and create a trusted environment based on trust in immutable data. It is consistent with the distributed Internet of Things environment and is a better decentralized solution that can effectively enhance the credibility and security of access control systems.

[0006] As a proof algorithm with privacy protection capabilities, zero-knowledge proof means that the prover can convince the verifier of the correctness of a certain assertion without providing any useful information to the verifier. Through the zero-knowledge proof method, the prover proves to the verifier and makes him believe that he knows or possesses a secret, or proves that a statement is true, but no information about the proven message will be leaked to the verifier during the proof process. Zero-knowledge proof provides a method to protect the privacy of internal sensitive data while completing trusted verification, greatly improving the security of user privacy information. Summary of the invention

[0007] In view of this, the purpose of the present invention is to provide an anonymous trusted access control method based on verifiable credentials and zero-knowledge proof, to achieve decentralized distributed access authorization with fine-grained and dynamic adjustment; at the same time, to ensure the credibility and non-tamperability of the attribute information of the access requester, and to improve the security of the access model; in addition, to avoid the direct exposure of the user's real information during the attribute verification process, and to maximize the security of the visitor's identity privacy.

[0008] In order to achieve the above object, the present invention provides the following technical solutions:

[0009] An anonymous trusted access control method based on verifiable credentials and zero-knowledge proof, the method comprises the following steps:

[0010] S1: Design a method for managing user attribute verifiable credentials;

[0011] By using verifiable credentials as carriers to record visitor user attributes, designing user attribute verifiable credentials application, issuance and management methods, the user attributes can be trusted and cannot be tampered with;

[0012] S2: Design an anonymous attribute verification method based on zero-knowledge proof;

[0013] Based on the zero-knowledge proof algorithm, an anonymous verification method is designed in which user attributes can verify credentials. This method realizes trusted verification of user attributes without exposing the user's true identity, and applies the verification results to the decision network for access control.

[0014] S3: Design a distributed access control authorization process based on verifiable credentials and zero-knowledge proofs;

[0015] Combining verifiable credential management with zero-knowledge proof of user attributes, we design a distributed access control authorization process based on blockchain, design the smart contracts required in the access control process, and complete secure and reliable distributed access control.

[0016] Optionally, in S1, a method for managing user attribute verifiable credentials is designed, which specifically includes the following steps:

[0017] S11: The user generates a session key ks and uses the session key ks to encrypt the registration information ottCont containing the content of his attribute proof i Get the ciphertext message δ1 = Enc(ks, attCont i ), and then use the IA's public key PK IA After encrypting the session key ks, the ciphertext message δ2=Enc(PK IA , ks), identify itself as DID i , ciphertext message δ1, ciphertext message δ2 are combined into a property-verifiable credential request requestProof(DID i , δ1, δ2);

[0018] S12: After receiving the request, IA first verifies the legitimacy of the request and then uses its own private key SK IA Decrypt the ciphertext message δ2 to obtain the session key ks=Dec(δ2, SK IA ), use the session key ks to decrypt the ciphertext message δ1 to obtain the user's attribute registration information attCont i = Dec(δ1, ks), and for attCont i Conduct an audit;

[0019] S13: Attribute registration information attCont i After passing the review, create an ECC public-private key pair (PK i , S.K. i ), and embed PK i Create a unique ID for the attribute verifiable credential i ;

[0020] S14: Register the attribute information attCont according to the user's submission i Generate attribute secret knowledge f, and generate key pair {pk i , vk i}, and the property verifiable certificate proof i , where {pk i , vk i} is a pair of proof key and verification key, which are used for the subsequent generation and verification of zero-knowledge proof. The property can verify the proof i Contains the credential id i , credential status state i , credential hash, user unique identity representation DID i , the hash of the certificate management public key, a set of description information about the user's attributes and the IA's private key signature information;

[0021] S15: IA builds a piece of smart contract code with fixed content and verifies the key vk i Embedded into this smart contract as a trusted means of verifying the secret knowledge f, and obtaining the address addr of the contract i and code hash codehash;

[0022] S16: IA uses the public key of the credential applicant to verify the attribute of the credential proof i , proof key pk i , secret knowledge f, the hash of the attribute verifiable credential and a set of attribute description information proofDes signed by the IA private key i After being encrypted together, they are sent to the credential applicant;

[0023] S17: IA will generate the attribute verifiable credential id i , credential status state i , credential hash, credential verification smart contract address addr i And the code hash codehash is published to the blockchain for recording;

[0024] S18: After receiving the message returned by IA, the credential applicant uses its own private key to decrypt the relevant information and at the same time verifies the attribute proof i , proof key pk i , secret knowledge f, attribute description information proofDes i Store locally and save the credential id i And the corresponding state i Update to your account.

[0025] Optionally, in S2, an anonymous attribute verification method based on zero-knowledge proof is designed, which specifically includes the following steps:

[0026] S21: The anonymous user generates a session key ks and verifies the request content verCont i , attribute verifiable credential id i , proofDes i , and a random number n to encrypt the ciphertext message δ1 = Ennc(ks, verCont i ,proofDes i , n), query the public key PK of service provider s through requestPK(id) based on the unique identification id of service provider s on the blockchain s and use PK s Encrypt the session key ks to obtain the ciphertext message δ2=Enc(PK s ,ks);

[0027] S22: The anonymous user generates an attribute verification request requestVer(δ1, δ2) with the ciphertext message δ1 and the ciphertext message c, and sends the service request to s. Note that the user's own DID is not used here. i , in order to hide the true identity of the visitor;

[0028] S23: After receiving the attribute verification service request, s uses its own private key SK s Decrypt the ciphertext message δ2 to obtain the session key ks=Dec(δ2, SK s ), and then use the session key to decrypt the ciphertext message δ1 to obtain the verification request content verCont i , attribute verifiable credential id i , proofDes i and a random number n;

[0029] S24:s can verify the credential id through attributes i Query the blockchain to verify whether the status of the certificate is valid, and then verify proofDes i Whether the information list described in the document meets the required attribute requirements;

[0030] S25:s confirms the attribute certificate description proofDes i After meeting the attribute requirements, it is further confirmed that the anonymous user does hold the verifiable credentials for this attribute, and s randomly generates a set of public inputs The decrypted random number n is encrypted with the session key ks and sent to the anonymous user;

[0031] S26: The anonymous user receives the message sent by s and decrypts it to obtain the public input And based on the secret knowledge f held by oneself, a set of private inputs is calculated

[0032] S27: User based on public input Private Input and locally stored attribute verifiable credential proving key pk i , calculate a proof of constant size ω, encrypt it with the session key ks and send it to s;

[0033] S28: s decrypts to get the proof ω and compares it with the public input created by itself Together according to the smart contract address addr i Call the attribute verification smart contract for verification;

[0034] S29: Property verification smart contract uses internal verification key vki , computational verification based on public input Whether the calculated proof ω is correct, the verification result is returned, that is, the user attribute verification is completed without knowing the real identity of the anonymous user.

[0035] Optionally, in S3, a distributed access control authorization process based on verifiable credentials and zero-knowledge proof is designed, which specifically includes the following steps:

[0036] S31: After the anonymous access requester obtains the attribute verifiable credential related information from the authority IA according to the attribute verifiable credential management method, it first generates a session key ks and a public-private key pair (PK i , S.K. i ), use the session key ks to access the request information req = (opers, resID i , proofs = [proofDes1, proofDes2, ...]) to obtain the ciphertext message δ1 = Enc (ks, req), where opers represents the access operation type, resID i Represents the resource subject, proofs represents the attribute verifiable credential information [proofDes1, proofDes2, ...], and uses the public key PKP of the access control subject end policy execution point D-PEP EP Encrypt the session key ks to obtain the ciphertext message δ2 = Enc(PK PEP , ks), create an access request reqAccess(PK i , δ1, δ2), and sends an access request to D-PEP;

[0037] S32: After receiving the access request, D-PEP uses its own private key to decrypt the ciphertext message δ2 to obtain the session key ks, and then uses ks to decrypt δ1 to obtain the access request related information. i Query the access policy policyID corresponding to the resource on the blockchain, and then create an access request Sent to the policy decision network D-PDP, where σ S-PEP D-PEP uses its own private key to PK cs Signatures performed;

[0038] S33: After receiving the AAR request, any node in the policy decision network D-PDP queries the policy management network (D-PDS) to obtain the resource subject resID according to the policyID i Corresponding access control policy policy i Its policy verification contract address policyVerAddr i, and then call the strategy evaluation smart contract to verify the strategy;

[0039] S34: Strategy evaluation smart contract verification process According to the anonymous attribute verification method based on zero-knowledge proof, it is verified whether the visitor actually possesses the attribute characteristics required by the access policy, and a decision is made on the access request through blockchain consensus to obtain the decision information. i , including the decision result and effective time, and the decision record Tx = (req, decision i ) is recorded in the blockchain ledger and the TxID is determined i Send to the policy enforcement network D-PEP;

[0040] S35: The policy enforcement network D-PEP receives the decision information TxID i After that, obtain the specific decision information Tx from the blockchain and verify the decision information decision i The validity of the resource subject resID in req is queried in the blockchain according to the ruling result. i The corresponding access authorization smart contract address policyExeAddr i , call the corresponding access authorization smart contract to authorize access to anonymous visitors.

[0041] The beneficial effects of the present invention are:

[0042] Compared with the traditional access control method, the present invention can provide fine-grained and dynamic access authorization in a decentralized manner under a non-trusted network. The present invention uses user attributes as the entry point of the access control policy, based on the decentralized, open, transparent and tamper-proof characteristics of the blockchain, and replaces the single policy decision point in the traditional ABAC model with the blockchain distributed policy decision network node, ensuring the openness and transparency of the access authorization decision process, improving the credibility of the access control system, and reducing the impact of single point failures in the system, thereby improving the availability of the access control system.

[0043] The present invention ensures the credibility and non-tamperability of the access requester's attributes. A verifiable credential is a credential that can be credibly verified and issued to an applicant after the authority verifies the information. Based on the trust in the authority, the verifiable credential is credible. The present invention records user attribute information in the form of a verifiable credential. After the user information is verified by the authority, the attribute verifiable credential and related certification information issued by the authority are stored locally with the user. When an access request is made, the attribute verifiable credential related information is provided for verification, thereby ensuring the credibility and non-tamperability of the access requester's attributes.

[0044] The present invention ensures the privacy security of the identity information of the access requester. The present invention combines the zero-knowledge proof method to hide the real identity information of the user in the process of access requester attribute credential verification, and at the same time completes the trusted verification of the anonymous access requester attributes. The access control subject only knows that the visitor meets the attribute requirements specified in the access policy, but cannot obtain the real identity of the visitor, thus avoiding the direct leakage of the real information of the user and protecting the privacy security of the user.

[0045] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:

[0047] Figure 1 This is an anonymous trusted distributed access control model based on verifiable credentials and zero-knowledge proof in this embodiment;

[0048] Figure 2 This is a schematic diagram of attribute verification based on zero-knowledge proof of the present invention;

[0049] Figure 3 This is a flow chart of the distributed anonymous access authorization of the present invention. DETAILED DESCRIPTION

[0050] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.

[0051] Among them, the drawings are only used for illustrative explanations, and they only represent schematic diagrams rather than actual pictures, and should not be understood as limitations on the present invention. In order to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of actual products. For those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.

[0052] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right", "front", "rear", etc. indicate the orientation or position relationship, they are based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation. Therefore, the terms describing the position relationship in the drawings are only used for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.

[0053] like Figure 1 As shown, an anonymous trusted distributed access control model based on verifiable credentials and zero-knowledge proof is composed of a policy execution network (D-PEP), a policy decision network (D-PDP), a policy management network (D-PDS), an attribute verifiable credential management smart contract, a zero-knowledge proof attribute verification smart contract, and a policy evaluation smart contract.

[0054] This method first designs an attribute verifiable credential management method to store user attribute information in the form of verifiable credentials; then designs an anonymous user attribute verification method based on zero-knowledge proof to complete the access requester attribute verification without exposing the user's real identity information; finally, combining attribute verifiable credential management with zero-knowledge proof attribute verification method, a distributed access control process based on blockchain is designed to realize access authorization for anonymous access requesters.

[0055] User attribute verifiable credential management method design, the specific process is as follows:

[0056] In the first step, the user first generates a session key ks and uses the session key ks to encrypt the registration information attCont containing the content of his attribute proof. i Get the ciphertext message δ1 = Enc(ks, attCont i ), and then use the IA's public key PK IA After encrypting the session key ks, the ciphertext message δ2=Enc(PK IA , ks), identify itself as DID i , ciphertext message δ1, ciphertext message δ2 are combined into a property-verifiable credential request requestProof(DID i , δ1, δ2).

[0057] In the second step, after IA receives the request, it first verifies the legitimacy of the request and then uses its own private key SK IA Decrypt the ciphertext message δ2 to obtain the session key ks=Dec(δ2, SK IA), use the session key ks to decrypt the ciphertext message δ1 to obtain the user's attribute registration information attCont i = Dec(δ1, ks), and for attCont i Conduct an audit.

[0058] Step 3: When IA registers the attribute information attCont i After passing the review, create an ECC public-private key pair (PK i , S.K. i ), and embed PK i Create a unique ID for the attribute verifiable credential i .

[0059] Step 4: IA registers the attCont attribute information submitted by the user. i Generate attribute secret knowledge f, and generate key pair {pk i , vk i}, and the property verifiable certificate proof i , where {pk i , vk i} is a pair of proof key and verification key, which are used for the subsequent generation and verification of zero-knowledge proof. The property can verify the proof i Contains the credential id i , credential status state i , credential hash, user unique identity representation DID i , the hash of the certificate management public key, a set of descriptive information about the user's attributes, and the IA's private key signature information.

[0060] Step 5: IA builds a fixed-content smart contract code and verifies the key vk i Embedded into this smart contract as a trusted means of verifying the secret knowledge f, and obtaining the address addr of the contract i And code hash codehash.

[0061] Step 6: IA uses the public key of the credential applicant to verify the attribute i , proof key pk i , secret knowledge f, the hash of the attribute verifiable credential and a set of attribute description information proofDes signed by the IA private key i The two are encrypted together and sent to the credential applicant.

[0062] Step 7: IA will generate the attribute verifiable credential ID i , credential status state i , credential hash, credential verification smart contract address addri The code hash codehash is published to the blockchain for recording.

[0063] Step 8: After receiving the message returned by IA, the credential applicant uses his own private key to decrypt the relevant information and at the same time verifies the attribute proof. i , proof key pk i , secret knowledge f, attribute description information proofDes i Store locally and save the credential id i And the corresponding state i Update to your account.

[0064] like Figure 2 As shown in the figure, the anonymous attribute verification method based on zero-knowledge proof is designed. The specific process is as follows:

[0065] In the first step, the anonymous user generates a session key ks and verifies the request content verCont i , attribute verifiable credential id i , proofDes i , and a random number n to encrypt the ciphertext message δ1 = Enc(ks, verCont i ,proofDes i , n), query the public key PK of service provider s through requestPK(id) based on the unique identification id of service provider s on the blockchain s and use PK s Encrypt the session key ks to obtain the ciphertext message δ2=Enc(PK s ,ks);

[0066] In the second step, the anonymous user generates an attribute verification request requestVer(δ1, δ2) with the ciphertext message δ1 and the ciphertext message c, and sends the service request to the service provider s. Note that the user's own DID is not used here. i , in order to hide the true identity of the visitor;

[0067] In the third step, after receiving the attribute verification service request, the service provider s uses its own private key SK s Decrypt the ciphertext message δ2 to obtain the session key ks=Dec(δ2, SK s ), and then use the session key to decrypt the ciphertext message δ1 to obtain the verification request content verCont i , attribute verifiable credential id i , proofDes i and a random number n;

[0068] Step 4: Service provider s verifies the credential id through attributes i Query the blockchain to verify whether the status of the certificate is valid, and then verify proofDes i Whether the information list described in the document meets the required attribute requirements;

[0069] Step 5: Service provider s confirms the attribute certificate description proofDes i After meeting the attribute requirements, it is further confirmed that the anonymous user actually holds the verifiable credentials for this attribute. To this end, the service provider s will randomly generate a set of public inputs The decrypted random number n is encrypted with the session key ks and sent to the anonymous user;

[0070] Step 6: The anonymous user receives the message sent by service provider s and decrypts it to get the public input And based on the secret knowledge f held by oneself, a set of private inputs is calculated

[0071] Step 7: User based on public input Private Input and locally stored attribute verifiable credential proving key pk i , calculate a proof of constant size ω, encrypt it with the session key ks and send it to the service provider s;

[0072] Step 8: Service provider s decrypts the proof ω and compares it with the public input Together according to the smart contract address addr i Call the attribute verification smart contract for verification;

[0073] Step 9: The property verification smart contract uses the internal verification key vk i , computational verification based on public input Whether the calculated proof ω is correct, the verification result is returned, that is, the user attribute verification is completed without knowing the real identity of the anonymous user.

[0074] like Figure 3 As shown in the figure, the distributed access control authorization process combining attribute verifiable credential management and zero-knowledge proof attribute verification method is as follows:

[0075] In the first step, the anonymous access requester obtains the attribute verifiable credential information from the authority (IA) according to the aforementioned attribute verifiable credential management method, and first generates a session key ks and a public-private key pair (PK i , S.K. i), use the session key ks to access the request information req = (opers, resID i , proofs = [proofDes1, proofDes2, ...]) to obtain the ciphertext message δ1 = Enc (ks, req), where opers represents the access operation type, resID i Represents the resource subject, proofs represents the attribute verifiable credential information [proofDes1, proofDes2, ...], and uses the public key PK of the access control subject end policy enforcement point (D-PEP) PEP Encrypt the session key ks to obtain the ciphertext message δ2 = Enc(PK PEP , ks), create an access request reqAccess(PK i , δ1, δ2), and sends an access request to D-PEP;

[0076] In the second step, after receiving the access request, D-PEP uses its own private key to decrypt the ciphertext message δ2 to obtain the session key ks, and then uses ks to decrypt δ1 to obtain the access request related information. i Query the access policy policyID corresponding to the resource on the blockchain, and then create an access request Sent to the policy decision network D-PDP, where σ S-PEP D-PEP uses its own private key to PK cs Signatures performed;

[0077] In the third step, after any node in the policy decision network D-PDP receives the AAR request, it queries the policy management network (D-PDS) to obtain the resource subject resID according to the policyID i Corresponding access control policy policy i Its policy evaluation smart contract address policyVerAddr i , and then call the strategy evaluation contract to verify the strategy;

[0078] The fourth step is the strategy evaluation smart contract verification process. According to the aforementioned anonymous attribute verification method based on zero-knowledge proof, it verifies whether the visitor actually possesses the attribute characteristics required by the access policy, and makes a decision on the access request through blockchain consensus to obtain the decision information. i , including the decision result and effective time, and the decision record Tx = (req, decision i ) is recorded in the blockchain ledger and the TxID is determined i Send to the policy enforcement network D-PEP;

[0079] Step 5: The policy execution network D-PEP receives the decision information TxID i After that, obtain the specific decision information Tx from the blockchain and verify the decision information decision i The validity of the resource subject resID in req is queried in the blockchain according to the ruling result. i The corresponding access authorization smart contract address policyExeAddr i , call the corresponding access authorization smart contract to authorize access to anonymous visitors.

[0080] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.

Claims

1. An anonymous trusted access control method based on verifiable credentials and zero-knowledge proof, characterized by: The method comprises the following steps: S1: Design a method for managing user attribute verifiable credentials; By using verifiable credentials as carriers to record visitor user attributes, designing user attribute verifiable credentials application, issuance and management methods, the user attributes can be trusted and cannot be tampered with; In S1, a method for managing user attribute verifiable credentials is designed, which specifically includes the following steps: S11: The user generates a session key ks3 and uses the session key ks3 to encrypt the registration information attCont containing the content of his attribute proof i Get the ciphertext message δ 31 =Enc(ks3,attCont i ), and then use the IA's public key PK IA After encrypting the session key ks3, the ciphertext message δ is obtained 32 =Enc(PK IA ,ks3), identify itself as DID i , ciphertext message δ 31 , ciphertext message δ 32 Combined into attributes to verify the credential request requestProof(ID i ,δ 31 ,δ 32 ); S12: After receiving the request, IA first verifies the legitimacy of the request and then uses its own private key SK IA Decrypt the ciphertext message δ 32 Get the session key ks3 = Dec(δ 32 ,SK IA ), decrypt the ciphertext message δ using the session key ks3 31 Get the user's attribute registration information attCont i = Dec(δ 31 ,ks3), and attCont i Conduct an audit; S13: Attribute registration information attCont i After passing the review, create an ECC public-private key pair (PK temp ,SK temp ), and embed PK temp Create a unique ID for the attribute verifiable credential i ; S14: Register the attribute information attCont according to the user's submission i Generate attribute secret knowledge f, and generate key pair {pk i , vk i }, and the property verifiable certificate proof i , where {pk i , vk i } is a pair of proof key and verification key, which are used for the subsequent generation and verification of zero-knowledge proof. The property can verify the proof i Contains the credential id i , credential status state i , credential hash, user unique identity representation DID i , the hash of the certificate management public key, a set of description information about the user's attributes and the IA's private key signature information; S15: IA builds a piece of smart contract code with fixed content and verifies the key vk i Embedded into this smart contract as a trusted means of verifying the secret knowledge f, and obtaining the address addr of the contract i and code hash codehash; S16: IA uses the public key of the credential applicant to verify the attribute of the credential proof i , proof key pk i , secret knowledge f, the hash of the attribute verifiable credential and a set of attribute description information proofDes signed by the IA private key i After being encrypted together, they are sent to the credential applicant; S17: IA will generate the attribute verifiable credential id i , credential status state i , credential hash, credential verification smart contract address addr i And the code hash codehash is published to the blockchain for recording; S18: After receiving the message returned by IA, the credential applicant uses its own private key to decrypt the relevant information and at the same time verifies the attribute proof i , proof key pk i , secret knowledge f, attribute description information proofDes i Store locally and save the credential id i And the corresponding state i Update to your own account; S2: Design an anonymous attribute verification method based on zero-knowledge proof; Based on the zero-knowledge proof algorithm, an anonymous verification method is designed in which user attributes can verify credentials. This method realizes trusted verification of user attributes without exposing the user's true identity, and applies the verification results to the decision network for access control. S3: Design a distributed access control authorization process based on verifiable credentials and zero-knowledge proofs; Combining verifiable credential management with zero-knowledge proof of user attributes, we designed a distributed access control authorization process based on blockchain, designed the smart contracts required in the access control process, and completed secure and reliable distributed access control. In S2, an anonymous attribute verification method based on zero-knowledge proof is designed, which specifically includes the following steps: S21: The anonymous user generates a session key ks1 and verifies the request content verCont i , attribute verifiable credential id i , proofDes i , and a random number n to encrypt the ciphertext message δ 11 =Enc(ks1,verCont i ,proofDes i ,n), query the public key PK of service provider s through requestPK(id) based on the unique identification id of service provider s on the blockchain s and use PK s Encrypt the session key ks1 to get the ciphertext message δ 12 =Enc(PK S ,ks1); S22: The anonymous user sends the ciphertext message δ 11 =Enc(ks1,verCont i ,proofDes i ,n) and the ciphertext message δ 12 =Enc(PK S ,ks1) generates an attribute verification request requestVer(δ 11 ,δ 12 ) and sends the service request to s. The user's own DID is not used here. i , in order to hide the true identity of the visitor; S23: After receiving the attribute verification service request, s uses its own private key SK s Decrypt the ciphertext message δ 12 Get the session key ks1 = Dec(δ 12 ,SK s ), and then use the session key to decrypt the ciphertext message δ 11 , get the verification request content verCont i , attribute verifiable credential id i , credential description information proooDes i and a random number n; S24:s can verify the credential id through attributes i Query the blockchain to verify whether the status of the certificate is valid, and then verify proofDes i Whether the information list described in the document meets the required attribute requirements; S25:s confirms the attribute certificate description proofDes i After meeting the attribute requirements, it is further confirmed that the anonymous user does hold the verifiable credentials for this attribute, and s randomly generates a set of public inputs The decrypted random number n is encrypted with the session key ks1 and sent to the anonymous user; S26: The anonymous user receives the message sent by s and decrypts it to obtain the public input And according to the secret knowledge f held by oneself, that is, using the session key ks1 to decrypt the random number n and the public input After encryption, it is sent to the anonymous user and a set of private inputs is calculated. S27: User based on public input Private Input and locally stored attribute verifiable credential proving key pk i , calculate a proof of constant size ω, encrypt it with the session key ks1 and send it to s; S28: s decrypts to get the proof ω and compares it with the public input created by itself Together according to the smart contract address addr i Call the attribute verification smart contract for verification; S29: Property verification smart contract uses internal verification key vk i , computational verification based on public input Whether the calculated proof ω is correct, the verification result is returned, that is, the user attribute verification is completed without knowing the real identity of the anonymous user; In the S3, a distributed access control authorization process based on verifiable credentials and zero-knowledge proof is designed, which specifically includes the following steps: S31: After the anonymous access requester obtains the attribute verifiable credential related information from the authority IA according to the attribute verifiable credential management method, it first generates a session key ks2 and a public-private key pair (PK i , S.K. i ), use the session key ks2 to access the request information req = (opers, resID i , proofs = [proofDes1, proofDes2, ...]) to encrypt the ciphertext message δ 21 =Enc(ks2,req), where opers represents the access operation type, resID i Represents the resource subject, proofs represents the attribute verifiable credential information [proofDes1, proofDes2, ...], and uses the public key PK of the access control subject end policy enforcement point D-PEP PEP Encrypt the session key ks2 to get the ciphertext message δ 22 =Enc(PK PEP ,ks2), create an access request reqAccess(PK i ,δ 21 ,δ 22 ) and sends an access request to D-PEP; S32: After receiving the access request, D-PEP uses its own private key to decrypt the ciphertext message δ 22 Get the session key ks2, and then use ks2 to decrypt δ 21 Get access request related information according to resource subject resID i Query the access policy policyID corresponding to the resource on the blockchain, and then create an access request Sent to the policy decision network D-PDP, where σ S-PEP D-PEP uses its own private key to PK cs Signatures performed; S33: After receiving the AAR request, any node in the policy decision network D-PDP queries the policy management network D-PDS to obtain the resource subject resID according to the policyID i Corresponding access control policy policy i Its policy verification contract address policyVerAddr i , and then call the strategy evaluation smart contract to verify the strategy; S34: Strategy evaluation smart contract verification process According to the anonymous attribute verification method based on zero-knowledge proof, it is verified whether the visitor actually possesses the attribute characteristics required by the access policy, and a decision is made on the access request through blockchain consensus to obtain the decision information. i , including the decision result and effective time, and the decision record Tx = (req, decisionn i ) is recorded in the blockchain ledger and the TxID is determined i Send to the policy enforcement network D-PEP; S35: The policy enforcement network D-PEP receives the decision information TxID i After that, obtain the specific decision information Tx from the blockchain and verify the decision information decision i The validity of the resource subject resID in req is queried in the blockchain according to the ruling result. i The corresponding access authorization smart contract address policyExeAddr i , call the corresponding access authorization smart contract to authorize access to anonymous visitors.