Interactive zero-knowledge identity authentication method and computer-readable storage medium containing the program
Through smart contracts and blockchain technology, interactive zero-knowledge identity authentication under a heterogeneous multi-trust system is realized, solving the compatibility problem of cross-border identity authentication, building a distributed cross-border trust system, and improving cross-border data Mobile security and mutual recognition capabilities.
Patent Information
- Application Number
- CN202310811730.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-04
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2043-07-04
AI Technical Summary
In a heterogeneous multi-trust system environment, it is difficult to achieve cross-border identity authentication with existing technologies, and standards, algorithms and authentication protocols are incompatible, making it difficult to achieve trusted cross-border identity authentication.
Adopting an interactive zero-knowledge identity authentication method based on smart contracts and oracles, generating DID through data wallets, using blockchain smart contracts to anchor decentralized identity identifiers and identity certificates, and combining random number challenges and symmetric cryptographic algorithms to establish Security authentication protocol for multiple subject identities.
It realizes the global unique identity of entities with cross-border data flow, builds a distributed cross-border trust system, realizes interoperability and mutual recognition between identity service agencies in various countries, and issues data access control tokens through the blockchain to improve cross-border data Liquid security and trust.
Smart Images

Figure CN116760616B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of big data technology, and in particular relates to an interactive zero-knowledge identity authentication method and a computer-readable storage medium containing the program. Background Art
[0002] The establishment of trust relationships in a heterogeneous multi-trust system environment requires the support of trusted identities, and trusted identities require a trusted identity authentication mechanism to ensure them. This project intends to adopt a multi-subject identity security authentication scheme based on smart contracts and oracles in a heterogeneous multi-trust system, thereby providing guarantees for trusted cross-border identity authentication in a heterogeneous multi-trust system environment. Based on the previous work, this project intends to adopt the above-mentioned cross-border digital identity model to study the on-chain and off-chain secure storage and anchoring mechanism of distributed identity identifiers DID and various heterogeneous identity certificates, credentials and documents, and to build a multi-subject identity security authentication mechanism in a heterogeneous multi-trust system.
[0003] Cross-border digital identity is the basis of cross-border identity authentication. Identity certificates issued by identity service agencies (IDPs) in various countries include digital certificates, verifiable credentials, electronic signature documents and other forms. They are important credentials for entities with cross-border data flow to prove their true identity. However, the standards, algorithms, authentication protocols, etc. are incompatible, making it difficult to achieve cross-border authentication. Summary of the invention
[0004] The present invention solves the above-mentioned technical problems and provides an interactive zero-knowledge identity authentication method and a computer-readable storage medium containing the program.
[0005] The present invention adopts the following technical scheme:
[0006] The interactive zero-knowledge identity authentication method includes the following steps:
[0007] Step ①: Realize the digitization and standardization of various identity certificates of heterogeneous identity subjects and store them in a data wallet;
[0008] Step ②: The user uses the data wallet to generate a DID public and private key pair, generates a DID, and stores the DID document on the chain;
[0009] Step 3: The data wallet submits the identity certificate to the zero-knowledge proof parameter generation smart contract to generate relevant identity certificate parameters and returns them to the data wallet for identity authentication interaction based on zero-knowledge proof;
[0010] Step ④: The blockchain smart contract constructs a relational data structure, and uses the blockchain smart contract to anchor the decentralized identity identifier DID and the zero-knowledge proof parameter relationship between the identity proof and the token on the chain;
[0011] Step ⑤: Introduce random number challenges and symmetric cryptographic algorithms into the DID exchange process to establish a multi-subject identity security authentication protocol;
[0012] Step ⑥: After the user and the cross-border service provider exchange DIDs and establish a secure connection, the user will initiate a service request to the service provider. The cross-border service provider can call the corresponding on-chain authentication smart contract based on the data request content;
[0013] Step 7: The smart contract will initiate an identity submission and authentication request to the user. After receiving the request, the user submits the zero-knowledge proof parameters corresponding to the identity. The contract calls the on-chain and off-chain cryptographic support algorithms based on the parameters to complete a secure and reliable zero-knowledge identity authentication.
[0014] Step ⑧: The smart contract will first return the authentication result to the cross-border service provider.
[0015] Step ⑨: If the result is true, the cross-border service provider will authorize the corresponding service to the user based on the user's request content.
[0016] Preferably, in the above step ⑤, DID exchange needs to be completed, and the user needs to complete the random number challenge to establish a secure connection between the user and the cross-border service provider. The specific implementation includes three steps: S1: generation of authentication modulus and random number mapping function;
[0017] S2: string conversion of certificates and credentials and generation of authentication parameters;
[0018] S3: Iterate interaction to complete zero-knowledge proof.
[0019] Preferably, in step S1:
[0020] 1) Select two prime numbers p and q to generate n = pq;
[0021] 2) Select a pseudo-random number generation function f that can map any input string to the range [0, n);
[0022] 3) The zero-knowledge proof parameter generation smart contract and the zero-knowledge proof algorithm save n and f respectively to provide zero-knowledge proof parameter generation and identity authentication.
[0023] Preferably, in step S2:
[0024] 1) After obtaining various certificates and credentials, in order to complete the zero-knowledge proof identity authentication, the user needs to submit the certificates and credentials to the zero-knowledge proof parameter generation smart contract. The smart contract first generates a string I based on the submitted certificates and credentials. The string contains various information in the certificates and credentials, including user identity attributes, certificate expiration time, etc.
[0025] 2) Zero-knowledge proof parameter generation smart contract selects k different numbers j and calculates v j =f(I,j), where v j is the quadratic congruence (mod n), then calculate The minimum square root of j ;
[0026] 3) Zero-knowledge proof parameter generation smart contract will I, k s j and j are returned to the user.
[0027] Preferably, in step S3,
[0028] a) The user first sends I to the zero-knowledge proof algorithm;
[0029] b) Zero-knowledge proof algorithm generates v j =f(I,j);
[0030] c) The user then chooses a random number r i ∈[0,n), and send x i =r i 2 (mod n) gives a zero-knowledge proof algorithm;
[0031] d) Zero-knowledge proof algorithm generates a random binary vector containing k elements (b i1 , b i2 …, b ik ) and send it to the user;
[0032] e) User calculation And the result y i Send to zero-knowledge proof algorithm;
[0033] f) Zero-knowledge proof algorithm calculation And determine whether the result is equal to x i ;
[0034] g) Repeat steps (c) to (f) for i times according to the value of i=1,2,…,t. If the results of step (f) are the same in t iterations, it proves that the user is indeed the holder of the certificate or approval.
[0035] The beneficial effects of the present invention are:
[0036] 1. The present invention intends to adopt W3C's decentralized identity DID as the globally unique identity of cross-border data flow entities, and anchor the identity certificates issued by identity service agencies IDPs of various countries on DID through blockchain, thereby building a distributed cross-border trust system and achieving mutual communication and recognition between IDPs of various countries.
[0037] 2. With regard to the current situation where existing information systems mainly use X.509 digital certificates for electronic signatures, entities involved in cross-border data flows can independently generate their own X.509 digital certificates.
[0038] 3. For the need for data authorization in cross-border data flow, cross-border data subjects can issue data access control tokens based on blockchain and grant them to data access requesters as part of their cross-border digital identity. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 This is a schematic diagram of the cross-border mutual recognition structure of digital identity based on DID of the present invention;
[0040] Figure 2 A schematic diagram of the cross-border digital identity logic structure of the present invention;
[0041] Figure 3 This is a schematic diagram of the multi-subject identity security authentication process based on DID and smart contracts of the present invention;
[0042] Figure 4 A schematic diagram of a secure connection based on random number challenge of the present invention. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0044] Cross-border digital identity is the basis for cross-border identity authentication. Identity certificates issued by identity service agencies (IDPs) in various countries include digital certificates, verifiable credentials, electronic signature documents, etc., which are important credentials for cross-border data flow entities to prove their true identity. However, the standards, algorithms, authentication protocols, etc. are incompatible, making it difficult to achieve cross-border authentication. The cross-border mutual recognition structure of digital identity based on DID is as follows: Figure 1 shown.
[0045] Cross-border digital identity is modeled using a star structure, which mainly includes blockchain address, distributed identity identifier DID, autonomous digital certificate, identity certificate issued by IDP, data access control token and extended information. Its logical structure is as follows: Figure 2 As shown in the figure, cross-border digital identity modeling needs to refer to international standards, national standards and industry standards in the fields of information security, computer networks, blockchain, etc.
[0046] The blockchain address is a fixed identifier owned by a blockchain node. The blockchain address and its private key are strongly associated through cryptographic principles, and the address can be regarded as a blockchain account. Distributed digital identity DID has the characteristics of decentralization, self-generation, and verifiability. The DID identifier corresponds to a DID document, which is in JSON string format and contains information such as DID, public key bound to DID, electronic signature algorithm, electronic signature, and timestamp. Autonomous digital certificates comply with the international X.509 standard and mainly include information such as the name and DID of the certificate holder, the name and DID of the certificate issuer, the electronic signature algorithm, the electronic signature, and the validity period. The third-party identity certificate issued by IDP includes X.509 digital certificates, verifiable credentials (VC), and electronic signature files. The verifiable credentials adopt the W3C verifiable credentials data model specification. The data access control token is implemented using blockchain non-homogeneous tokens NFT, which is compatible with OAuth2.0 access control tokens, but has a higher level of security.
[0047] Example
[0048] As shown in 3-4, this embodiment provides an interactive zero-knowledge identity authentication method, including the following steps:
[0049] Step ①: Realize the digitization and standardization of various identity certificates of heterogeneous identity subjects and store them in a data wallet;
[0050] Step ②: The user uses the data wallet to generate a DID public and private key pair, generates a DID, and stores the DID document on the chain;
[0051] Step 3: The data wallet submits the identity certificate to the zero-knowledge proof parameter generation smart contract to generate relevant identity certificate parameters and returns them to the data wallet for identity authentication interaction based on zero-knowledge proof;
[0052] Step ④: The blockchain smart contract constructs a relational data structure, and uses the blockchain smart contract to anchor the decentralized identity identifier DID and the zero-knowledge proof parameter relationship between the identity proof and the token on the chain;
[0053] Step ⑤: Introduce random number challenges and symmetric cryptographic algorithms into the DID exchange process to establish a multi-subject identity security authentication protocol;
[0054] Step ⑥: After the user and the cross-border service provider exchange DIDs and establish a secure connection, the user will initiate a service request to the service provider. The cross-border service provider can call the corresponding on-chain authentication smart contract based on the data request content;
[0055] Step 7: The smart contract will initiate an identity submission and authentication request to the user. After receiving the request, the user submits the zero-knowledge proof parameters corresponding to the identity. The contract calls the on-chain and off-chain cryptographic support algorithms based on the parameters to complete a secure and reliable zero-knowledge identity authentication.
[0056] Step ⑧: The smart contract will first return the authentication result to the cross-border service provider.
[0057] Step ⑨: If the result is true, the cross-border service provider will authorize the corresponding service to the user based on the user's request content.
[0058] In step ⑤ above, DID exchange needs to be completed, and the user needs to complete the random number challenge to establish a secure connection between the user and the cross-border service provider. The specific implementation includes three steps:
[0059] S1: Generation of authentication modulus and random number mapping function;
[0060] S2: string conversion of certificates and credentials and generation of authentication parameters;
[0061] S3: Iterate interaction to complete zero-knowledge proof.
[0062] In step S1:
[0063] 1) Select two prime numbers p and q to generate n = pq;
[0064] 2) Select a pseudo-random number generation function f that can map any input string to the range [0, n);
[0065] 3) The zero-knowledge proof parameter generation smart contract and the zero-knowledge proof algorithm save n and f respectively to provide zero-knowledge proof parameter generation and identity authentication.
[0066] In step S2:
[0067] 1) After obtaining various certificates and credentials, users need to submit them to Figure 1 The zero-knowledge proof parameters in the smart contract generate a string I based on the submitted certificate and credential. The string contains various information in the certificate and credential, including user identity attributes, certificate expiration time, etc.
[0068] 2) Zero-knowledge proof parameter generation smart contract selects k different numbers j and calculates v j =f(I,j), where v j is the quadratic congruence (mod n), then calculate The minimum square root of j ;
[0069] 3) Zero-knowledge proof parameter generation smart contract will I, k s j and j are returned to the user.
[0070] In step S3:
[0071] a) The user first sends I to the zero-knowledge proof algorithm;
[0072] b) Zero-knowledge proof algorithm generates v j =f(I,j);
[0073] c) The user then chooses a random number r i ∈[0,n), and send x i =r i 2 (mod n) gives a zero-knowledge proof algorithm;
[0074] d) Zero-knowledge proof algorithm generates a random binary vector containing k elements (b i1 , b i2 …, b ik ) and send it to the user;
[0075] e) User calculation And the result y i Send to zero-knowledge proof algorithm;
[0076] f) Zero-knowledge proof algorithm calculation And determine whether the result is equal to x i ;
[0077] g) Repeat steps (c) to (f) for i times according to the value of i=1,2,…,t. If the results of step (f) are the same in t iterations, it proves that the user is indeed the holder of the certificate or approval.
[0078] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. An interactive zero-knowledge identity authentication method, characterized in that: The steps include: Step ①: Realize the digitization and standardization of various identity certificates of heterogeneous identity subjects and store them in a data wallet; Step ②: The user uses the data wallet to generate a DID public and private key pair, generates a DID, and stores the DID document on the chain; Step 3: The data wallet submits the identity certificate to the zero-knowledge proof parameter generation smart contract to generate relevant identity certificate parameters and returns them to the data wallet for identity authentication interaction based on zero-knowledge proof; Step ④: The blockchain smart contract constructs a relational data structure, and uses the blockchain smart contract to anchor the decentralized identity identifier DID and the zero-knowledge proof parameter relationship between the identity proof and the token on the chain; Step ⑤: Introduce random number challenges and symmetric cryptographic algorithms into the DID exchange process to establish a multi-subject identity security authentication protocol; Step ⑥: After the user and the cross-border service provider exchange DIDs and establish a secure connection, the user will initiate a service request to the service provider. The cross-border service provider can call the corresponding on-chain authentication smart contract based on the data request content; Step 7: The smart contract will initiate an identity submission and authentication request to the user. After receiving the request, the user submits the zero-knowledge proof parameters corresponding to the identity. The contract calls the on-chain and off-chain cryptographic support algorithms based on the parameters to complete a secure and reliable zero-knowledge identity authentication. Step ⑧: The smart contract will first return the authentication result to the cross-border service provider. Step ⑨: If the result is true, the cross-border service provider will authorize the corresponding service to the user based on the user's request content.
2. The interactive zero-knowledge identity authentication method according to claim 1, characterized in that: In step ⑤, the DID exchange needs to be completed, and the user needs to complete the random number challenge to establish a secure connection between the user and the cross-border service provider, which specifically includes S1: first, the generation of the authentication modulus and random number mapping function; S2: then the string conversion of the certificate and credential and the generation of authentication parameters; S3: finally, iterative interaction to complete the zero-knowledge proof.
3. The interactive zero-knowledge identity authentication method according to claim 2, characterized in that: In step S1: 1) Select two prime numbers p and q to generate n = pq; 2) Select a pseudo-random number generation function f that can map any input string to the range [0, n); 3) The zero-knowledge proof parameter generation smart contract and the zero-knowledge proof algorithm save n and f respectively to provide zero-knowledge proof parameter generation and identity authentication.
4. The interactive zero-knowledge identity authentication method according to claim 2, characterized in that: In step S2: 1) After obtaining various certificates and credentials, in order to complete the zero-knowledge proof identity authentication, the user needs to submit the certificates and credentials to the zero-knowledge proof parameter generation smart contract. The smart contract first generates a string I based on the submitted certificates and credentials. The string contains various information in the certificates and credentials, including user identity attributes and the expiration time of the certificate; 2) Zero-knowledge proof parameter generation smart contract selects k different numbers j and calculates v j =f(I,j), where v j is the quadratic congruence of (modn), then calculate The minimum square root of j ; 3) Zero-knowledge proof parameter generation smart contract will I, k s j and j are returned to the user.
5. The interactive zero-knowledge identity authentication method according to claim 2, characterized in that: In step S3, a) The user first sends I to the zero-knowledge proof algorithm in Figure 1; b) Zero-knowledge proof algorithm generates v j =f(I,j); c) The user then chooses a random number r i ∈[0,n), and send x i =r i 2 (mod n) gives a zero-knowledge proof algorithm; d) Zero-knowledge proof algorithm generates a random binary vector containing k elements (b i1 , b i2 …, b ik ) and send it to the user; e) User calculation And the result y i Send to zero-knowledge proof algorithm; f) Zero-knowledge proof algorithm calculation And determine whether the result is equal to x i ; g) Repeat steps (c) to (f) for i times according to the value of i=1,2,…,t. If the results of step (f) are the same in t iterations, it proves that the user is indeed the holder of the certificate or approval.
