CN114584314B - Registration method, device, equipment and medium - Google Patents
Registration method, device, equipment and medium Download PDFInfo
- Publication number
- CN114584314B CN114584314B CN202210190069.XA CN202210190069A CN114584314B CN 114584314 B CN114584314 B CN 114584314B CN 202210190069 A CN202210190069 A CN 202210190069A CN 114584314 B CN114584314 B CN 114584314B
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 51
- 238000012545 processing Methods 0.000 claims abstract description 15
- 238000012795 verification Methods 0.000 claims description 131
- 238000004364 calculation method Methods 0.000 claims description 48
- 238000004590 computer program Methods 0.000 claims description 15
- 238000005516 engineering process Methods 0.000 abstract description 9
- 238000004458 analytical method Methods 0.000 abstract description 6
- 238000012986 modification Methods 0.000 abstract description 3
- 230000004048 modification Effects 0.000 abstract description 3
- 230000008569 process Effects 0.000 description 12
- 238000010586 diagram Methods 0.000 description 11
- 238000004422 calculation algorithm Methods 0.000 description 9
- 238000004891 communication Methods 0.000 description 8
- 238000012217 deletion Methods 0.000 description 5
- 230000037430 deletion Effects 0.000 description 5
- 230000006870 function Effects 0.000 description 5
- 230000009286 beneficial effect Effects 0.000 description 4
- 230000002427 irreversible effect Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 235000019800 disodium phosphate Nutrition 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic 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/3236—Cryptographic 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/12—Applying verification of the received information
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1097—Protocols 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]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Storage Device Security (AREA)
Abstract
The application provides a registration method, a device, equipment and a medium, wherein in the embodiment of the application, after the hash value obtained after hash processing is carried out on the identity information of a user is encrypted, the obtained encrypted hash value is stored in a blockchain in advance, the encrypted hash value can be ensured not to be tampered due to the non-tamper modification of the blockchain, the security of the subsequent user registration is ensured, and the traceability of the identity information of the user is improved due to the traceability of the blockchain, namely, the newly-added and deleted encrypted identity information of the user and the acquired record in the blockchain are traceable, so that whether a crack person uses a reverse analysis technology and other methods to crack the encrypted identity information can be quickly found, and the security of the registration is improved.
Description
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 mobile internet technology, users pay more and more attention to the security problem of the registration process.
In the related art, a simple encryption algorithm is generally adopted in advance to encrypt the identity information of each user, and the encrypted identity information of each user is stored in the local of the electronic device, wherein the encrypted identity information of each user stored in the local of the electronic device is correct and standard identity information of a user allowed to be registered, and is used for subsequently verifying whether the received registered identity information of the user to be registered is correct, so as to determine whether the user to be registered is allowed to be registered successfully.
However, since the encrypted identity information of each user stored in the electronic device is generally generated based on the encryption of a simple encryption algorithm, the corresponding security coefficient is not high, and a cracker can crack the encrypted user identity information stored in the electronic device by using methods such as a reverse analysis technology, so that the user identity information is modified and stolen, which is not beneficial to the security of the registration of the user, and is not beneficial to the privacy protection of the user, and the experience of the user is affected.
Disclosure of Invention
The application provides a registration method, a registration device, registration equipment and registration media, which are used for solving the problems that in the prior art, encrypted user identity information is directly stored in the local of electronic equipment, and a cracker can crack the encrypted user identity information in the electronic equipment, so that the privacy protection of a user is not facilitated.
In a first aspect, the present application provides a registration method, 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 the corresponding relation between the pre-stored identification information and the encrypted hash value, wherein the hash value is obtained by carrying out hash calculation based on identity information of the user, and the encrypted hash value is stored in a blockchain;
Generating a target registration code; and the target registration code is sent 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 is verified to pass, 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 identity information of the user; carrying out hash calculation on the identity information of the user, and determining a hash value corresponding to the identity information of the user; signing the hash value based on a first private key obtained in advance to obtain a signed hash value corresponding to the user; 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, and obtaining 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 signing hash value based on the first public key corresponding to the first private key obtained in advance to obtain a first target hash value corresponding to the target identity information of the user to be registered.
Further, 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 carrying out 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 blockchain.
Further, the receiving the target registration identity information sent by the target device after the target registration code passes verification includes:
Receiving a registration verification code sent by the target equipment after the target registration code passes verification, and target registration identity information;
After receiving the target registration identity information sent by the target device, if the target registration identity information is consistent with the target identity information, before determining that the registration is successful, 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; carrying out hash calculation on the encrypted registration verification code to obtain a hash value corresponding to the encrypted registration verification code;
Determining whether the hash value corresponding to the encrypted registration verification code is consistent with the hash value corresponding to the target registration code corresponding to the user to be registered stored in the blockchain, 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 corresponding relation 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 duration 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 duration does not exceed a preset duration threshold value, performing subsequent operations 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 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 also provides a registration apparatus, the apparatus comprising:
the system comprises a determining module, a processing module and a processing module, wherein the determining module is used for receiving a registration instruction carrying target identification information of a user to be registered, 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 the corresponding relation between the pre-stored identification information and the encrypted hash value, wherein the hash value is obtained by carrying out hash calculation based on identity information of the user, and the encrypted hash value is stored in a blockchain;
The acquisition module is used for generating a target registration code; and the target registration code is sent 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 passed, 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 obtain, for each user, identity information of the user; carrying out hash calculation on the identity information of the user, and determining a hash value corresponding to the identity information of the user; signing the hash value based on a first private key obtained in advance to obtain a signed hash value corresponding to the user; 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 signing hash value based on the first public key corresponding to the first private key obtained in advance 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 carrying out 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 blockchain.
Further, the determining module is specifically configured to receive a registration verification code and target registration identity information sent after the target device verifies the target registration code;
the acquisition module is further used for signing the registration verification code based on the second private key to acquire a signed registration verification code; encrypting the signed registration verification code based on the first public key to obtain an encrypted registration verification code; carrying out 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 the hash value corresponding to the encrypted registration verification code is consistent with the hash value corresponding to the target registration code corresponding to the user to be registered 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 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 duration 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 duration does not exceed a preset duration threshold value, performing subsequent operations if the second target hash value is consistent with the first target hash value, and determining that the registration is successful.
Further, the acquiring module is specifically configured to determine 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 also provides an electronic device comprising at least a processor and a memory, the processor being adapted to perform the steps of any of the above-mentioned registration methods when executing a computer program stored in the memory.
In a fourth aspect, the present application also provides a computer readable storage medium storing a computer program which, when executed by a processor, performs the steps of any of the registration methods described above.
In the method, 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 the corresponding relation between the pre-stored identification information and the encrypted hash value, wherein the hash value is obtained by carrying out hash calculation based on the identity information of the user, the encrypted hash value is stored in a block chain, a target registration code is generated and is 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, target registration identity information sent by the target equipment after the target registration code is verified to pass 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, successful registration is determined. In the embodiment of the application, after the hash value obtained after the hash processing is carried out on the identity information of the user is encrypted, the encrypted hash value is stored in the blockchain in advance, the encrypted hash value can be ensured not to be tampered due to the non-tamper property of the blockchain, the security of the subsequent user registration is ensured, and the traceability of the user identity information is improved due to the traceability of the blockchain, namely, the new addition, deletion and acquisition record of the encrypted user identity information in the blockchain are retroactive, so that whether a breaker uses a reverse analysis technology and other methods to crack the encrypted identity information can be quickly found, and the security of the registration is improved.
Drawings
In order to more clearly illustrate the technical solutions of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic illustration of a registration process provided by some embodiments of the application;
Fig. 2 is a schematic structural diagram of a registration device 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 more apparent, the present application will be described in further detail below with reference to the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
In the method, 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 the corresponding relation between the pre-stored identification information and the encrypted hash value, wherein the hash value is obtained by carrying out hash calculation based on the identity information of the user, the encrypted hash value is stored in a block chain, a target registration code is generated and is 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, target registration identity information sent by the target equipment after the target registration code is verified to pass 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, successful registration is determined.
Example 1:
In order to improve the security of user registration and protect the privacy security of users, the application provides a registration method, a device, equipment and a medium.
Fig. 1 is a schematic diagram of a registration process according to 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 the corresponding relation between the pre-stored identification information and the encrypted hash value, wherein the hash value is obtained by carrying out hash calculation based on identity information of the user, and the encrypted hash value is stored in a blockchain.
The registration method provided by the embodiment of the application is applied to the electronic equipment, and the electronic equipment can be a PC or a server and 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 the blockchain 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 be registered.
In order to further improve the security of the identity information of the user, in the embodiment of the application, hash calculation can be performed on the identity information of each user in advance, a hash value corresponding to the identity information of the user is determined, then the hash value is encrypted, an encrypted hash value is obtained, and the encrypted hash value is stored in a blockchain.
In the embodiment of the application, the hash calculation can be performed on the identity information of the user based on a preset hash algorithm, wherein the preset hash algorithm can be a hash algorithm such as MD5, and the preset hash algorithm can be specifically set according to requirements.
The hash calculation is performed on the identity information of the user, and the process of determining the hash value corresponding to the identity information of the user is in the prior art, which is not described herein.
On the one hand, the blockchain has non-falsification and traceability, so that the identity information of the user stored in the blockchain can be ensured not to be falsified, and the new addition, deletion and the like of the identity information of the user stored in the blockchain can be traced, thereby being beneficial to supervising the safety problem of the identity information of the user; 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, so that the security of the identity information of the user is further improved.
In order to achieve 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 identification information of the user to be registered 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 that electronic device used when the user is registered. The identification information may be information that can uniquely identify the identity of the user, such as a mobile phone number, a user name, an identity card number, and the like of the user.
In the embodiment of the present application, when a user to be registered registers on a target device corresponding to the user to be registered, a registration instruction may be triggered by an 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, and 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, which is not limited herein.
In order to determine which encrypted hash value in the encrypted hash values stored in the blockchain is the encrypted hash value corresponding to the user to be registered, in the embodiment of the application, the correspondence between the identification information and the encrypted hash value is stored in the electronic device in advance, 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 correspondence between the pre-stored identification information and the encrypted hash value, and the determined encrypted hash value is used as the encrypted first target hash value.
S102: generating a target registration code; and the target registration code is sent 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 present application, in order to implement secure registration, after receiving a registration instruction carrying target identification information of a user to be registered, an electronic device may generate a target registration code and send the target registration code to a target device corresponding to the user to be registered, where the target registration code is a registration code that is correct and is used for a user to refer to and complete registration, the target registration code may be randomly generated, for example, a random number with a fixed length generated based on a random function is used as the target registration code, or a set number of digits is screened out from 0-9, and the set number of digits is sequenced according to a set order to obtain the target registration code, for example, digits screened out from 0-9 are 1,2, 3,4, and the generated target registration code may be 4321 or 2341. The target registration code can be sent to the target device by means of short messages or mails.
In order to facilitate the subsequent verification of the identity of the user to be registered and further determine whether the registration is successful, in the embodiment of the present application, after the encrypted first target hash value is determined, an 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 is verified to pass, 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 the embodiment of the application, after the generated target registration code is sent to the target device corresponding to the user to be registered, the target device can receive the input registration verification code and verify whether the registration verification code is input correctly, if the registration verification code is input correctly, the target registration verification code is determined to pass, and target registration identity information sent by the target device after the target registration code is verified to pass is received, wherein an input column of the input verification code can be displayed for the user, 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 a registered application program, wherein the input registration verification code depends on rules preset by the target device and the electronic device, and if the preset rules are the last three digits of the input registration verification code, the target device compares the registration verification code with the last three digits of the target registration code after the registration verification code is input, and determines whether the input registration verification code is correct or not, and the like.
A general preset 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, determining that the target registration code is verified, determining that the target registration identity information is allowed to be sent to the electronic equipment, if the registration verification code is inconsistent with the target registration code, determining that the target registration code is failed to be verified, and determining that the target registration identity information is not allowed to be sent to the electronic equipment. The target registration identity information may include name, mobile phone number, identity card number, etc., and the content included in the target registration identity information is the same as the identity information included in the identity information of the user to be registered obtained by the electronic device, that is, when the electronic device obtains that the identity information of the user to be registered includes name and identity card number, the target registration identity information of the user to be registered also includes name and identity card number.
Since the identity information of the user stored in the blockchain is already subjected to hash calculation, and since the hash calculation has irreversibility, that is, the first target hash value cannot be converted into the identity information of the user to be registered, in order to complete verification of the identity information of the user to be registered, in the embodiment of the application, after receiving the target registration identity information of the user to be registered, 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 registration is successful is determined according to a comparison result.
Specifically, if the second target hash value is consistent with the first target hash value, the target registration identity information of the user to be registered is correct, the successful registration is determined, and if the second target hash value is inconsistent with the first target hash value, the target registration identity information of the user to be registered is incorrect, the unsuccessful registration is determined.
In the embodiment of the application, after the hash value obtained after the hash processing is carried out on the identity information of the user is encrypted, the obtained encrypted hash value is stored in the blockchain in advance, the encrypted hash value can be ensured not to be tampered due to the non-tamper property of the blockchain, the security of the subsequent user registration is ensured, and the traceability of the user identity information is also improved due to the traceability of the blockchain, namely, the new addition, deletion and acquisition record of the encrypted user identity information in the blockchain are traceable, so that whether a cracker uses a reverse analysis technology and other methods to crack the encrypted identity information can be quickly found, and the security of the registration is improved.
Example 2:
in order to determine the hash value corresponding to the identity information of each user, in the 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 identity information of the user; carrying out hash calculation on the identity information of the user, and determining a hash value corresponding to the identity information of the user; signing the hash value based on a first private key obtained in advance to obtain a signed hash value corresponding to the user; 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 a hash value corresponding to the identity information of each user, in the embodiment of the present application, the identity information of each user is obtained, wherein 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 the 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-private key pairs in advance, which are a first public-private key pair and a second public-private key pair, where the first public-private key pair includes a first public key and a first private key, and the second public-private key pair includes a second public key and a second private key, and may first sign the hash value corresponding to the identity information of the user based on the first private key in the first public-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-private key pair to obtain an encrypted hash value corresponding to the identity information of the user. The first public-private key pair and the second public-private key pair can be symmetric public-private key pairs or asymmetric public-private key pairs, and specifically, the first public-private key pair and the second public-private key pair can be set according to requirements.
In the embodiment of the present application, 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 is generated in the USB Key with high security, and cannot be derived to the outside of the USB Key.
Specifically, the electronic device may insert a USB Key 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 job position, a department, etc., and after obtaining the identity information of each user, determine identification information corresponding to the user with respect to the identity information of each user, where the mobile phone number in the identity information of the user may be determined as identification information of the user, and set, with respect to each user of the identification information, a digital certificate and a signature private Key that can represent a unique identity of the user for each user, that is, a correspondence between the identification 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, determining a signature private key corresponding to the user to be registered according to the identification information of the user to be registered, determining the signature private key corresponding to the user to be registered as a first private key corresponding to the user to be registered, and signing the target identification information of the user to be registered by using the first private key.
The process of generating the first public-private key pair and the second public-private key pair is the prior art, and will not be described herein.
In order to obtain the first target hash value, on the basis of the foregoing embodiments, in an embodiment of the present application, 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 signing hash value based on the first public key corresponding to the first private key obtained in advance to obtain a first target hash value corresponding to the target identity information of the user to be registered.
In the embodiment of the application, since the encrypted first target hash value is obtained after 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 of the first public key pair, the target signed hash value corresponding to the user to be registered is obtained, and then the target signed hash value is obtained after encrypting the target signed hash value based on the second public key of the second public key pair, in order to obtain the first target hash value according to the encrypted first target hash value, in the embodiment of the application, the encrypted first target hash value is firstly decrypted based on the second private key of the second public key pair, that is, the encrypted first target hash value is decrypted based on the second private key corresponding to the second public key, and then the target signed value corresponding to the first public key of the first public key pair is obtained, and the target signed value is obtained based on the first private key corresponding to the first private key of the first public key pair.
In the embodiment of the 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 application, the accuracy of the encrypted hash value stored in the blockchain can be verified a priori before the user registers, generally before the registered application program is marketed, specifically, when the encrypted hash value is obtained, the hash value corresponding to the identity information of the user is signed based on the first private key to obtain the signed hash value corresponding to the user, the signed hash value can be called as a first signed hash value, the first signed hash value is encrypted based on the second public key to obtain the encrypted hash value corresponding to the identity information of the user, and the signed hash value corresponding to the user is called as a first signed hash value.
When the encrypted hash value is verified, firstly, 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 checked based on a 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 a 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, if so, it is determined that the verification is failed, if not, it is determined whether the first hash value and the second hash value are changed, if so, it is determined that the verification is failed, and if not, it is determined that the verification is successful.
Specifically, the electronic device stores the first hash value and the first signed hash value corresponding to each user in advance, 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 blockchain.
Specifically, the verification interval duration may be preset, so that the electronic device verifies the accuracy of the encrypted hash value stored in the blockchain once every the verification interval duration, or may verify the accuracy of the encrypted hash value stored in the blockchain once after the electronic device receives the verification instruction.
Example 3:
In order to improve the security of registration, in the embodiments of the present application, 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 carrying out 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 blockchain.
In order to improve the security of registration, after the electronic device generates a target registration code, the target registration code is sent to target equipment corresponding to a user to be registered, the target registration code is encrypted, the encrypted target registration code is stored in the local area of the electronic device, and after the target registration code is verified, target registration identity information is sent to the electronic device by the target equipment corresponding to the user to be registered, however, under the related technology, due to the fact that a cracker can crack the registration code of software by using methods such as a reverse analysis technology and an algorithm for extracting the registration code, the security of a conventional registration code system is low. In order to improve the security of registration, in the embodiment of the present application, an encrypted registration code obtained by encrypting the registration code may also be stored in a blockchain. Specifically, signing is performed on the target registration code based on a second private key obtained in advance to obtain a signed target registration code, then encryption is performed on the signed target registration code based on a first public key to obtain an encrypted target registration code, hash calculation is performed on the encrypted target registration code 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 blockchain.
On the one hand, the blockchain has non-falsifiability and traceability, so that the hash value corresponding to the encrypted registration code stored in the blockchain can be ensured not to be falsified, and the new addition, the deletion and the like of the hash value corresponding to the encrypted registration code stored in the blockchain can be traced, thereby being beneficial to supervising the security 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, the target registration code cannot be obtained by processing according to the hash value corresponding to the encrypted target registration code after the hash value corresponding to the encrypted target registration code is obtained, and thus the security of registration is further improved.
Example 4:
in order to improve the security of registration, in the embodiments of the present application, the receiving the target registration identity information sent by the target device after the target registration code passes the verification includes:
Receiving a registration verification code sent by the target equipment after the target registration code passes verification, and target registration identity information;
After receiving the target registration identity information sent by the target device, if the target registration identity information is consistent with the target identity information, before determining that the registration is successful, 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; carrying out hash calculation on the encrypted target registration code to obtain a hash value corresponding to the encrypted target registration code;
Determining whether the hash value corresponding to the encrypted registration verification code is consistent with the hash value corresponding to the encrypted target registration code corresponding to the user to be registered, which is stored in the blockchain, 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 relation between the 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 duration 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 duration does not exceed a preset duration threshold value, performing subsequent operations 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 realize verification of the target registration code, in the embodiment of the application, when receiving the target registration identity information sent after the target registration code is verified by the target device, the electronic device can also receive the registration verification code sent after the target registration code is verified by the target device.
Because the hash value corresponding to the encrypted target registration code is stored in the blockchain, and because the hash calculation has irreversibility, that is, the target registration code cannot be obtained based on the hash value corresponding to the encrypted target registration code, in order to perform registration code verification, in the embodiment of the application, after receiving the registration verification code sent by the target device corresponding to the user, for each user, the registration verification code is signed based on the second private key to obtain a signed registration verification code, then the signed registration verification code is encrypted based on the first public key to obtain the encrypted registration verification code, the hash calculation is performed on the encrypted registration verification code to obtain the hash value corresponding to the encrypted registration verification code, and finally the hash value corresponding to the encrypted registration verification code is compared with the hash value corresponding to the encrypted target registration code of the user stored in the blockchain.
Specifically, in order to determine which hash value corresponding to the encrypted target registration code among the hash values corresponding to all the encrypted target registration codes stored in the blockchain is the hash value corresponding to the encrypted target registration code corresponding to the user to be registered, the corresponding relationship 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 effective 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 duration does not exceed the preset duration threshold, determining that the registration verification code is valid, and then performing subsequent judgment on whether the second target hash value is consistent with the first target hash value or not, and whether registration is successful or not.
If the hash value corresponding to the encrypted registration verification code is inconsistent 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, determining that registration fails. And if the registration duration exceeds a preset duration threshold, determining that the registration verification code is invalid. The preset duration threshold may be 5 minutes, 30 minutes, 1 hour, etc., and specifically, the preset duration threshold may be set according to requirements.
Example 5:
in order to generate the target registration code, on the basis of the above embodiments, in an embodiment of the present application, the generating the target registration code includes:
Determining 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, the electronic equipment can randomly generate the registration code, and can also generate the target registration code according to the target identity information of the user to be registered and the 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 the embodiment of the application, the correspondence between the identification information and the identity information of the user is pre-stored in the electronic equipment, and after receiving a registration instruction carrying the target identification information of the user to be registered, the electronic equipment acquires the target identification information of the user to be registered carried in the registration instruction, and determines the target identity information corresponding to the target identification information of the user to be registered according to the target identification information and the pre-stored correspondence between the identification 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 or 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.
Because all characters or numbers or characters contained in the target identity information of the user to be registered and the timestamp corresponding to the current time are arranged in a random arrangement mode, the arranged result is determined to be the generated target registration code, the length of the target registration code is possibly too long, and the target registration code verification by the subsequent user is inconvenient. Specifically, several letters or numbers or characters are screened from the target identity information of the user, and several letters or numbers or characters are screened from the timestamp corresponding to the current time and can be preset, which is not limited herein.
For example, if the current timestamp is 202108301500, three digits are randomly extracted from the current timestamp "202108301500" and are respectively 8, 3 and 0, then three digits are randomly extracted from the phone number "11111100000" in the user identity information and are respectively 1,1 and 0, and the six digits are randomly arranged to obtain the target registration codes, which can 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 highway accident risk prediction device 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 blockchain;
an acquisition module 202, configured to generate a target registration code; and the target registration code is sent 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 is verified and passed, 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 obtain, for each user, identity information of the user; carrying out hash calculation on the identity information of the user, and determining a hash value corresponding to the identity information of the user; signing the hash value based on a first private key obtained in advance to obtain a signed hash value corresponding to the user; 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, to obtain a target signed hash value corresponding to the user to be registered; and verifying the target signing hash value based on the first public key corresponding to the first private key obtained in advance 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 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 carrying out 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 blockchain.
In a possible implementation manner, the determining module 201 is specifically configured to receive a registration verification code and target registration identity information sent after the target device verifies that the target registration code passes;
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; carrying out 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 the hash value corresponding to the encrypted registration verification code is consistent with the hash value corresponding to the target registration code corresponding to the user to be registered 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 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 duration 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 duration does not exceed a preset duration threshold value, performing subsequent operations 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 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.
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: processor 301, communication interface 302, memory 303 and communication bus 304, wherein processor 301, communication interface 302, memory 303 accomplish the intercommunication through 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 the corresponding relation between the pre-stored identification information and the encrypted hash value, wherein the hash value is obtained by carrying out hash calculation based on identity information of the user, and the encrypted hash value is stored in a blockchain;
Generating a target registration code; and the target registration code is sent 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 is verified to pass, 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 obtain, for each user, identity information of the user; carrying out hash calculation on the identity information of the user, and determining a hash value corresponding to the identity information of the user; signing the hash value based on a first private key obtained in advance to obtain a signed hash value corresponding to the user; 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, to obtain a target signed hash value corresponding to the user to be registered; and verifying the target signing hash value based on the first public key corresponding to the first private key obtained in advance 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, 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 carrying out 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 blockchain.
Further, the processor 301 is further configured to receive a registration verification code and target registration identity information sent after the target device verifies 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; carrying out hash calculation on the encrypted registration verification code to obtain a hash value corresponding to the encrypted registration verification code; determining whether the hash value corresponding to the encrypted registration verification code is consistent with the hash value corresponding to the target registration code corresponding to the user to be registered stored in the blockchain, 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 corresponding relation 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 duration 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 duration does not exceed a preset duration threshold value, performing subsequent operations 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 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.
The communication bus mentioned by the server may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface 302 is used for communication between the electronic device and other devices described above.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; but also digital instruction processors (DIGITAL SIGNAL Processing units, DSPs), application specific integrated circuits, field programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
Example 8:
on the basis of the above embodiments, the present application also provides a computer-readable storage medium having stored therein a computer program executable by an electronic device, which when run on the electronic device, causes the electronic device to perform the steps of:
The memory has stored therein a computer program which, 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 the corresponding relation between the pre-stored identification information and the encrypted hash value, wherein the hash value is obtained by carrying out hash calculation based on identity information of the user, and the encrypted hash value is stored in a blockchain;
Generating a target registration code; and the target registration code is sent 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 is verified to pass, 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 identity information of the user; carrying out hash calculation on the identity information of the user, and determining a hash value corresponding to the identity information of the user; signing the hash value based on a first private key obtained in advance to obtain a signed hash value corresponding to the user; 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, and obtaining 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 signing hash value based on the first public key corresponding to the first private key obtained in advance to obtain a first target hash value corresponding to the target identity information of the user to be registered.
Further, 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 carrying out 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 blockchain.
Further, the receiving the target registration identity information sent by the target device after the target registration code passes verification includes:
Receiving a registration verification code sent by the target equipment after the target registration code passes verification, and target registration identity information;
After receiving the target registration identity information sent by the target device, if the target registration identity information is consistent with the target identity information, before determining that the registration is successful, 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; carrying out hash calculation on the encrypted registration verification code to obtain a hash value corresponding to the encrypted registration verification code;
Determining whether the hash value corresponding to the encrypted registration verification code is consistent with the hash value corresponding to the target registration code corresponding to the user to be registered stored in the blockchain, 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 corresponding relation 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 duration 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 duration does not exceed a preset duration threshold value, performing subsequent operations 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 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 after the hash processing is carried out on the identity information of the user is encrypted, the obtained encrypted hash value is stored in the blockchain in advance, the encrypted hash value can be ensured not to be tampered due to the non-tamper property of the blockchain, the security of the subsequent user registration is ensured, and the traceability of the user identity information is also improved due to the traceability of the blockchain, namely, the new addition, deletion and acquisition record of the encrypted user identity information in the blockchain are traceable, so that whether a cracker uses a reverse analysis technology and other methods to crack the encrypted identity information can be quickly found, and the security of the registration is improved.
It will be appreciated by those skilled in the art that 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 flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations 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 modifications and variations can be made to the present application without departing from the spirit or scope of the application. Thus, it is intended that the present application also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.
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 the corresponding relation between the pre-stored identification information and the encrypted hash value, wherein the hash value is obtained by carrying out hash calculation based on identity information of the user, and the encrypted hash value is stored in a blockchain;
Generating a target registration code; and the target registration code is sent 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 is verified to pass, 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 for each user's identity information comprises:
for each user, acquiring identity information of the user; carrying out hash calculation on the identity information of the user, and determining a hash value corresponding to the identity information of the user; signing the hash value based on a first private key obtained in advance to obtain a signed hash value corresponding to the user; 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 signing hash value based on the first public key corresponding to the first private key obtained in advance to obtain a first target hash value corresponding to the target identity information of the user to be registered.
4. The method according to claim 1 or 2, wherein after the 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 carrying out 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 blockchain.
5. The method of claim 4, wherein receiving the target registration identity information sent by the target device after verification of the target registration code is passed comprises:
Receiving a registration verification code sent by the target equipment after the target registration code passes verification, and target registration identity information;
After receiving the target registration identity information sent by the target device, if the target registration identity information is consistent with the target identity information, before determining that the registration is successful, 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; carrying out hash calculation on the encrypted registration verification code to obtain a hash value corresponding to the encrypted registration verification code;
Determining whether the hash value corresponding to the encrypted registration verification code is consistent with the hash value corresponding to the target registration code corresponding to the user to be registered stored in the blockchain, 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 corresponding relation 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 duration 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 duration does not exceed a preset duration threshold value, performing subsequent operations 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 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 system comprises a determining module, a processing module and a processing module, wherein the determining module is used for receiving a registration instruction carrying target identification information of a user to be registered, 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 the corresponding relation between the pre-stored identification information and the encrypted hash value, wherein the hash value is obtained by carrying out hash calculation based on identity information of the user, and the encrypted hash value is stored in a blockchain;
The acquisition module is used for generating a target registration code; and the target registration code is sent 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 passed, 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 obtain, for each user, identity information of the user; carrying out hash calculation on the identity information of the user, and determining a hash value corresponding to the identity information of the user; signing the hash value based on a first private key obtained in advance to obtain a signed hash value corresponding to the user; 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 of 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, to obtain a target signed hash value corresponding to the user to be registered; and verifying the target signing hash value based on the first public key corresponding to the first private key obtained in advance 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 sign 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 carrying out 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 blockchain.
11. The apparatus of claim 10, wherein the determining module is specifically configured to receive a registration verification code and target registration identity information sent after the target device verifies the target registration code;
the acquisition module is further used for signing the registration verification code based on the second private key to acquire a signed registration verification code; encrypting the signed registration verification code based on the first public key to obtain an encrypted registration verification code; carrying out 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 the hash value corresponding to the encrypted registration verification code is consistent with the hash value corresponding to the target registration code corresponding to the user to be registered 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 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 duration 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 duration does not exceed a preset duration threshold value, performing subsequent operations if the second target hash value is consistent with the first target hash value, and determining that the registration is successful.
12. The apparatus of claim 7, wherein the obtaining module is specifically configured to determine target identity information of the user to be registered according to 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, characterized in that the processor is adapted 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 storing a computer program, characterized in that the computer program, when executed by a processor, performs the steps of the registration method according to any of the preceding claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210190069.XA CN114584314B (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 CN114584314B (en) | 2022-02-28 | 2022-02-28 | Registration method, device, equipment and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114584314A CN114584314A (en) | 2022-06-03 |
CN114584314B true CN114584314B (en) | 2024-06-14 |
Family
ID=81775750
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210190069.XA Active CN114584314B (en) | 2022-02-28 | 2022-02-28 | Registration method, device, equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114584314B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105488125A (en) * | 2015-11-24 | 2016-04-13 | 百度在线网络技术(北京)有限公司 | Page access method and apparatus |
WO2018114585A1 (en) * | 2016-12-22 | 2018-06-28 | Itext Group Nv | Improved blockchain-based method for registration and verification of a file |
US10498541B2 (en) * | 2017-02-06 | 2019-12-03 | ShocCard, Inc. | Electronic identification verification methods and systems |
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 |
CN111148213B (en) * | 2019-12-30 | 2023-02-03 | 全链通有限公司 | Registration method of 5G user terminal, user terminal equipment and medium |
CN111148094B (en) * | 2019-12-30 | 2023-11-21 | 全链通有限公司 | Registration method of 5G user terminal, user terminal equipment and medium |
CN111428249B (en) * | 2020-01-20 | 2022-06-28 | 中国科学院信息工程研究所 | Anonymous registration method and system for protecting user privacy based on block chain |
CN111541713A (en) * | 2020-05-08 | 2020-08-14 | 国网电子商务有限公司 | Identity authentication method and device based on block chain and user signature |
-
2022
- 2022-02-28 CN CN202210190069.XA patent/CN114584314B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
Also Published As
Publication number | Publication date |
---|---|
CN114584314A (en) | 2022-06-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107770159B (en) | Vehicle accident data recording method and related device and readable storage medium | |
CN109284585B (en) | Script encryption method, script decryption operation method and related device | |
CN108777675B (en) | Electronic device, block chain-based identity authentication method, and computer storage medium | |
CN110177111B (en) | Information verification method, system and device | |
CN112257086B (en) | User privacy data protection method and electronic equipment | |
CN108229144B (en) | Verification method of application program, terminal equipment and storage medium | |
CN108075888B (en) | Dynamic URL generation method and device, storage medium and electronic equipment | |
CN110113329B (en) | Verification method and device for verification code | |
CN110826107B (en) | File signature method and device, electronic equipment and readable storage medium | |
CN110830257B (en) | File signature method and device, electronic equipment and readable storage medium | |
CN110826091B (en) | File signature method and device, electronic equipment and readable storage medium | |
CN111628863B (en) | Data signature method and device, electronic equipment and storage medium | |
CN109117643B (en) | System processing method and related equipment | |
CN113360868A (en) | Application program login method and device, computer equipment and storage medium | |
CN114244522A (en) | Information protection method and device, electronic equipment and computer readable storage medium | |
CN109684878A (en) | One kind being based on block chain technology privacy information tamper resistant method and system | |
CN111404892A (en) | Data supervision method and device and server | |
CN109145533B (en) | Method and device for protecting code by using random password | |
CN114386058A (en) | Model file encryption and decryption method and device | |
CN110598421B (en) | Two-dimensional code encryption method and device and two-dimensional code decryption method and device | |
CN111600701B (en) | Private key storage method, device and storage medium based on blockchain | |
CN112711570A (en) | Log information processing method and device, electronic equipment and storage medium | |
CN110826034B (en) | File signature method and device, electronic equipment and readable storage medium | |
CN114584314B (en) | Registration method, device, equipment and medium | |
CN112910883B (en) | Data transmission method and device and electronic equipment |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |