CN114584314A - Registration method, device, equipment and medium - Google Patents

Registration method, device, equipment and medium Download PDF

Info

Publication number
CN114584314A
CN114584314A CN202210190069.XA CN202210190069A CN114584314A CN 114584314 A CN114584314 A CN 114584314A CN 202210190069 A CN202210190069 A CN 202210190069A CN 114584314 A CN114584314 A CN 114584314A
Authority
CN
China
Prior art keywords
target
hash value
registration
user
encrypted
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210190069.XA
Other languages
Chinese (zh)
Inventor
刘紫千
余启明
常力元
曹然
佟欣哲
李金伟
陈林
刘长波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianyi Safety Technology Co Ltd
Original Assignee
Tianyi Safety Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianyi Safety Technology Co Ltd filed Critical Tianyi Safety Technology Co Ltd
Priority to CN202210190069.XA priority Critical patent/CN114584314A/en
Publication of CN114584314A publication Critical patent/CN114584314A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Abstract

The application provides a registration method, a device, equipment and a medium, because in the embodiment of the application, after the hash value obtained after the identity information of a user is subjected to hash processing is encrypted, the obtained encrypted hash value is stored in a block chain in advance, the encrypted hash value can be ensured not to be falsified due to the non-falsification of the block chain, and the subsequent user registration safety is ensured.

Description

Registration method, device, equipment and medium
Technical Field
The present application relates to the field of data security technologies, and in particular, to a registration method, apparatus, device, and medium.
Background
With the rapid development of the mobile internet technology, users pay more and more attention to the security problem of the registration process.
In the related art, generally, a simple encryption algorithm is used to encrypt the identity information of each user in advance, and the encrypted identity information of each user is stored locally in the electronic device, where the encrypted identity information of each user stored locally in the electronic device is correct and standard identity information of a user allowed to be registered, and is used to subsequently verify whether the received registration identity information of the user to be registered is correct, and further determine whether the user to be registered is allowed to be successfully registered.
However, since the encrypted identity information of each user stored in the electronic device is generally generated by encrypting based on a simple encryption algorithm, the corresponding security factor is not high, and a cracker can use methods such as a reverse analysis technique to crack the encrypted identity information of the user stored in the electronic device, so as to modify and steal the identity information of the user, which is not favorable for the registration security of the user, and is not favorable for protecting the privacy of the user, thereby influencing the experience of the user.
Disclosure of Invention
The application provides a registration method, a registration device and a registration medium, which are used for solving the problems that in the prior art, encrypted user identity information is directly stored in the local electronic equipment, and a cracker can crack the encrypted user identity information in the electronic equipment, so that the protection of user privacy is not facilitated.
In a first aspect, the present application provides a registration method, where the method includes:
receiving a registration instruction carrying target identification information of a user to be registered, and determining an encrypted first target hash value corresponding to the target identification information of the user to be registered according to the target identification information of the user to be registered and a correspondence between pre-stored identification information and an encrypted hash value, wherein the hash value is obtained by performing hash calculation based on identity information of the user, and the encrypted hash value is stored in a block chain;
generating a target registration code; sending the target registration code to target equipment corresponding to the user to be registered; decrypting the encrypted first target hash value to obtain the first target hash value;
receiving target registration identity information sent by the target equipment after the target registration code passes verification, and determining a second target hash value corresponding to the target registration identity information; and if the second target hash value is consistent with the first target hash value, determining that the registration is successful.
Further, the process of determining the encrypted hash value corresponding to the identity information of each user includes:
for each user, acquiring the identity information of the user; performing hash calculation on the identity information of the user, and determining a hash value corresponding to the identity information of the user; the hash value is signed based on a first private key obtained in advance, and a signed hash value corresponding to the user is obtained; and encrypting the signed hash value based on a second public key obtained in advance to obtain an encrypted hash value corresponding to the identity information of the user.
Further, the decrypting the encrypted first target hash value to obtain the first target hash value includes:
decrypting the encrypted first target hash value based on a second private key corresponding to the second public key obtained in advance to obtain a target signed hash value corresponding to the user to be registered;
and verifying the target signed hash value based on the pre-obtained first public key corresponding to the first private key to obtain a first target hash value corresponding to the target identity information of the user to be registered.
Further, after generating the target registration code, the method further includes:
signing the target registration code based on a second private key obtained in advance to obtain a signed target registration code;
encrypting the signed target registration code based on a first public key obtained in advance to obtain an encrypted target registration code;
and performing hash calculation on the encrypted target registration code to obtain a hash value corresponding to the encrypted target registration code, and storing the hash value corresponding to the encrypted target registration code in a block chain.
Further, the receiving target registration identity information sent by the target device after the target device passes the target registration code verification includes:
receiving a registration verification code and target registration identity information which are sent after the target equipment passes the verification of the target registration code;
after receiving the target registration identity information sent by the target device, and before determining that the registration is successful if the target registration identity information is consistent with the target identity information, the method further includes:
signing the registration verification code based on the second private key to obtain a signed registration verification code; encrypting the signed registration verification code based on the first public key to obtain an encrypted registration verification code; performing hash calculation on the encrypted registration verification code to obtain a hash value corresponding to the encrypted registration verification code;
determining whether a hash value corresponding to the encrypted registration verification code is consistent with a hash value corresponding to the target registration code corresponding to the user to be registered and stored in the block chain, wherein the hash value corresponding to the target registration code corresponding to the user to be registered is determined according to the identification information corresponding to the user to be registered and the correspondence between the pre-stored identification information and the hash value corresponding to the target registration code; if the target hash value is consistent with the first target hash value, determining the registration time length corresponding to the registration verification code according to the time for sending the target registration code and the time for receiving the registration verification code, and if the registration time length does not exceed a preset time length threshold value, performing subsequent operation if the second target hash value is consistent with the first target hash value, and determining that the registration is successful.
Further, the generating the target registration code includes:
determining the target identity information of the user to be registered according to the target identification information of the user to be registered and the corresponding relation between the pre-stored identification information and the identity information of the user;
and generating a target registration code according to the target identity information of the user to be registered and the timestamp corresponding to the current time.
In a second aspect, the present application further provides a registration apparatus, including:
the determining module is used for receiving a registration instruction carrying target identification information of a user to be registered, and determining an encrypted first target hash value corresponding to the target identification information of the user to be registered according to the target identification information of the user to be registered and a correspondence between pre-stored identification information and an encrypted hash value, wherein the hash value is obtained by performing hash calculation based on identity information of the user, and the encrypted hash value is stored in a block chain;
the acquisition module is used for generating a target registration code; sending the target registration code to target equipment corresponding to the user to be registered; decrypting the encrypted first target hash value to obtain the first target hash value;
the determining module is further configured to receive target registration identity information sent by the target device after the target registration code is verified, and determine a second target hash value corresponding to the target registration identity information; and if the second target hash value is consistent with the first target hash value, determining that the registration is successful.
Further, the determining module is further configured to, for each user, obtain identity information of the user; performing hash calculation on the identity information of the user, and determining a hash value corresponding to the identity information of the user; the hash value is signed based on a first private key obtained in advance, and a signed hash value corresponding to the user is obtained; and encrypting the signed hash value based on a second public key obtained in advance to obtain an encrypted hash value corresponding to the identity information of the user.
Further, the obtaining module is specifically configured to decrypt the encrypted first target hash value based on a second private key corresponding to the second public key obtained in advance, so as to obtain a target signed hash value corresponding to the user to be registered; and verifying the target signed hash value based on the pre-obtained first public key corresponding to the first private key to obtain a first target hash value corresponding to the target identity information of the user to be registered.
Further, the obtaining module is further configured to sign the target registration code based on a second private key obtained in advance, so as to obtain a signed target registration code; encrypting the signed target registration code based on a first public key obtained in advance to obtain an encrypted target registration code; and performing hash calculation on the encrypted target registration code to obtain a hash value corresponding to the encrypted target registration code, and storing the hash value corresponding to the encrypted target registration code in a block chain.
Further, the determining module is specifically configured to receive a registration verification code and target registration identity information that are sent by the target device after the target registration code passes verification;
the obtaining module is further configured to add a signature to the registration verification code based on the second private key to obtain a signed registration verification code; encrypting the signed registration verification code based on the first public key to obtain an encrypted registration verification code; performing hash calculation on the encrypted registration verification code to obtain a hash value corresponding to the encrypted registration verification code;
the determining module is further configured to determine whether a hash value corresponding to the encrypted registration verification code is consistent with a hash value corresponding to the target registration code corresponding to the user to be registered and stored in the blockchain, where the hash value corresponding to the target registration code corresponding to the user to be registered is determined according to the identification information corresponding to the user to be registered and a correspondence between pre-stored identification information and the hash value corresponding to the target registration code; if the target hash value is consistent with the first target hash value, determining the registration time length corresponding to the registration verification code according to the time for sending the target registration code and the time for receiving the registration verification code, and if the registration time length does not exceed a preset time length threshold value, performing subsequent operation if the second target hash value is consistent with the first target hash value, and determining that the registration is successful.
Further, the obtaining module is specifically configured to determine the target identity information of the user to be registered according to the target identification information of the user to be registered and a correspondence between pre-stored identification information and identity information of the user; and generating a target registration code according to the target identity information of the user to be registered and the timestamp corresponding to the current time.
In a third aspect, the present application further provides an electronic device, where the electronic device at least includes a processor and a memory, and the processor is configured to execute the steps of any one of the registration methods described above when executing a computer program stored in the memory.
In a fourth aspect, the present application further provides a computer-readable storage medium storing a computer program, which when executed by a processor performs the steps of any of the above-mentioned registration methods.
In the application, a registration instruction carrying target identification information of a user to be registered is received, an encrypted first target hash value corresponding to the target identification information of the user to be registered is determined according to the target identification information of the user to be registered and a correspondence between pre-stored identification information and the encrypted hash value, wherein the hash value is obtained by performing hash calculation based on identity information of the user, the encrypted hash value is stored in a block chain, a target registration code is generated and sent to target equipment corresponding to the user to be registered, the encrypted first target hash value is decrypted to obtain a first target hash value, the target registration identity information sent by the target equipment after the target registration code is verified is received, a second target hash value corresponding to the target registration identity information is determined, and if the second target hash value is consistent with the first target hash value, it is determined that the registration is successful. In the embodiment of the application, after the hash value obtained by hashing the identity information of the user is encrypted, the encrypted hash value is pre-stored in the block chain, and due to the fact that the block chain is not capable of being tampered, the encrypted hash value can be guaranteed not to be tampered, the subsequent user registration safety is guaranteed, and due to the traceability of the block chain, the traceability of the identity information of the user is also improved, namely, the newly added, deleted and obtained records of the encrypted identity information in the block chain are traceable, so that whether a cracker cracks the encrypted identity information by using methods such as a reverse analysis technology and the like can be quickly found, and the registration safety is improved.
Drawings
In order to more clearly illustrate the technical solutions in the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
Fig. 1 is a schematic diagram of a registration process provided in some embodiments of the present application;
fig. 2 is a schematic structural diagram of a registration apparatus according to some embodiments of the present application;
fig. 3 is a schematic structural diagram of an electronic device according to some embodiments of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be described in further detail with reference to the accompanying drawings, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the application, a registration instruction carrying target identification information of a user to be registered is received, an encrypted first target hash value corresponding to the target identification information of the user to be registered is determined according to the target identification information of the user to be registered and a correspondence between pre-stored identification information and the encrypted hash value, wherein the hash value is obtained by performing hash calculation based on identity information of the user, the encrypted hash value is stored in a block chain, a target registration code is generated and sent to target equipment corresponding to the user to be registered, the encrypted first target hash value is decrypted to obtain a first target hash value, the target registration identity information sent by the target equipment after the target registration code is verified is received, a second target hash value corresponding to the target registration identity information is determined, and if the second target hash value is consistent with the first target hash value, it is determined that the registration is successful.
Example 1:
in order to improve the security of user registration and protect the privacy security of the user, the application provides a registration method, a registration device, registration equipment and a registration medium.
Fig. 1 is a schematic diagram of a registration process provided in some embodiments of the present application, where the registration process includes the following steps:
s101: receiving a registration instruction carrying target identification information of a user to be registered, and determining an encrypted first target hash value corresponding to the target identification information of the user to be registered according to the target identification information of the user to be registered and a correspondence between pre-stored identification information and the encrypted hash value, wherein the hash value is obtained by performing hash calculation based on identity information of the user, and the encrypted hash value is stored in a block chain.
The registration method provided by the embodiment of the application is applied to the electronic equipment, and the electronic equipment can be a PC (personal computer), a server or the like.
In order to improve the security of the identity information of the user, in the embodiment of the present application, the identity information of each user may be stored in a block chain in advance, where the identity information of the user may include a name, an identity card number, and the like of the user, and may also include a mobile phone number, and the registration method may be applied to various fields, such as a school, an enterprise, and the like. Wherein the identity information of each user stored in the blockchain is the correct and standard identity information of the user allowed to register.
In order to further improve the security of the identity information of the user, in this embodiment of the application, the identity information of the user may be subjected to hash calculation in advance for each user, a hash value corresponding to the identity information of the user is determined, then the hash value is encrypted to obtain an encrypted hash value, and the encrypted hash value is stored in the blockchain.
In this embodiment of the application, hash calculation may be performed on the identity information of the user based on a preset hash algorithm, where the preset hash algorithm may be a hash algorithm such as MD5, and specifically, the preset hash algorithm may be set according to a requirement.
The process of performing hash calculation on the identity information of the user and determining the hash value corresponding to the identity information of the user is the prior art, and is not described herein again.
On one hand, the blockchain has the advantages of being not falsifiable and traceability, so that the identity information of the user stored in the blockchain can be guaranteed not to be falsified, the addition, deletion and the like of the identity information of the user stored in the blockchain can be traced, and the safety problem of the identity information of the user can be favorably supervised; on the other hand, since the hash calculation is irreversible, that is, after the hash calculation is performed on the identity information of the user to determine the hash value corresponding to the identity information of the user, the hash value corresponding to the identity information of the user cannot be processed to obtain the identity information of the user, the security of the identity information of the user is further improved.
In order to implement secure registration, in the embodiment of the present application, an electronic device receives a registration instruction carrying identification information of a user to be registered, where the registration instruction carrying the identification information of the user to be registered and received by the electronic device is sent by a target device corresponding to the user to be registered, and the target device corresponding to the user to be registered is an electronic device used when the user is registered. The identification information may be information that can uniquely identify the user identity, such as a mobile phone number, a user name, an identity card number, and the like of the user.
In this embodiment of the application, when the user to be registered registers on the target device corresponding to the user to be registered, the registration instruction may be triggered by the application program to be registered installed on the target device, for example, the user to be registered may click a "registration" button in the application program to be registered on the target device to trigger the registration instruction, the user to be registered may also trigger the registration instruction by clicking a "acquire registration code" button in the application program to be registered on the target device to trigger the registration instruction, and specifically, how the target device triggers the registration instruction is not limited herein.
In order to determine which encrypted hash value of the encrypted hash values stored in the blockchain is the encrypted hash value corresponding to the user to be registered, in this embodiment of the application, a corresponding relationship between the identification information and the encrypted hash value is pre-stored in the electronic device, after the target identification information of the user to be registered is determined, the encrypted hash value corresponding to the target identification information is determined according to the identification information and the corresponding relationship between the pre-stored identification information and the encrypted hash value, and the determined encrypted hash value is used as the first encrypted target hash value.
S102: generating a target registration code; sending the target registration code to target equipment corresponding to the user to be registered; and decrypting the encrypted first target hash value to obtain the first target hash value.
In the embodiment of the application, in order to implement secure registration, after receiving a registration instruction carrying target identification information of a user to be registered, a target registration code can be generated and sent to a target device corresponding to the user to be registered, wherein the target registration code is a correct registration code for the user to refer to for completing the registration, the target registration code may be randomly generated, e.g., a fixed-length random number generated based on a random function, the random number being the target registration code, or a set number of digits are selected from 0 to 9, and the set number of digits are sorted according to a set order to obtain the target registration code, for example, if the number selected from 0 to 9 is 1, 2, 3, or 4, the generated target registration code may be 4321 or 2341, and so on. The target registration code can be sent to the target device by a short message or an email.
In order to facilitate subsequent authentication of the identity of the user to be registered and further determine whether the registration is successful, in the embodiment of the application, after the encrypted first target hash value is determined, the encryption algorithm for encrypting the first target hash value is stored locally, so that the encrypted first target hash value can be decrypted according to the encryption algorithm to obtain the first target hash value.
S103: receiving target registration identity information sent by the target equipment after the target registration code passes verification, and determining a second target hash value corresponding to the target registration identity information; and if the second target hash value is consistent with the first target hash value, determining that the registration is successful.
In this embodiment, after sending the generated target registration code to the target device corresponding to the user to be registered, the target device may receive the input registration verification code, verify whether the registration verification code is input correctly, if the registration verification code is input correctly, determine that the target registration code is verified to pass, and receive the target registration identity information sent by the target device after the target registration code is verified to pass, wherein an input field for inputting the verification code may be displayed to the user, and prompt information of the verification code to be input is displayed, the user inputs the registration verification code and the target registration identity information on a registration page of the registered application program, where what the input registration verification code is depends on a rule preset by the target device and the electronic device, such as if the preset rule is the last three digits of the input registration verification code, the target device, upon entering the enrollment authentication code, compares the enrollment authentication code with the last three digits of the target enrollment code to determine whether the entered enrollment authentication code is correct, and so on.
A common pre-set rule is that the registration verification code is consistent with the target registration code. If the registration verification code is consistent with the target registration code, the target registration code is determined to pass the verification, the target registration identity information is determined to be allowed to be sent to the electronic equipment, if the registration verification code is inconsistent with the target registration code, the target registration code is determined to fail the verification, and the target registration identity information is determined not to be sent to the electronic equipment. The target registration identity information may include a name, a mobile phone number, an identity card number, and other identity information, and content included in the target registration identity information is the same as identity information included in the identity information of the user to be registered, which is obtained by the electronic device, that is, when the identity information of the user to be registered, which is obtained by the electronic device, includes the name and the identity card number, the target registration identity information of the user to be registered also includes the name and the identity card number.
In order to complete the verification of the identity information of the user to be registered, in the embodiment of the present application, after receiving the target registration identity information of the user to be registered, the hash calculation is performed on the target registration identity information, a second target hash value corresponding to the target registration identity information is determined, the second target hash value is compared with the first target hash value, and whether the registration is successful is determined according to the comparison result.
Specifically, if the second target hash value is consistent with the first target hash value, it indicates that the target registration identity information of the user to be registered is correct, and it is determined that the registration is successful, and if the second target hash value is inconsistent with the first target hash value, it indicates that the target registration identity information of the user to be registered is incorrect, and it is determined that the registration is unsuccessful.
In the embodiment of the application, after the hash value obtained by hashing the identity information of the user is encrypted, the obtained encrypted hash value is stored in the block chain in advance, and due to the fact that the block chain is not capable of being tampered, the encrypted hash value can be guaranteed not to be tampered, the subsequent user registration safety is guaranteed, and due to the traceability of the block chain, the traceability of the user identity information is improved, namely, the newly added, deleted and obtained records of the encrypted user identity information in the block chain are traceable, so that whether a cracker cracks the encrypted identity information by using methods such as a reverse analysis technology and the like can be found quickly, and the registration safety is improved.
Example 2:
in order to determine the hash value corresponding to the identity information of each user, on the basis of the foregoing embodiment, in an embodiment of the present application, the process of determining the hash value corresponding to the identity information of each user includes:
for each user, acquiring the identity information of the user; performing hash calculation on the identity information of the user, and determining a hash value corresponding to the identity information of the user; the hash value is signed based on a first private key obtained in advance, and a signed hash value corresponding to the user is obtained; and encrypting the signed hash value based on a second public key obtained in advance to obtain an encrypted hash value corresponding to the identity information of the user.
In order to determine the hash value corresponding to the identity information of each user, in the embodiment of the present application, for each user, the identity information of the user is obtained, where the obtained identity information of the user is correct and standard identity information of the user, and then hash calculation is performed on the obtained identity information of the user to obtain the hash value corresponding to the identity information of the user.
In order to further improve the security of the identity information of the user, in this embodiment of the application, the hash value corresponding to the identity information of the user may be encrypted, specifically, the electronic device generates two public and private key pairs in advance, which are a first public and private key pair and a second public and private key pair respectively, where the first public and private key pair includes a first public key and a first private key, and the second public and private key pair includes a second public key and a second private key, and may perform signing processing on the hash value corresponding to the identity information of the user based on the first private key in the first public and private key pair to obtain a signed hash value corresponding to the user, and then encrypt the signed hash value based on the second public key in the second public and private key pair to obtain an encrypted hash value corresponding to the identity information of the user. Wherein, this first public private key pair and this second public private key pair can be the public private key pair of symmetry, also can be for asymmetric public private key pair, and is specific, can set up first public private key pair and second public private key pair according to the demand.
In this embodiment, the first private Key may be a signature private Key in a hardware digital certificate carrier (USB Key), where the USB Key is used to store a digital certificate representing a unique identity of a user and the signature private Key, and the signature private Key is generated within a high-security USB Key and cannot be exported outside the USB Key for life.
Specifically, the electronic device may have a USB Key inserted in advance, and add identity information to a plurality of users, where the identity information may include, for example, a name, a mobile phone number, an identity card number, a position, a department, and the like, and after obtaining the identity information of each user, identify information corresponding to the user is determined for the identity information of each user, where the mobile phone number in the identity information of the user may be determined as the identify information of the user, and a digital certificate and a signature private Key capable of representing a unique identity of the user are set for each user of the identify information, that is, a corresponding relationship between the identify information of the user and the signature private Key is pre-stored in the electronic device. After a registration instruction carrying target identification information of a user to be registered is received, a signature private key corresponding to the user to be registered is determined according to the identification information of the user to be registered, the signature private key corresponding to the user to be registered is determined as a first private key corresponding to the user to be registered, and the first private key is used for signing target identity information of the user to be registered.
The process of generating the first public-private key pair and the second public-private key pair is prior art and is not described herein again.
In order to obtain the first target hash value, on the basis of the foregoing embodiments, in an embodiment of the present application, the decrypting the encrypted first target hash value to obtain the first target hash value includes:
decrypting the encrypted first target hash value based on a second private key corresponding to the second public key obtained in advance to obtain a target signed hash value corresponding to the user to be registered;
and verifying the target signed hash value based on the pre-obtained first public key corresponding to the first private key to obtain a first target hash value corresponding to the target identity information of the user to be registered.
In the embodiment of the present application, since the encrypted first target hash value is obtained by encrypting the hash value corresponding to the identity information of the user to be registered, and the encrypted first target hash value is obtained by signing the hash value corresponding to the target identity information of the user to be registered based on the first private key in the first public-private key pair, so as to obtain the target signed hash value corresponding to the user to be registered, and then the target signed hash value is obtained by encrypting the target signed hash value based on the second public key in the second public-private key pair, in order to obtain the first target hash value according to the encrypted first target hash value, in the embodiment of the present application, the encrypted first target hash value is decrypted based on the second private key in the second public-private key pair, that is, the encrypted first target hash value is decrypted based on the second private key corresponding to the second public key obtained in advance, and obtaining a target signed hash value of the user to be registered, and then checking the target signed hash value based on a first public key in the first public and private key pair, namely checking the target signed hash value based on a first public key corresponding to a first private key obtained in advance to obtain a first target hash value corresponding to target identity information of the user to be registered.
In the embodiment of the present application, in order to ensure that the stored encrypted hash value stored in the blockchain has no error in the encryption process, and further ensure the accuracy of the encrypted hash value stored in the blockchain, in the embodiment of the present application, before the user registers, generally before the registered application is listed, the accuracy of the encrypted hash value stored in the blockchain may be verified, and specifically, because the signed hash value corresponding to the identity information of the user is signed based on the first private key when the encrypted hash value is obtained, the signed hash value corresponding to the user is obtained, the signed hash value may be referred to as a first signed hash value, and the first signed hash value is encrypted based on the second public key to obtain an encrypted hash value corresponding to the identity information of the user, and the obtained signed hash value corresponding to the user is referred to as a first signed hash value.
When the encrypted hash value is verified, the encrypted hash value is decrypted based on a second private key to obtain a signed hash value corresponding to the user, the obtained signed hash value corresponding to the user is called a second signed hash value, the second signed hash value is verified based on the first public key to obtain a hash value corresponding to the identity information of the user, and the obtained hash value corresponding to the identity information of the user is called the second hash value. In order to verify the accuracy of the encrypted hash value stored in the blockchain, in the embodiment of the present application, it is determined whether the first signed hash value and the second signed hash value are changed or not, if so, it is determined that the verification fails, if not, it is determined that the first hash value and the second hash value are changed or not, if so, it is determined that the verification fails, and if not, it is determined that the verification succeeds.
Specifically, the electronic device pre-stores a first hash value and a first signed hash value corresponding to each user, and in order to improve security, the first hash value and the first signed hash value corresponding to each user may also be stored in the block chain.
Specifically, the verification interval duration may be preset, so that the electronic device verifies the accuracy of the encrypted hash value stored in the block chain once every other verification interval duration, or the electronic device may verify the accuracy of the encrypted hash value stored in the block chain once after receiving the verification instruction.
Example 3:
in order to improve the security of registration, on the basis of the foregoing embodiments, in an embodiment of the present application, after the generating the target registration code, the method further includes:
signing the target registration code based on a second private key obtained in advance to obtain a signed target registration code;
encrypting the signed target registration code based on a first public key obtained in advance to obtain an encrypted target registration code;
and performing hash calculation on the encrypted target registration code to obtain a hash value corresponding to the encrypted target registration code, and storing the hash value corresponding to the encrypted target registration code in a block chain.
In order to improve the security of registration, after the electronic device generates a target registration code, the target registration code is sent to a target device corresponding to a user to be registered, the target registration code is encrypted, the encrypted target registration code is stored in the local electronic device, and after the target device corresponding to the user to be registered passes verification of the target registration code, target registration identity information is sent to the electronic device. In order to improve the security of registration, in this embodiment of the present application, an encrypted registration code obtained by encrypting the registration code may also be stored in the blockchain. Specifically, the target registration code is signed based on a second private key obtained in advance to obtain a signed target registration code, then the signed target registration code is encrypted based on a first public key to obtain an encrypted target registration code, then the encrypted target registration code is subjected to hash calculation to obtain a hash value corresponding to the encrypted target registration code, and the hash value corresponding to the encrypted target registration code is stored in a block chain.
On one hand, as the blockchain has non-falsification and traceability, the hash value corresponding to the encrypted registration code stored in the blockchain can be guaranteed not to be falsified, and the addition, deletion and the like of the hash value corresponding to the encrypted registration code stored in the blockchain can be traced, which is beneficial to supervising the safety problem; on the other hand, since the hash calculation is irreversible, that is, after the hash calculation is performed on the encrypted target registration code to obtain the hash value corresponding to the encrypted target registration code, the target registration code cannot be obtained by processing according to the hash value corresponding to the encrypted target registration code, and therefore, the registration security is further improved.
Example 4:
in order to improve the security of registration, on the basis of the foregoing embodiments, in an embodiment of the present application, the receiving target registration identity information sent by the target device after the target registration code is verified includes:
receiving a registration verification code and target registration identity information which are sent after the target equipment passes the verification of the target registration code;
after receiving the target registration identity information sent by the target device, and before determining that the registration is successful if the target registration identity information is consistent with the target identity information, the method further includes:
signing the registration verification code based on the second private key to obtain a signed registration verification code; encrypting the signed registration verification code based on the first public key to obtain an encrypted registration verification code; performing hash calculation on the encrypted target registration code to obtain a hash value corresponding to the encrypted target registration code;
determining whether a hash value corresponding to the encrypted registration verification code is consistent with a hash value corresponding to the encrypted target registration code corresponding to the user to be registered and stored in the block chain, wherein the hash value corresponding to the encrypted target registration code corresponding to the user to be registered is determined according to the identification information corresponding to the user to be registered and the corresponding relationship between pre-stored identification information and the hash value corresponding to the encrypted target registration code; if the target hash value is consistent with the first target hash value, determining the registration time length corresponding to the registration verification code according to the time for sending the target registration code and the time for receiving the registration verification code, and if the registration time length does not exceed a preset time length threshold value, performing subsequent operation if the second target hash value is consistent with the first target hash value, and determining that the registration is successful.
In the embodiment of the application, after the target device corresponding to the user to be registered receives the target registration code sent by the electronic device, verification can be performed based on the target registration code, that is, the user needs to input the registration verification code based on the target device. Therefore, in order to implement verification of the target registration code, in the embodiment of the application, when receiving target registration identity information sent after the target device passes the verification of the target registration code, the electronic device may also receive a registration verification code sent after the target device passes the verification of the target registration code.
Since the hash value corresponding to the encrypted target registration code is stored in the blockchain, and since the hash calculation is irreversible, that is, the target registration code cannot be obtained based on the hash value corresponding to the encrypted target registration code, in the embodiment of the present application, in order to perform registration code verification, for each user, after receiving the registration verification code sent by the target equipment corresponding to the user, signing the registration verification code based on the second private key to obtain a signed registration verification code, and then encrypting the signed registration verification code based on the first public key to obtain an encrypted registration verification code, performing hash calculation on the encrypted registration verification code to obtain a hash value corresponding to the encrypted registration verification code, and finally comparing the hash value corresponding to the encrypted registration verification code with the hash value corresponding to the encrypted target registration code of the user stored in the block chain.
Specifically, in order to determine which encrypted target registration code corresponds to the hash value corresponding to the encrypted target registration code corresponding to the user to be registered among the hash values corresponding to all encrypted target registration codes stored in the blockchain, a correspondence between the identification information of the user and the hash value of the encrypted target registration code is stored in the electronic device in advance, and the hash value of the encrypted target registration code corresponding to the user to be registered is determined based on the identification information of the user to be registered. If the hash value corresponding to the encrypted registration verification code is consistent with the hash value corresponding to the target registration code stored in the blockchain, whether the registration verification code is still valid or not can be considered, specifically, the registration duration corresponding to the target login registration code can be determined according to the time of sending the target registration code and the time of receiving the registration verification code. If the registration time length does not exceed the preset time length threshold value, determining that the registration verification code is valid, and subsequently judging whether the second target hash value is consistent with the first target hash value or not and judging whether the registration is successful or not.
If the hash value corresponding to the encrypted registration verification code is not consistent with the hash value corresponding to the encrypted target registration code of the user stored in the blockchain, or the hash value corresponding to the encrypted registration verification code is consistent with the hash value corresponding to the encrypted target registration code of the user stored in the blockchain, but the registration verification code fails, it is determined that the registration fails. If the registration time length corresponding to the target login registration code is determined according to the time for sending the target registration code and the time for receiving the registration verification code, and if the registration time length exceeds a preset time length threshold value, the registration verification code is determined to be invalid. The preset duration threshold may be 5 minutes, 30 minutes, 1 hour, or the like, and specifically, the preset duration threshold may be set according to a requirement.
Example 5:
in order to generate the target registration code, on the basis of the foregoing embodiments, in an embodiment of the present application, the generating the target registration code includes:
determining the target identity information of the user to be registered according to the target identification information of the user to be registered and the corresponding relation between the pre-stored identification information and the identity information of the user;
and generating a target registration code according to the target identity information of the user to be registered and the timestamp corresponding to the current time.
In this application embodiment, the electronic device may randomly generate a registration code, and may further generate a target registration code according to target identity information of a user to be registered and a timestamp corresponding to the current time, specifically, in order to determine the target identity information of the user to be registered from the identity information of each user, in this application embodiment, a corresponding relationship between the identity information and the identity information of the user is pre-stored in the electronic device, after receiving a registration instruction carrying the target identity information of the user to be registered, the electronic device obtains the target identity information of the user to be registered carried in the registration instruction, and determines the target identity information corresponding to the target identity information of the user to be registered according to the target identity information and the corresponding relationship between the pre-stored identity information and the identity information of the user.
Specifically, in the embodiment of the present application, in the process of generating the target registration code according to the target identity information of the user to be registered and the timestamp corresponding to the current time, all the characters, numbers, or characters included in the target identity information of the user to be registered and the timestamp corresponding to the current time may be arranged in a random arrangement manner, and the arranged result is determined as the generated target registration code.
In the embodiment of the present application, a part of the texts, numbers or characters may be screened out from the target identity information of the user to be registered and all the texts, numbers or characters contained in the timestamp corresponding to the current time, and the screened texts, numbers or characters may be arranged in a random arrangement manner to generate the target registration code. Specifically, several words or numbers or characters are screened from the target identity information of the user, and the several words or numbers or characters screened from the timestamp corresponding to the current time may be preset, which is not limited herein.
For example, if the current timestamp is 202108301500, three digits, i.e., 8, 3, and 0, are randomly extracted from the current timestamp "202108301500", three digits, i.e., 1, and 0, are randomly extracted from the phone number "11111100000" in the user identity information, and after the six digits are randomly arranged, the target registration code may be 130801, 110803, and the like.
Example 6:
fig. 2 is a schematic structural diagram of a registration device according to some embodiments of the present application, where the device for predicting risk of highway accident includes:
a determining module 201, configured to receive a registration instruction carrying target identification information of a user to be registered, and determine an encrypted first target hash value corresponding to the target identification information of the user to be registered according to the target identification information of the user to be registered and a correspondence between pre-stored identification information and an encrypted hash value, where the hash value is obtained by performing hash calculation based on identity information of the user, and the encrypted hash value is stored in a block chain;
an obtaining module 202, configured to generate a target registration code; sending the target registration code to target equipment corresponding to the user to be registered; decrypting the encrypted first target hash value to obtain the first target hash value;
the determining module 201 is further configured to receive target registration identity information sent by the target device after the target registration code passes verification, and determine a second target hash value corresponding to the target registration identity information; and if the second target hash value is consistent with the first target hash value, determining that the registration is successful.
In a possible implementation manner, the determining module 201 is further configured to, for each user, obtain identity information of the user; performing hash calculation on the identity information of the user, and determining a hash value corresponding to the identity information of the user; the hash value is signed based on a first private key obtained in advance, and a signed hash value corresponding to the user is obtained; and encrypting the signed hash value based on a second public key obtained in advance to obtain an encrypted hash value corresponding to the identity information of the user.
In a possible implementation manner, the obtaining module 202 is specifically configured to decrypt the encrypted first target hash value based on a second private key corresponding to the second public key obtained in advance, so as to obtain a target signed hash value corresponding to the user to be registered; and verifying the target signed hash value based on the pre-obtained first public key corresponding to the first private key to obtain a first target hash value corresponding to the target identity information of the user to be registered.
In a possible implementation manner, the obtaining module 202 is further configured to perform tagging on the target registration code based on a second private key obtained in advance, so as to obtain a tagged target registration code; encrypting the signed target registration code based on a first public key obtained in advance to obtain an encrypted target registration code; and performing hash calculation on the encrypted target registration code to obtain a hash value corresponding to the encrypted target registration code, and storing the hash value corresponding to the encrypted target registration code in a block chain.
In a possible implementation manner, the determining module 201 is specifically configured to receive a registration verification code and target registration identity information that are sent by the target device after the target device verifies the target registration code;
the obtaining module 202 is further configured to sign the registration verification code based on the second private key to obtain a signed registration verification code; encrypting the signed registration verification code based on the first public key to obtain an encrypted registration verification code; performing hash calculation on the encrypted registration verification code to obtain a hash value corresponding to the encrypted registration verification code;
the determining module 201 is further configured to determine whether a hash value corresponding to the encrypted registration verification code is consistent with a hash value corresponding to the target registration code corresponding to the user to be registered and stored in the blockchain, where the hash value corresponding to the target registration code corresponding to the user to be registered is determined according to the identification information corresponding to the user to be registered and a correspondence between pre-stored identification information and the hash value corresponding to the target registration code; if the target hash value is consistent with the first target hash value, determining the registration time length corresponding to the registration verification code according to the time for sending the target registration code and the time for receiving the registration verification code, and if the registration time length does not exceed a preset time length threshold value, performing subsequent operation if the second target hash value is consistent with the first target hash value, and determining that the registration is successful.
In a possible implementation manner, the obtaining module 202 is specifically configured to determine the target identity information of the user to be registered according to the target identification information of the user to be registered and a correspondence between pre-stored identification information and identity information of the user; and generating a target registration code according to the target identity information of the user to be registered and the timestamp corresponding to the current time.
Example 7:
fig. 3 is a schematic structural diagram of an electronic device according to some embodiments of the present application, and on the basis of the foregoing embodiments, the present application further provides an electronic device, as shown in fig. 3, including: the system comprises a processor 301, a communication interface 302, a memory 303 and a communication bus 304, wherein the processor 301, the communication interface 302 and the memory 303 are communicated with each other through the communication bus 304.
The memory 303 has stored therein a computer program which, when executed by the processor 301, causes the processor 301 to perform the steps of:
receiving a registration instruction carrying target identification information of a user to be registered, and determining an encrypted first target hash value corresponding to the target identification information of the user to be registered according to the target identification information of the user to be registered and a correspondence between pre-stored identification information and an encrypted hash value, wherein the hash value is obtained by performing hash calculation based on identity information of the user, and the encrypted hash value is stored in a block chain;
generating a target registration code; sending the target registration code to target equipment corresponding to the user to be registered; decrypting the encrypted first target hash value to obtain the first target hash value;
receiving target registration identity information sent by the target equipment after the target registration code passes verification, and determining a second target hash value corresponding to the target registration identity information; and if the second target hash value is consistent with the first target hash value, determining that the registration is successful.
Further, the processor 301 is further configured to, for each user, obtain identity information of the user; performing hash calculation on the identity information of the user, and determining a hash value corresponding to the identity information of the user; the hash value is signed based on a first private key obtained in advance, and a signed hash value corresponding to the user is obtained; and encrypting the signed hash value based on a second public key obtained in advance to obtain an encrypted hash value corresponding to the identity information of the user.
Further, the processor 301 is further configured to decrypt the encrypted first target hash value based on a second private key corresponding to the second public key obtained in advance, so as to obtain a target signed hash value corresponding to the user to be registered; and verifying the target signed hash value based on the pre-obtained first public key corresponding to the first private key to obtain a first target hash value corresponding to the target identity information of the user to be registered.
Further, the processor 301 is further configured to sign the target registration code based on a second private key obtained in advance, so as to obtain a signed target registration code; encrypting the signed target registration code based on a first public key obtained in advance to obtain an encrypted target registration code; and performing hash calculation on the encrypted target registration code to obtain a hash value corresponding to the encrypted target registration code, and storing the hash value corresponding to the encrypted target registration code in a block chain.
Further, the processor 301 is further configured to receive a registration verification code and target registration identity information, which are sent after the target device passes the verification of the target registration code; signing the registration verification code based on the second private key to obtain a signed registration verification code; encrypting the signed registration verification code based on the first public key to obtain an encrypted registration verification code; performing hash calculation on the encrypted registration verification code to obtain a hash value corresponding to the encrypted registration verification code; determining whether a hash value corresponding to the encrypted registration verification code is consistent with a hash value corresponding to the target registration code corresponding to the user to be registered and stored in the block chain, wherein the hash value corresponding to the target registration code corresponding to the user to be registered is determined according to the identification information corresponding to the user to be registered and the correspondence between the pre-stored identification information and the hash value corresponding to the target registration code; if the target hash value is consistent with the first target hash value, determining the registration time length corresponding to the registration verification code according to the time for sending the target registration code and the time for receiving the registration verification code, and if the registration time length does not exceed a preset time length threshold value, performing subsequent operation if the second target hash value is consistent with the first target hash value, and determining that the registration is successful.
Further, the processor 301 is further configured to determine target identity information of the user to be registered according to the target identity information of the user to be registered and a correspondence between pre-stored identity information and identity information of the user; and generating a target registration code according to the target identity information of the user to be registered and the timestamp corresponding to the current time.
The communication bus mentioned in the above server may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface 302 is used for communication between the above-described electronic apparatus and other apparatuses.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Alternatively, the memory may be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a central processing unit, a Network Processor (NP), and the like; but may also be a Digital instruction processor (DSP), an application specific integrated circuit, a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or the like.
Example 8:
on the basis of the foregoing embodiments, the present application further provides a computer-readable storage medium, in which a computer program executable by an electronic device is stored, and when the program is run on the electronic device, the electronic device is caused to execute the following steps:
the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of:
receiving a registration instruction carrying target identification information of a user to be registered, and determining an encrypted first target hash value corresponding to the target identification information of the user to be registered according to the target identification information of the user to be registered and a correspondence between pre-stored identification information and an encrypted hash value, wherein the hash value is obtained by performing hash calculation based on identity information of the user, and the encrypted hash value is stored in a block chain;
generating a target registration code; sending the target registration code to target equipment corresponding to the user to be registered; decrypting the encrypted first target hash value to obtain the first target hash value;
receiving target registration identity information sent by the target equipment after the target registration code passes verification, and determining a second target hash value corresponding to the target registration identity information; and if the second target hash value is consistent with the first target hash value, determining that the registration is successful.
Further, the process of determining the encrypted hash value corresponding to the identity information of each user includes:
for each user, acquiring the identity information of the user; performing hash calculation on the identity information of the user, and determining a hash value corresponding to the identity information of the user; the hash value is signed based on a first private key obtained in advance, and a signed hash value corresponding to the user is obtained; and encrypting the signed hash value based on a second public key obtained in advance to obtain an encrypted hash value corresponding to the identity information of the user.
Further, the decrypting the encrypted first target hash value to obtain the first target hash value includes:
decrypting the encrypted first target hash value based on a second private key corresponding to the second public key obtained in advance to obtain a target signed hash value corresponding to the user to be registered;
and verifying the target signed hash value based on the pre-obtained first public key corresponding to the first private key to obtain a first target hash value corresponding to the target identity information of the user to be registered.
Further, after generating the target registration code, the method further includes:
signing the target registration code based on a second private key obtained in advance to obtain a signed target registration code;
encrypting the signed target registration code based on a first public key obtained in advance to obtain an encrypted target registration code;
and performing hash calculation on the encrypted target registration code to obtain a hash value corresponding to the encrypted target registration code, and storing the hash value corresponding to the encrypted target registration code in a block chain.
Further, the receiving target registration identity information sent by the target device after the target device passes the target registration code verification includes:
receiving a registration verification code and target registration identity information which are sent after the target equipment passes the verification of the target registration code;
after receiving the target registration identity information sent by the target device, and before determining that the registration is successful if the target registration identity information is consistent with the target identity information, the method further includes:
signing the registration verification code based on the second private key to obtain a signed registration verification code; encrypting the signed registration verification code based on the first public key to obtain an encrypted registration verification code; performing hash calculation on the encrypted registration verification code to obtain a hash value corresponding to the encrypted registration verification code;
determining whether a hash value corresponding to the encrypted registration verification code is consistent with a hash value corresponding to the target registration code corresponding to the user to be registered and stored in the block chain, wherein the hash value corresponding to the target registration code corresponding to the user to be registered is determined according to the identification information corresponding to the user to be registered and the correspondence between the pre-stored identification information and the hash value corresponding to the target registration code; if the target hash value is consistent with the first target hash value, determining the registration time length corresponding to the registration verification code according to the time for sending the target registration code and the time for receiving the registration verification code, and if the registration time length does not exceed a preset time length threshold value, performing subsequent operation if the second target hash value is consistent with the first target hash value, and determining that the registration is successful.
Further, the generating the target registration code includes:
determining the target identity information of the user to be registered according to the target identification information of the user to be registered and the corresponding relation between the pre-stored identification information and the identity information of the user;
and generating a target registration code according to the target identity information of the user to be registered and the timestamp corresponding to the current time.
In the embodiment of the application, after the hash value obtained by hashing the identity information of the user is encrypted, the obtained encrypted hash value is stored in the block chain in advance, and due to the fact that the block chain is not capable of being tampered, the encrypted hash value can be guaranteed not to be tampered, the subsequent user registration safety is guaranteed, and due to the traceability of the block chain, the traceability of the user identity information is improved, namely, the newly added, deleted and obtained records of the encrypted user identity information in the block chain are traceable, so that whether a cracker cracks the encrypted identity information by using methods such as a reverse analysis technology and the like can be found quickly, and the registration safety is improved.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (14)

