A user authentication method and apparatus based on proof-of-blocks
By using a blockchain-based user authentication method that utilizes user certificates and seed keys for identity verification, the security risks of storing usernames and passwords in a database are resolved, ensuring the security and consistency of user data and preventing unauthorized logins.
Patent Information
- Application Number
- CN202311271813.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-27
- Publication Date
- 2026-11-10
- Estimated Expiration
- 2043-09-27
AI Technical Summary
In existing user authentication methods, storing usernames and passwords in the database poses a risk of database breaches, database breaches, and injection attacks, leading to data theft and compromising user data security.
A blockchain-based user authentication method is adopted, which uses user certificates and seed keys for identity verification, and utilizes smart contracts in the blockchain for authentication to generate and update user certificates, thereby avoiding database risks and improving the randomness and forgery cost of certificates.
It effectively prevents database attacks, ensures the consistency and validity of user certificates, reduces the probability of certificate forgery, improves user data security, and prevents unauthorized logins.
Smart Images

Figure CN117499075B_ABST
Abstract
Description
Technical Field
[0001] This article relates to the field of blockchain, and in particular to a user authentication method and device based on block proof. Background Technology
[0002] In existing technologies, the user authentication (user identity verification) methods used when users log in to the system are mainly based on the mainstream username and password method, combined with technologies such as SMS verification code and image verification code for two-factor authentication, thereby realizing the identification of user identity.
[0003] Usernames and passwords are stored in a database, which is vulnerable to data breaches, database leaks, and injection attacks. This can lead to the loss of critical, important, and private data belonging to governments, businesses, and individuals. When this lost information is released online, it can spread unchecked and may be traded illegally. Therefore, existing username and password systems suffer from the problems of information theft and rampant misuse. Even with SMS and image verification codes, the traditional and simplistic nature of identity verification methods makes it easy to forge and steal identities, allowing security breaches and the theft of backend data. Summary of the Invention
[0004] This article addresses the risk of database breaches, data breaches, and injection vulnerabilities in existing user authentication methods that store usernames and passwords, leading to data theft and compromising user data security.
[0005] To address the aforementioned technical problems, one embodiment of this invention provides a user authentication method based on proof-of-blocks, comprising:
[0006] Receive login requests with user certificates sent by the client;
[0007] The user certificate in the login request is verified using the latest user certificate in the system. After the verification is successful, the user's seed key is obtained. The user's seed key is used to parse the user certificate in the login request to obtain the block information to be verified. The block information to be verified includes the first block parameter and the second block parameter.
[0008] If the seed key cannot be found or decryption fails, a user certificate risk warning message is issued; otherwise, the block information to be verified is sent to the blockchain for authentication by a smart contract in the blockchain, and the authentication result output by the smart contract is received; or the second block parameter is obtained from the blockchain based on the first block parameter in the block information to be verified, and the authentication result is obtained by comparing the obtained second block parameter with the second block parameter in the block information to be verified.
[0009] After successful authentication, the latest block information is obtained from the blockchain, the user certificate is updated using the latest block information, and the updated user certificate is sent to the user terminal.
[0010] In a further embodiment of this document, the process of receiving a login request with a user certificate sent by the user terminal includes:
[0011] Receive a user creation request sent by the user terminal and allocate a seed key to the user;
[0012] Extract user device information;
[0013] Obtain the latest block information from the blockchain and encrypt the latest block information using a seed key;
[0014] Calculate the user certificate based on the latest encrypted block information and the user device information;
[0015] Send the user certificate to the user terminal.
[0016] In a further embodiment of this article, the latest block information includes: the block height and block header hash of the latest block;
[0017] The user equipment information includes: user account information and / or user equipment information.
[0018] In a further embodiment of this document, the user certificate is calculated based on the encrypted latest block information and the user equipment information, including:
[0019] Generate key information based on the user equipment information;
[0020] The user certificate is obtained by integrating the latest encrypted block information and the key information using a preset integration algorithm.
[0021] In a further embodiment of this paper, the user certificate in the login request is parsed using the user's seed key to obtain the block information to be verified, including:
[0022] The encrypted block information and key information are obtained by parsing the user certificate;
[0023] Based on the user information in the login request, retrieve the user's seed key;
[0024] The encrypted block information is decrypted using the user's seed key to obtain the block information to be verified.
[0025] In a further embodiment of this paper, the user authentication method based on proof-of-blocks also includes:
[0026] Based on the user's historical transaction data, determine the user's transaction frequency according to the preset plan;
[0027] For users whose transaction frequency exceeds the predetermined value, a new seed key will be assigned to them.
[0028] In a further embodiment of this paper, the user authentication method based on proof-of-blocks also includes:
[0029] Compare the updated user certificate with the original user certificate to see if they have changed; if they have not changed, issue a certificate of authenticity transaction; repeat the steps of obtaining the latest block information from the blockchain, updating the user certificate using the latest block information, and so on; or
[0030] The system detects the duration during which no blocks have been generated in the blockchain. If the duration exceeds the predetermined duration, a notarized transaction is issued.
[0031] The second aspect of this paper provides a user authentication device based on proof-of-blocks, including:
[0032] The first interaction unit is used to receive login requests with user certificates sent by the user client;
[0033] The verification and parsing unit is used to verify the user certificate in the login request using the latest user certificate in the system. After the verification is successful, the user's seed key is obtained. The user's seed key is used to parse the user certificate in the login request to obtain the block information to be verified. The block information to be verified includes a first block parameter and a second block parameter.
[0034] The authentication unit is used to issue a user certificate risk warning if the seed key cannot be found or decryption fails; otherwise, it sends the block information to be verified to the blockchain for authentication by a smart contract in the blockchain and receives the authentication result output by the smart contract; or it obtains a second block parameter from the blockchain based on the first block parameter in the block information to be verified, and compares the obtained second block parameter with the second block parameter in the block information to be verified to obtain the authentication result.
[0035] The update unit is used to obtain the latest block information from the blockchain after successful authentication, update the user certificate using the latest block information, and send the updated user certificate to the user terminal.
[0036] A third aspect of this document provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method described in any of the foregoing embodiments.
[0037] A fourth aspect of this document provides a computer storage medium having a computer program stored thereon, which, when executed by a processor of a computer device, implements the method described in any of the foregoing embodiments.
[0038] The user authentication method and apparatus based on blockchain proof presented in this paper use user certificates to authenticate users. Each user certificate is valid for each login, and a new user certificate is generated after each login, while older user certificates become invalid. This avoids the risks of database breaches, database overflows, and injection attacks. Furthermore, the user certificate is generated using the latest block information in the blockchain, ensuring the randomness of certificate generation, increasing the cost of certificate forgery, and guaranteeing user data security. The certificate update frequency depends on the number of user logins, which significantly reduces the probability of damage caused by certificate theft.
[0039] Specifically, for the server side, the following effects can be achieved: (1) By receiving the login request with user certificate sent by the user terminal; and verifying the user certificate in the login request using the latest user certificate in the system, the consistency between the user certificate and the server storage can be guaranteed, and repeated login can be avoided after the login request is intercepted. (2) By generating the user certificate using the user's seed key, and obtaining the user's seed key after the above verification is passed, the user certificate in the login request can be parsed using the user's seed key to obtain the block information to be verified, which can prevent other users from illegally logging in using the user certificate in the event of loss / theft of the user certificate. (3) By sending the block information to be verified to the blockchain for authentication by the smart contract in the blockchain, and receiving the authentication result output by the smart contract; or obtaining the second block parameter from the blockchain according to the first block parameter in the block information to be verified, and comparing the obtained second block parameter with the second block parameter in the block information to be verified to obtain the authentication result, it can be guaranteed that the user certificate in the login request is consistent with the information recorded in the blockchain, increasing the difficulty for the user to have their certificate compromised. (4) After authentication, the latest block information is obtained from the blockchain, the user certificate is updated using the latest block information, and the updated user certificate is sent to the user terminal, which can ensure the validity of the user certificate. When the user discovers that the certificate has been stolen, the danger can be easily eliminated by logging into the system immediately to obtain a new certificate.
[0040] To make the above and other objects, features and advantages of this document more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in the embodiments or prior art described herein, the accompanying drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this article. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0042] Figure 1This paper presents a structural diagram of a user authentication system based on proof-of-blocks, as illustrated in this embodiment.
[0043] Figure 2 A flowchart of a user authentication method based on proof-of-blocks, as illustrated in this embodiment, is shown.
[0044] Figure 3 Another flowchart of the user authentication method based on proof-of-blocks in the embodiments of this paper is shown;
[0045] Figure 4 This document illustrates a flowchart of the process for parsing user certificates in an embodiment.
[0046] Figure 5 This paper presents a structural diagram of a user authentication device based on proof-of-blocks, as described in this embodiment.
[0047] Figure 6 A structural diagram of the computer device described in this embodiment is shown.
[0048] Explanation of symbols in the attached drawings:
[0049] 101. User side;
[0050] 102. Server-side;
[0051] 103. Blockchain;
[0052] 501, First Interaction Unit;
[0053] 502. Verification and parsing unit;
[0054] 503. Authentication Unit;
[0055] 504, Update Unit;
[0056] 602. Computer equipment;
[0057] 604, Processor;
[0058] 606. Memory;
[0059] 608. Drive mechanism;
[0060] 610. Input / output module;
[0061] 612. Input devices;
[0062] 614. Output devices;
[0063] 616. Presentation equipment;
[0064] 618. Graphical User Interface;
[0065] 620. Network interface;
[0066] 622. Communication link;
[0067] 624. Communication bus. Detailed Implementation
[0068] The technical solutions in the embodiments described below will be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments described herein, and not all of them. Based on the embodiments described herein, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this document.
[0069] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings herein are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, apparatus, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0070] This specification provides the operational steps of the methods described in the embodiments or flowcharts, but based on conventional or non-inventive labor, more or fewer operational steps may be included. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only possible execution order. In actual system or device products, the methods shown in the embodiments or drawings can be executed sequentially or in parallel.
[0071] It should be noted that the user authentication method, device and system based on proof-of-blocks in this paper can be used in the financial field, or in any field other than the financial field. The application field of the user authentication method, device and system based on proof-of-blocks in this paper is not limited.
[0072] One embodiment of this paper provides a user authentication system based on proof-of-blocks, which addresses the risks of database breaches, data breaches, and injection vulnerabilities in existing user authentication methods that store usernames and passwords, leading to data theft and compromising user data security. Specifically, as shown... Figure 1 As shown, the user authentication system based on blockchain proof includes: user terminal 101, server terminal 102, and blockchain 103.
[0073] The client 101 stores the user certificate and also provides an interactive interface for users to issue login requests containing the user certificate. The login request includes the user certificate and a user identifier. The user identifier uniquely identifies the user, such as a username, ID number, or phone number. The user certificate is generated by the server based on blockchain block information and user device information. The user device information ensures a unique user, and the blockchain information guarantees the randomness of the user certificate.
[0074] The login described in this article can refer to login in various scenarios, such as system login and APP login. Specifically, the user terminal can be a desktop computer, tablet computer, laptop computer, smartphone, digital assistant, smart wearable device, etc. Among them, smart wearable devices can include smart bracelets, smartwatches, smart glasses, smart helmets, etc. Of course, the user terminal is not limited to the above-mentioned physical electronic devices; it can also be the software running on the above-mentioned electronic devices.
[0075] Server 102 receives login requests with user certificates sent by client 101; verifies the user certificate in the login request using the latest user certificate in the system; if the verification is successful, obtains the user's seed key; uses the user's seed key to parse the user certificate in the login request to obtain the block information to be verified, which includes first block parameters and second block parameters; if the seed key cannot be found or decryption fails, a user certificate risk warning is issued; otherwise, the block information to be verified is sent to blockchain 103 for authentication by the smart contract in blockchain 103, and the authentication result output by the smart contract is received; or, based on the first block parameters in the block information to be verified, the second block parameters are obtained from blockchain 103, and the second block parameters are compared with those in the block information to be verified to obtain the authentication result; after successful authentication, the latest block information is obtained from the blockchain, the user certificate is updated using the latest block information, and the updated user certificate is sent to client 101.
[0076] Blockchain 103 comprises multiple nodes, each responsible for generating blocks based on user transaction data and broadcasting them to other blocks for storage. Specifically, block generation can be triggered periodically or after a certain amount of transaction data is accumulated; this paper does not limit the block generation method. The blockchain is used to store business data generated by all existing users in the login system, such as transaction data in a banking system; this paper also does not limit the content stored in the blocks. The login method described in this paper can be used in any scenario where blocks can be frequently updated.
[0077] This embodiment avoids the risks of database breaches, database overflows, and injections by generating a new user certificate with the latest block information each time a user logs in. It also ensures the randomness of user certificate generation, prevents user certificates from being forged, and improves data security.
[0078] In one embodiment of this paper, a user authentication method based on block proof is provided, such as... Figure 2 As shown, it includes:
[0079] Step 201: Receive a login request with user certificate sent by the user client.
[0080] In this step, the user sends a login request through the interactive interface displayed on the user terminal. The interface has interactive controls; by triggering these controls, the user can initiate the process of obtaining their certificate and generating a login request. In this article, "user" refers to self-registered users and administrators.
[0081] Step 202: Verify the user certificate in the login request using the latest user certificate in the system. After successful verification, obtain the user's seed key and use the user's seed key to parse the user certificate in the login request to obtain the block information to be verified.
[0082] The block information to be verified includes first block parameters and second block parameters. In some implementations, the first block parameter is the block height, and the second block parameter is the block header hash value. The block height and block hash value are stored in the block header. The block height is used to locate the block position in the blockchain. In specific implementations, the first block parameters and second block parameters can also be one or more other parameters in the block header.
[0083] The system verifies the user certificate in the login request using the latest user certificate in the system. This involves comparing the latest user certificate in the system with the user certificate in the login request. If they match, it indicates a risk of the login request being intercepted. In this case, the user's login is denied. To ensure security, a security alert may also be sent to the user's terminal.
[0084] The seed key is generated when the user initiates a user creation request. Specifically, it can be calculated using AES or SM4 based on the user's device information.
[0085] This step prevents repeated login attempts from being intercepted, thus ensuring user data security.
[0086] Step 203: If the seed key cannot be found or decryption fails, a user certificate risk warning message is issued; otherwise, the block information to be verified is sent to the blockchain for authentication by the smart contract in the blockchain, and the authentication result output by the smart contract is received; or the second block parameter is obtained from the blockchain according to the first block parameter in the block information to be verified, and the authentication result is obtained by comparing the obtained second block parameter with the second block parameter in the block information to be verified.
[0087] If the seed key cannot be found or decryption fails, it indicates a mismatch between the user and the user certificate, meaning the user certificate does not belong to the user and is at risk of being stolen. This step prevents other users from unauthorized logins using the user certificate should the user certificate be lost before it is put into use, thus ensuring user data security.
[0088] The smart contract stipulates a method for verifying block information. The specific verification process includes: obtaining the second block parameter from the blockchain based on the first block parameter in the block information to be verified, and comparing the obtained second block parameter with the second block parameter in the block information to be verified to obtain the authentication result.
[0089] The authentication result is successful if the parameters of the second block obtained are the same as those of the second block in the information of the block to be verified; otherwise, the authentication result is unsuccessful.
[0090] By verifying the block parameters, it can be ensured that the user certificate in the login request is consistent with the information recorded in the blockchain, increasing the difficulty for the user's certificate to be compromised.
[0091] Step 204: After successful authentication, retrieve the latest block information from the blockchain, update the user certificate using the latest block information, and send the updated user certificate to the user's terminal.
[0092] By obtaining the latest block information, updating the user certificate using the latest block information, and sending it to the user's end, the validity of the user certificate can be guaranteed. When a user discovers that their certificate has been stolen, they can easily eliminate the danger by logging into the system immediately to obtain a new certificate.
[0093] In one embodiment of this paper, a notarized transaction is also generated based on the login information, and the notarized transaction is sent to the blockchain storage. The login information includes parameters such as user ID and time.
[0094] In one embodiment of this article, such as Figure 3 As shown, before implementing step 201 above, the following steps are also included:
[0095] Step 301: Receive the user creation request sent by the user terminal and allocate a seed key to the user.
[0096] During this step, encryption algorithms such as AES and SM4 (China's national cryptographic standard) can be used to generate an encryption seed key. Each user's seed key is unique.
[0097] Step 302: Extract user device information.
[0098] The user device information includes user account information and / or user device information. User device information includes MAC address, International Mobile Equipment Identity (IMEI), etc., which can be automatically obtained from the user device. User account information includes document type, document number, etc., and is provided by the user when making a login request.
[0099] Step 303: Obtain the latest block information from the blockchain and encrypt the latest block information using the seed key.
[0100] Step 304: Calculate the user certificate based on the latest encrypted block information and user device information.
[0101] In this step, key information is first generated based on the user equipment information. Then, a preset integration algorithm is used to integrate the latest encrypted block information and the key information to obtain the user certificate. The preset integration algorithm can refer to existing technologies, and this document does not specifically limit it.
[0102] This step, by encrypting user device information, can ensure user privacy and reduce the risk of user information leakage.
[0103] In practice, the key information and the latest block information can be integrated first, and then the integrated information can be encrypted using the seed key to obtain the user certificate.
[0104] Step 305: Send the user certificate to the user's client.
[0105] This embodiment generates user certificates using user device information and the latest block information, ensuring the association and randomness between the user certificate and the user.
[0106] In one embodiment of this article, such as Figure 4 As shown, step 202 above uses the user's seed key to parse the user certificate in the login request to obtain the block information to be verified, including:
[0107] Step 401: Parse the user certificate to obtain encrypted block information and key information.
[0108] Step 402: Based on the user information in the login request, query the user's seed key. The user's seed key is stored in the server-side database, and can be obtained by querying the database.
[0109] Step 403: Use the user's seed key to decrypt the encrypted block information to obtain the block information to be verified.
[0110] In one embodiment of this article, the method further includes: determining the user's transaction frequency based on the user's historical transaction data according to a preset plan; and reallocating a seed key to the user whose transaction frequency is greater than a predetermined value.
[0111] Specifically, the preset plan can be pre-set, such as daily, weekly, or monthly, and this document does not impose specific limitations on it. This embodiment increases the difficulty of cracking user certificates and ensures user data security by screening users whose transaction frequency meets a predetermined value and reassigning seed keys to users and generating new user certificates.
[0112] In one embodiment of this paper, the user authentication method based on proof-of-blocks further includes:
[0113] The system compares the updated user certificate with the original user certificate to see if they have changed. If they have not changed, a certificate of evidence storage transaction is issued. The process then repeats the steps of obtaining the latest block information from the blockchain, updating the user certificate using the latest block information, and so on. Alternatively, it checks the duration for which no blocks have been generated in the blockchain; if the duration exceeds a predetermined duration, a certificate of evidence storage transaction is issued. The predetermined duration can be set according to actual circumstances, and this document does not impose specific limitations on it. Certificate of evidence storage transactions can be initiated proactively by an administrator, and the transaction content may include information such as monitoring logs.
[0114] This embodiment actively monitors whether a block has not been updated for a long time. When a block has not been updated for a long time, it actively initiates a notarization transaction, so that the block changes and a new user certificate can be generated. This avoids the user certificate not being effectively updated due to the block not being updated, thus preventing the risk to user data.
[0115] Based on the same inventive concept, this paper also provides a user authentication device based on proof-of-blocks, as described in the following embodiments. Since the principle behind the problem solved by the user authentication device based on proof-of-blocks is similar to that of the user authentication method based on proof-of-blocks, the implementation of the user authentication device based on proof-of-blocks can refer to the user authentication method based on proof-of-blocks, and the repetitions will not be repeated.
[0116] Specifically, such as Figure 5 As shown, the user authentication device based on proof-of-blocks includes:
[0117] The first interaction unit 501 is used to receive a login request with a user certificate sent by the user terminal;
[0118] The verification and parsing unit 502 is used to verify the user certificate in the login request using the latest user certificate in the system. After the verification is successful, the user's seed key is obtained. The user's seed key is used to parse the user certificate in the login request to obtain the block information to be verified. The block information to be verified includes a first block parameter and a second block parameter.
[0119] The authentication unit 503 is used to issue a user certificate risk warning if the seed key cannot be found or decryption fails; otherwise, it sends the block information to be verified to the blockchain for authentication by the smart contract in the blockchain and receives the authentication result output by the smart contract; or it obtains the second block parameter from the blockchain according to the first block parameter in the block information to be verified, and compares the obtained second block parameter with the second block parameter in the block information to be verified to obtain the authentication result.
[0120] The update unit 504 is used to obtain the latest block information from the blockchain after authentication, update the user certificate using the latest block information, and send the updated user certificate to the user terminal.
[0121] This embodiment can produce the following technical effects:
[0122] (1) By receiving a login request with a user certificate sent by the user terminal and verifying the user certificate in the login request using the latest user certificate in the system, the consistency between the user certificate and the server storage can be guaranteed, and the login request can be intercepted and then logged in repeatedly.
[0123] (2) The user's seed key is generated using the user certificate. After the above verification is passed, the user's seed key is obtained. The user's seed key is used to parse the user certificate in the login request to obtain the block information to be verified. This can prevent other users from using the user certificate to log in illegally if the user certificate is lost or stolen.
[0124] (3) By sending the block information to be verified to the blockchain for authentication by the smart contract in the blockchain, the authentication result output by the smart contract is received; or by obtaining the second block parameter from the blockchain according to the first block parameter in the block information to be verified, and comparing the obtained second block parameter with the second block parameter in the block information to be verified to obtain the authentication result, it can ensure that the user certificate in the login request is consistent with the information recorded in the blockchain, increasing the difficulty for the user's certificate to be compromised.
[0125] (4) After authentication, the latest block information is obtained from the blockchain, the user certificate is updated using the latest block information, and the updated user certificate is sent to the user terminal, which can ensure the validity of the user certificate. When the user discovers that the certificate has been stolen, the danger can be easily eliminated by logging into the system immediately to obtain a new certificate.
[0126] In one embodiment of this document, a computer device is also provided, such as... Figure 6As shown, computer device 602 may include one or more processors 604, such as one or more central processing units (CPUs), each of which may implement one or more hardware threads. Computer device 602 may also include any memory 606 for storing information of any kind, such as code, settings, data, etc. Non-limitingly, for example, memory 606 may include any type of RAM, any type of ROM, flash memory, hard disk, optical disk, etc. More generally, any memory can use any technology to store information. Furthermore, any memory may provide volatile or non-volatile retention of information. Furthermore, any memory may represent a fixed or removable component of computer device 602. In one case, when processor 604 executes associated instructions stored in any memory or combination of memories, computer device 602 may perform any operation of the associated instructions. Computer device 602 also includes one or more drive mechanisms 608 for interacting with any memory, such as hard disk drive mechanisms, optical disk drive mechanisms, etc.
[0127] Computer device 602 may also include an input / output module 610 (I / O) for receiving various inputs (via input device 612) and providing various outputs (via output device 614). A specific output mechanism may include a presentation device 616 and an associated graphical user interface 618 (GUI). In other embodiments, the input / output module 610 (I / O), input device 612, and output device 614 may be omitted, and the device may function solely as a computer device within a network. Computer device 602 may also include one or more network interfaces 620 for exchanging data with other devices via one or more communication links 622. One or more communication buses 624 couple the components described above together.
[0128] Communication link 622 can be implemented in any way, such as via a local area network, a wide area network (e.g., the Internet), a point-to-point connection, or any combination thereof. Communication link 622 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc., governed by any protocol or combination of protocols.
[0129] This embodiment also provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the above-described method.
[0130] This embodiment also provides a computer-readable instruction, wherein when a processor executes the instruction, the program therein causes the processor to perform the method shown in any of the foregoing embodiments.
[0131] It should be understood that in the various embodiments of this document, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this document.
[0132] It should also be understood that, in the embodiments herein, the term "and / or" is merely a description of the relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following associated objects have an "or" relationship.
[0133] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this document.
[0134] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0135] In the embodiments provided herein, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the couplings or direct couplings or communication connections shown or discussed may be indirect couplings or communication connections through some interfaces, devices, or units, or they may be electrical, mechanical, or other forms of connection.
[0136] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments described herein, depending on actual needs.
[0137] Furthermore, the functional units in the various embodiments of this document can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0138] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this paper, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this paper. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0139] This document uses specific embodiments to illustrate the principles and implementation methods of this document. The descriptions of the embodiments above are only for the purpose of helping to understand the methods and core ideas of this document. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this document. Therefore, the content of this specification should not be construed as a limitation of this document.
Claims
1. A user authentication method based on proof-of-blocks, characterized in that, include: Receive login requests with user certificates sent by the client; The user certificate in the login request is verified using the latest user certificate in the system. After successful verification, the user's seed key is obtained. The user's seed key is then used to parse the user certificate in the login request to obtain the block information to be verified. The block information to be verified includes a first block parameter and a second block parameter. The verification of the user certificate in the login request using the latest user certificate in the system includes comparing whether the latest user certificate in the system is the same as the user certificate in the login request. If they are the same, it indicates that the login request is at risk of being intercepted. If the seed key cannot be found or decryption fails, a user certificate risk warning message is issued. Otherwise, the second block parameter is obtained from the blockchain based on the first block parameter in the block information to be verified, and the authentication result is obtained by comparing the obtained second block parameter with the second block parameter in the block information to be verified. After successful authentication, the latest block information is obtained from the blockchain, the user certificate is updated using the latest block information, and the updated user certificate is sent to the user terminal. Compare the updated user certificate with the original user certificate to see if they have changed; if they have not changed, issue a certificate of authenticity transaction; repeat the steps of obtaining the latest block information from the blockchain, updating the user certificate using the latest block information, and so on; or The system detects the duration during which no blocks have been generated in the blockchain. If the duration exceeds the predetermined duration, a notarized transaction is issued.
2. The method as described in claim 1, characterized in that, Before receiving a login request with the user's certificate from the client, the following steps are included: Receive a user creation request sent by the user terminal and allocate a seed key to the user; Extract user device information; Obtain the latest block information from the blockchain and encrypt the latest block information using a seed key; Calculate the user certificate based on the latest encrypted block information and the user device information; Send the user certificate to the user terminal.
3. The method as described in claim 2, characterized in that, The latest block information includes: the block height and block header hash of the latest block; The user equipment information includes: user account information and / or user equipment information.
4. The method as described in claim 2, characterized in that, Calculate the user certificate based on the latest encrypted block information and the user equipment information, including: Generate key information based on the user equipment information; The user certificate is obtained by integrating the latest encrypted block information and the key information using a preset integration algorithm.
5. The method as described in claim 4, characterized in that, The user certificate in the login request is parsed using the user's seed key to obtain the block information to be verified, including: The encrypted block information and key information are obtained by parsing the user certificate; Based on the user information in the login request, retrieve the user's seed key; The encrypted block information is decrypted using the user's seed key to obtain the block information to be verified.
6. The method as described in claim 4, characterized in that, Also includes: Based on the user's historical transaction data, determine the user's transaction frequency according to the preset plan; For users whose transaction frequency exceeds the predetermined value, a new seed key will be assigned to them.
7. A user authentication device based on blockchain proof, characterized in that, include: The first interaction unit is used to receive login requests with user certificates sent by the user client; The verification and parsing unit is used to verify the user certificate in the login request using the latest user certificate in the system. After successful verification, the user's seed key is obtained, and the user's seed key is used to parse the user certificate in the login request to obtain the block information to be verified. The block information to be verified includes a first block parameter and a second block parameter. The verification of the user certificate in the login request using the latest user certificate in the system includes: comparing whether the latest user certificate in the system is the same as the user certificate in the login request. If they are the same, it indicates that the login request is at risk of being intercepted. The authentication unit is used to issue a user certificate risk warning if the seed key cannot be found or decryption fails; otherwise, it obtains the second block parameter from the blockchain based on the first block parameter in the block information to be verified, and compares the obtained second block parameter with the second block parameter in the block information to be verified to obtain the authentication result. The update unit, after successful authentication, retrieves the latest block information from the blockchain, updates the user certificate using the latest block information, and sends the updated user certificate to the user terminal. It also includes modules that implement the following operations: Compare the updated user certificate with the original user certificate to see if they have changed; if they have not changed, issue a certificate of authenticity transaction; repeat the steps of obtaining the latest block information from the blockchain, updating the user certificate using the latest block information, and so on; or The system detects the duration during which no blocks have been generated in the blockchain. If the duration exceeds the predetermined duration, a notarized transaction is issued.
8. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method according to any one of claims 1 to 6.
9. A computer storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor of the computer device, it implements the method of any one of claims 1 to 6.
Citation Information
Patent Citations
Data processing method, data processing device and storage medium
CN110400142A
Key processing method and device based on block chain system, medium and electronic equipment
CN115776381A