1. A method of registration, the method comprising:
receiving a registration instruction carrying target identification information of a user to be registered, and determining an encrypted first target hash value corresponding to the target identification information of the user to be registered according to the target identification information of the user to be registered and a correspondence between pre-stored identification information and an encrypted hash value, wherein the hash value is obtained by performing hash calculation based on identity information of the user, and the encrypted hash value is stored in a block chain;
generating a target registration code; sending the target registration code to target equipment corresponding to the user to be registered; decrypting the encrypted first target hash value to obtain the first target hash value;
receiving target registration identity information sent by the target equipment after the target registration code passes verification, and determining a second target hash value corresponding to the target registration identity information; and if the second target hash value is consistent with the first target hash value, determining that the registration is successful.
2. The method of claim 1, wherein determining the encrypted hash value corresponding to the identity information of each user comprises:
for each user, acquiring the identity information of the user; performing hash calculation on the identity information of the user, and determining a hash value corresponding to the identity information of the user; the hash value is signed based on a first private key obtained in advance, and a signed hash value corresponding to the user is obtained; and encrypting the signed hash value based on a second public key obtained in advance to obtain an encrypted hash value corresponding to the identity information of the user.
3. The method of claim 2, wherein decrypting the encrypted first target hash value to obtain the first target hash value comprises:
decrypting the encrypted first target hash value based on a second private key corresponding to the second public key obtained in advance to obtain a target signed hash value corresponding to the user to be registered;
and verifying the target signed hash value based on the pre-obtained first public key corresponding to the first private key to obtain a first target hash value corresponding to the target identity information of the user to be registered.
4. The method of claim 1 or 2, wherein after generating the target registration code, the method further comprises:
signing the target registration code based on a second private key obtained in advance to obtain a signed target registration code;
encrypting the signed target registration code based on a first public key obtained in advance to obtain an encrypted target registration code;
and performing hash calculation on the encrypted target registration code to obtain a hash value corresponding to the encrypted target registration code, and storing the hash value corresponding to the encrypted target registration code in a block chain.
5. The method of claim 4, wherein receiving the target registration identity information sent by the target device after the target registration code is verified comprises:
receiving a registration verification code and target registration identity information which are sent after the target equipment passes the verification of the target registration code;
after receiving the target registration identity information sent by the target device, and before determining that the registration is successful if the target registration identity information is consistent with the target identity information, the method further includes:
signing the registration verification code based on the second private key to obtain a signed registration verification code; encrypting the signed registration verification code based on the first public key to obtain an encrypted registration verification code; performing hash calculation on the encrypted registration verification code to obtain a hash value corresponding to the encrypted registration verification code;
determining whether a hash value corresponding to the encrypted registration verification code is consistent with a hash value corresponding to the target registration code corresponding to the user to be registered and stored in the block chain, wherein the hash value corresponding to the target registration code corresponding to the user to be registered is determined according to the identification information corresponding to the user to be registered and the correspondence between the pre-stored identification information and the hash value corresponding to the target registration code; if the target hash value is consistent with the first target hash value, determining the registration time length corresponding to the registration verification code according to the time for sending the target registration code and the time for receiving the registration verification code, and if the registration time length does not exceed a preset time length threshold value, performing subsequent operation if the second target hash value is consistent with the first target hash value, and determining that the registration is successful.
6. The method of claim 1, wherein generating the target registration code comprises:
determining the target identity information of the user to be registered according to the target identification information of the user to be registered and the corresponding relation between the pre-stored identification information and the identity information of the user;
and generating a target registration code according to the target identity information of the user to be registered and the timestamp corresponding to the current time.
7. A registration apparatus, the apparatus comprising:
the determining module is used for receiving a registration instruction carrying target identification information of a user to be registered, and determining an encrypted first target hash value corresponding to the target identification information of the user to be registered according to the target identification information of the user to be registered and a correspondence between pre-stored identification information and an encrypted hash value, wherein the hash value is obtained by performing hash calculation based on identity information of the user, and the encrypted hash value is stored in a block chain;
the acquisition module is used for generating a target registration code; sending the target registration code to target equipment corresponding to the user to be registered; decrypting the encrypted first target hash value to obtain the first target hash value;
the determining module is further configured to receive target registration identity information sent by the target device after the target registration code is verified, and determine a second target hash value corresponding to the target registration identity information; and if the second target hash value is consistent with the first target hash value, determining that the registration is successful.
8. The apparatus of claim 7, wherein the determining module is further configured to, for each user, obtain identity information of the user; performing hash calculation on the identity information of the user, and determining a hash value corresponding to the identity information of the user; the hash value is signed based on a first private key obtained in advance, and a signed hash value corresponding to the user is obtained; and encrypting the signed hash value based on a second public key obtained in advance to obtain an encrypted hash value corresponding to the identity information of the user.
9. The apparatus according to claim 8, wherein the obtaining module is specifically configured to decrypt the encrypted first target hash value based on a second private key corresponding to the second public key obtained in advance, so as to obtain a target signed hash value corresponding to the user to be registered; and verifying the target signed hash value based on the pre-obtained first public key corresponding to the first private key to obtain a first target hash value corresponding to the target identity information of the user to be registered.
10. The apparatus according to claim 7 or 8, wherein the obtaining module is further configured to perform tagging on the target registration code based on a second private key obtained in advance, so as to obtain a tagged target registration code; encrypting the signed target registration code based on a first public key obtained in advance to obtain an encrypted target registration code; and performing hash calculation on the encrypted target registration code to obtain a hash value corresponding to the encrypted target registration code, and storing the hash value corresponding to the encrypted target registration code in a block chain.
11. The apparatus according to claim 10, wherein the determining module is specifically configured to receive a registration verification code and target registration identity information, which are sent after the target device passes verification of the target registration code;
the obtaining module is further configured to add a signature to the registration verification code based on the second private key to obtain a signed registration verification code; encrypting the signed registration verification code based on the first public key to obtain an encrypted registration verification code; performing hash calculation on the encrypted registration verification code to obtain a hash value corresponding to the encrypted registration verification code;
the determining module is further configured to determine whether a hash value corresponding to the encrypted registration verification code is consistent with a hash value corresponding to the target registration code corresponding to the user to be registered and stored in the blockchain, where the hash value corresponding to the target registration code corresponding to the user to be registered is determined according to the identification information corresponding to the user to be registered and a correspondence between pre-stored identification information and the hash value corresponding to the target registration code; if the target hash value is consistent with the first target hash value, determining the registration time length corresponding to the registration verification code according to the time for sending the target registration code and the time for receiving the registration verification code, and if the registration time length does not exceed a preset time length threshold value, performing subsequent operation if the second target hash value is consistent with the first target hash value, and determining that the registration is successful.
12. The apparatus according to claim 7, wherein the obtaining module is specifically configured to determine the target identity information of the user to be registered according to the target identification information of the user to be registered and a correspondence between pre-stored identification information and identity information of the user; and generating a target registration code according to the target identity information of the user to be registered and the timestamp corresponding to the current time.
13. An electronic device comprising at least a processor and a memory, wherein the processor is configured to perform the steps of the registration method according to any of the preceding claims 1-6 when executing a computer program stored in the memory.
14. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, is adapted to carry out the steps of the registration method according to any one of the preceding claims 1 to 6.
CN202210190069.XA 2022-02-28 2022-02-28 Registration method, device, equipment and medium Pending CN114584314A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210190069.XA CN114584314A (en) 2022-02-28 2022-02-28 Registration method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210190069.XA CN114584314A (en) 2022-02-28 2022-02-28 Registration method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN114584314A true CN114584314A (en) 2022-06-03

Family

ID=81775750

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210190069.XA Pending CN114584314A (en) 2022-02-28 2022-02-28 Registration method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN114584314A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105488125A (en) * 2015-11-24 2016-04-13 百度在线网络技术(北京)有限公司 Page access method and apparatus
KR101925463B1 (en) * 2017-12-27 2018-12-05 주식회사 뷰노 Method of record and validation of image hash value and apparatus using the same
WO2019052286A1 (en) * 2017-09-12 2019-03-21 广州广电运通金融电子股份有限公司 User identity verification method, apparatus and system based on blockchain
CN110309668A (en) * 2019-05-16 2019-10-08 深圳市白唇鹿科技有限公司 Multi-platform data managing method, device, computer equipment and storage medium
CN110392029A (en) * 2018-04-20 2019-10-29 武汉真元生物数据有限公司 Identity identifying method and system based on biological identification
CN111148094A (en) * 2019-12-30 2020-05-12 全链通有限公司 Registration method of 5G user terminal, user terminal equipment and medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105488125A (en) * 2015-11-24 2016-04-13 百度在线网络技术(北京)有限公司 Page access method and apparatus
WO2019052286A1 (en) * 2017-09-12 2019-03-21 广州广电运通金融电子股份有限公司 User identity verification method, apparatus and system based on blockchain
KR101925463B1 (en) * 2017-12-27 2018-12-05 주식회사 뷰노 Method of record and validation of image hash value and apparatus using the same
CN110392029A (en) * 2018-04-20 2019-10-29 武汉真元生物数据有限公司 Identity identifying method and system based on biological identification
CN110309668A (en) * 2019-05-16 2019-10-08 深圳市白唇鹿科技有限公司 Multi-platform data managing method, device, computer equipment and storage medium
CN111148094A (en) * 2019-12-30 2020-05-12 全链通有限公司 Registration method of 5G user terminal, user terminal equipment and medium

Similar Documents

Publication Publication Date Title
CN107770159B (en) Vehicle accident data recording method and related device and readable storage medium
CN108334753B (en) Pirate application verification method and distributed server node
US9800574B2 (en) Method and apparatus for providing client-side score-based authentication
CN110177111B (en) Information verification method, system and device
CN107944234B (en) Machine refreshing control method for Android equipment
CN110830257B (en) File signature method and device, electronic equipment and readable storage medium
CN113225324A (en) Block chain anonymous account creation method, system, device and storage medium
CN111783049A (en) User information processing method and system based on block chain
CN109684878A (en) One kind being based on block chain technology privacy information tamper resistant method and system
CN110826107B (en) File signature method and device, electronic equipment and readable storage medium
CN114499859A (en) Password verification method, device, equipment and storage medium
CN114386058A (en) Model file encryption and decryption method and device
CN112000933B (en) Application software activation method and device, electronic equipment and storage medium
CN111628863B (en) Data signature method and device, electronic equipment and storage medium
CN112711570A (en) Log information processing method and device, electronic equipment and storage medium
CN111934862B (en) Server access method and device, readable medium and electronic equipment
CN110381114B (en) Interface request parameter processing method and device, terminal equipment and medium
CN110826034B (en) File signature method and device, electronic equipment and readable storage medium
CN106778227A (en) Applied program processing method, application program launching method and device
CN114584314A (en) Registration method, device, equipment and medium
CN114117388A (en) Device registration method, device registration apparatus, electronic device, and storage medium
CN114172689A (en) Information processing method and device
CN112865981A (en) Token obtaining and verifying method and device
CN114466358B (en) User identity continuous authentication method and device based on zero trust
CN116760646B (en) Login processing method, login processing device, server and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination