CN116527258B - Unlocking method, device, equipment and storage medium of coded lock - Google Patents

Unlocking method, device, equipment and storage medium of coded lock Download PDF

Info

Publication number
CN116527258B
CN116527258B CN202310787042.3A CN202310787042A CN116527258B CN 116527258 B CN116527258 B CN 116527258B CN 202310787042 A CN202310787042 A CN 202310787042A CN 116527258 B CN116527258 B CN 116527258B
Authority
CN
China
Prior art keywords
unlocking
identification code
time information
character string
coded lock
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
Application number
CN202310787042.3A
Other languages
Chinese (zh)
Other versions
CN116527258A (en
Inventor
王永峰
白培基
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Sunson Tech Co ltd
Original Assignee
Shenzhen Sunson Tech Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Sunson Tech Co ltd filed Critical Shenzhen Sunson Tech Co ltd
Priority to CN202310787042.3A priority Critical patent/CN116527258B/en
Publication of CN116527258A publication Critical patent/CN116527258A/en
Application granted granted Critical
Publication of CN116527258B publication Critical patent/CN116527258B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C9/00Individual registration on entry or exit
    • G07C9/00174Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys
    • G07C9/00309Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys operated with bidirectional data transmission between data carrier and locks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0852Quantum cryptography
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0863Generation of secret information including derivation or calculation of cryptographic keys or passwords involving passwords or one-time passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0872Generation of secret information including derivation or calculation of cryptographic keys or passwords using geo-location information, e.g. location data, time, relative position or proximity to other entities
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C9/00Individual registration on entry or exit
    • G07C9/00174Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys
    • G07C9/00309Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys operated with bidirectional data transmission between data carrier and locks
    • G07C2009/0042Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys operated with bidirectional data transmission between data carrier and locks the transmitted data signal containing a code which is changed
    • G07C2009/00476Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys operated with bidirectional data transmission between data carrier and locks the transmitted data signal containing a code which is changed dynamically
    • G07C2009/005Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys operated with bidirectional data transmission between data carrier and locks the transmitted data signal containing a code which is changed dynamically whereby the code is a random code

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computer Security & Cryptography (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Electromagnetism (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Lock And Its Accessories (AREA)

Abstract

The application discloses an unlocking method, a device, equipment and a storage medium of a coded lock, wherein the unlocking method of the coded lock firstly authenticates an unlocking request of a user, generates an unlocking code according to an identification code of the unlocked coded lock, an identification code of terminal equipment used by the user during unlocking and a first quantum random number sequence generated randomly after the authentication is passed, then sends the unlocking code to the terminal equipment used by the user during unlocking, and finally unlocks the unlocked coded lock according to the input of the unlocking code by the user. The unlocking method of the coded lock can solve the problem of low safety of the conventional unlocking method of the coded lock.

Description

Unlocking method, device, equipment and storage medium of coded lock
Technical Field
The present application relates to the field of unlocking technologies of coded locks, and in particular, to a method, an apparatus, a device, and a storage medium for unlocking a coded lock.
Background
With the development of electronic technology, the application of the coded lock is becoming widespread in daily life of people. At present, a common coded lock is usually provided with a unique code for the coded lock, and the coded lock can be opened when the correct code is input, however, the method is low in safety and is generally only suitable for private home environments, is not suitable for places with large people flow, such as office places, hotels and the like, and can cause serious threat to property safety of users once the unique code of the coded lock is revealed in places with large people flow.
Disclosure of Invention
The embodiment of the application provides an unlocking method, device and equipment of a coded lock and a storage medium, which are used for solving the problem of low safety of the conventional unlocking method of the coded lock.
In a first aspect, an embodiment of the present application provides a method for unlocking a coded lock, including:
responding to an unlocking request of a user for the coded lock, and acquiring identification information of terminal equipment; the user sends the unlocking request by using the terminal equipment;
authenticating the unlocking request of the user according to the identification information;
if the authentication is passed, acquiring first time information, and generating a first quantum random number sequence by using a quantum random number generator based on the first time information; wherein, the first time information is the time information when the authentication passes;
acquiring a first identification code and a second identification code; the first identification code is the identification code of the coded lock, and the second identification code is the identification code of the terminal equipment;
generating a third identification code according to the first identification code and the second identification code;
generating an unlocking password according to the first quantum random number sequence and the third identification code, and replacing the first identification code with the third identification code;
Sending the unlocking password to the terminal equipment;
responding to the input of the unlocking password by the user, and acquiring the unlocking password;
and unlocking the coded lock according to the unlocking code.
In some embodiments, the identification information includes a first algorithm, a second algorithm identical to the first algorithm is set in the coded lock, and the authenticating the unlocking request of the user according to the user identification information includes:
randomly generating a first random array;
acquiring the first algorithm, and processing the first random array by using the first algorithm to obtain a first authentication array;
acquiring the second algorithm, and processing the first random array by using the second algorithm to obtain a second authentication array;
comparing the first authentication array with the second authentication array;
and if the first authentication array is consistent with the second authentication array, determining that the authentication passes.
In some embodiments, the third identification code is a first character string, and the generating an unlocking password according to the first quantum random number sequence and the third identification code includes:
randomly replacing each number in a number display column in a preset encoding table with any number to obtain an adjusted preset encoding table;
Referring to the adjusted preset coding table based on the third identification code to obtain a number sequence corresponding to the third identification code;
randomly inserting each prime number in the first quantum random number sequence into the number sequence corresponding to the third identification code to obtain an initial unlocking password;
selecting the number of the initial unlocking password at the designated position;
and generating the unlocking password according to all the selected numbers.
In some embodiments, the unlocking the combination lock according to the unlocking combination comprises:
acquiring all historical unlocking passwords from an unlocking password database, and judging whether the unlocking passwords are used for the first time according to all the historical unlocking passwords;
if the unlocking password is used for the first time, acquiring second time information, wherein the second time information is the time information when the user inputs the unlocking password on the password lock;
calculating the time length between the first time information and the second time information;
comparing the time length with a preset time length;
and if the time length is smaller than the preset time length, unlocking the coded lock, and storing the unlocking code into the unlocking code database.
In some embodiments, before the sending the unlock code to the user, the method further includes encrypting the unlock code, the encrypting method includes:
acquiring third time information, and generating a second quantum random number sequence by using the quantum random number generator based on the third time information; the third time information is time information when the unlocking password is generated;
referring to a preset coding table according to the second quantum random number sequence, and generating a first encryption character string;
randomly generating a second random array and a third random array, and referring to the preset coding table according to the second random array and the third random array to obtain a second character string and a third character string; the second character string is a character string corresponding to the second random array, and the third character string is a character string corresponding to the third random array;
respectively selecting characters of the second character string and the third character string at the appointed position;
generating a second encrypted character string according to all the selected characters;
encrypting the unlocking password by adopting the first encryption character string to obtain a first encryption unlocking password;
And encrypting the first encryption unlocking password by adopting the second encryption character string to obtain a second encryption unlocking password.
In a second aspect, an embodiment of the present application provides an unlocking device for a coded lock, including:
the first acquisition module is used for responding to an unlocking request of a user for the coded lock and acquiring identification information of the terminal equipment; the user sends the unlocking request by using the terminal equipment;
the authentication module is used for authenticating the unlocking request of the user according to the identification information;
the generation module is used for acquiring first time information if the authentication passes, and generating a first quantum random number sequence by using a quantum random number generator based on the first time information; wherein, the first time information is the time information when the authentication passes;
the second acquisition module is used for acquiring the first identification code and the second identification code; the first identification code is the identification code of the coded lock, and the second identification code is the identification code of the terminal equipment;
the first generation module is used for generating a third identification code according to the first identification code and the second identification code;
the second generation module is used for generating an unlocking password according to the first quantum random number sequence and the third identification code and replacing the first identification code with the third identification code;
The sending module is used for sending the unlocking password to the user;
the third acquisition module is used for responding to the input of the unlocking password by the user and acquiring the unlocking password;
and the unlocking module is used for unlocking the coded lock according to the unlocking code.
In a third aspect, an embodiment of the present application provides a terminal device, where the terminal device includes a processor, a memory, and a computer program stored on the memory and executable by the processor, where the computer program when executed by the processor implements an unlocking method of any one of the above-mentioned trick locks.
In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, where a computer program is stored on the computer readable storage medium, where when the computer program is executed by the processor, the method for unlocking any one of the combination locks described above is implemented.
The embodiment of the application discloses an unlocking method, an unlocking device, equipment and a storage medium of a coded lock, wherein the unlocking method of the coded lock is characterized in that on one hand, by authenticating an unlocking request of a user, when the authentication passes, an unlocking password is generated according to a first quantum random number sequence, a first identification code and a second identification code, so that the safety of the unlocking method of the coded lock is improved, and on the other hand, by conducting encryption processing on the unlocking password, the unlocking password is prevented from being stolen, and the safety of the unlocking method of the coded lock is further improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of an unlocking method of a coded lock according to an embodiment of the present application;
fig. 2 is a schematic flow chart of a sub-step of authenticating an unlocking request of the user according to the user identification information according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating the sub-steps of generating an unlock code according to the first quantum random number sequence and the third identification code according to an embodiment of the present application;
fig. 4 is a schematic flow chart of the sub-steps of unlocking the coded lock according to the unlocking code according to the embodiment of the present application;
FIG. 5 is a flowchart illustrating a method of encryption processing according to an embodiment of the present application;
fig. 6 is a schematic block diagram of an unlocking device of a coded lock according to an embodiment of the present application;
fig. 7 is a schematic block diagram of an authentication module according to an embodiment of the present application;
FIG. 8 is a schematic block diagram of a second generation module according to an embodiment of the present application;
fig. 9 is a schematic block diagram of an unlocking module according to an embodiment of the present application;
fig. 10 is a schematic block diagram of an encryption module according to an embodiment of the present application;
fig. 11 is a schematic block diagram of a structure of a terminal device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the application. 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.
The flow diagrams depicted in the figures are merely illustrative and not necessarily all of the elements and operations/steps are included or performed in the order described. For example, some operations/steps may be further divided, combined, or partially combined, so that the order of actual execution may be changed according to actual situations.
It is also to be understood that the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
With the development of electronic technology, the application of the coded lock is becoming widespread in daily life of people. At present, a common coded lock is usually provided with a unique code for the coded lock, and the coded lock can be opened when the correct code is input, however, the method is low in safety and is generally only suitable for private home environments, is not suitable for places with large people flow, such as office places, hotels and the like, and can cause serious threat to property safety of users once the unique code of the coded lock is revealed in places with large people flow. Therefore, the embodiment of the application provides a method, a device, equipment and a storage medium for unlocking a coded lock, so as to solve the problems.
Some embodiments of the present application are described in detail below with reference to the accompanying drawings. The following embodiments and features of the embodiments may be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a flowchart of an unlocking method of a coded lock according to an embodiment of the present application, and as shown in fig. 1, the unlocking method of a coded lock according to an embodiment of the present application includes steps S101 to S109.
Step S101, responding to an unlocking request of a user for a coded lock, and acquiring identification information of terminal equipment; the user sends the unlocking request by using the terminal equipment;
the terminal device is a mobile terminal device, for example, a mobile phone, a tablet computer, a notebook computer, a wearable device and the like, an APP for unlocking the coded lock is arranged on the terminal device, each coded lock corresponds to a unique APP matched with the coded lock, and it can be understood that the APP can only be downloaded on the terminal device of a designated person with unlocking authority for the coded lock, for example, for the coded lock of a hotel manager office, the unique APP matched with the coded lock of the hotel manager office can only be downloaded on the terminal device of the hotel manager. It can be appreciated that, according to different application scenarios of the coded lock, the coded lock may be downloaded to one or more terminal devices of designated personnel having unlocking authority on the coded lock, for example, the coded lock is a door lock of a company, and then the APP matched with the coded lock may be downloaded to the terminal device of each employee of the company.
Step S102, authenticating the unlocking request of the user according to the identification information.
It can be appreciated that the lock can be unlocked only after the terminal device downloads the original APP, and in order to prevent some illegal persons from developing some pirated APPs to download on its own terminal device to gain illegal benefits, the unlocking request of the user needs to be authenticated.
Step S103, if the authentication passes, obtaining first time information, and generating a first quantum random number sequence by using a quantum random number generator based on the first time information; the first time information is time information when the authentication passes.
It can be understood that, based on the first moment information, the first quantum random number sequence is generated by using the quantum random number generator, so that the uniqueness of the unlocking password generated subsequently can be improved, and the safety of the unlocking method of the coded lock can be improved.
Step S104, acquiring a first identification code and a second identification code; the first identification code is the identification code of the coded lock, and the second identification code is the identification code of the terminal equipment.
Step S105, generating a third identification code according to the first identification code and the second identification code.
For example, the first identification code and the second identification code may be character strings, and the method for generating the third identification code according to the first identification code and the second identification code may include the following steps:
respectively extracting the character of the character string of the first identification code at the appointed position and the character of the character string of the second identification code at the appointed position;
and randomly arranging all the extracted characters to generate the third identification code.
For example, the first identification code is ACDEFG, the second identification code is BGFJDC, the designated positions of the first identification code are in order 1,3,5, and the designated positions of the second identification code are in order 2,4,6, then all the extracted characters are a, D, F, G, J, C, and the third identification code obtained by randomly sorting all the extracted characters is DGCAFJ.
And S106, generating an unlocking password according to the first quantum random number sequence and the third identification code, and replacing the first identification code with the third identification code.
It will be appreciated that some illegal persons may study the unlocking method of the coded lock by stealing the first identification code, but if the third identification code is used to replace the first identification code after each unlocking, the coded lock cannot be unlocked even if the illegal persons study the unlocking method of the coded lock according to the first identification code.
And step S107, the unlocking password is sent to the terminal equipment.
And step S108, responding to the input of the unlocking password by the user, and acquiring the unlocking password.
And step 109, unlocking the coded lock according to the unlocking code.
According to the unlocking method of the coded lock, the unlocking password is generated according to the first quantum random number sequence, the first identification code and the second identification code when the authentication is passed through by authenticating the unlocking request of the user, so that the safety of the unlocking method of the coded lock is improved, and the unlocking method of the coded lock provided by the embodiment is suitable for private houses and public places.
As shown in fig. 2, in some embodiments, the identification information includes a first algorithm, and the coded lock is provided with a second algorithm that is the same as the first algorithm, and step S102 includes steps S1021 to S1025.
Step S1021, randomly generating a first random array.
Wherein the first random array may be generated by a random number generator.
Step S1022, obtaining the first algorithm, and processing the first random array by using the first algorithm to obtain a first authentication array.
It is understood that the first algorithm is an algorithm in the APP of the master, and the terminal device only downloads the APP of the master, and the identification information includes the first algorithm.
Step S1023, obtaining the second algorithm, and processing the first random array by using the second algorithm to obtain a second authentication array.
Step S1024, comparing and analyzing the first authentication data set and the second authentication data set.
Step S1025, if the first authentication array is consistent with the second authentication array, determining that the authentication passes.
It will be appreciated that, to increase the security of the unlocking method of the combination lock, the authentication pass can be determined only when the first authentication array is identical to the second authentication array.
As shown in fig. 3, in some embodiments, the third identification code is a first character string, and step S106 includes steps S1061 to S1065.
Step S1061, randomly replacing each number in the number display column in the preset encoding table with any number, to obtain the adjusted preset encoding table.
Illustratively, table 1 is the preset encoding table, and table 2 is the adjusted preset encoding table.
It can be appreciated that by adjusting the preset encoding table, the randomness of the unlocking password generated subsequently can be further improved, so that the security of the unlocking method of the coded lock is further improved.
Table 1 preset encoding table
Character display column Digital display column
A 0
B 1
C 2
D 3
E 4
F 5
G 6
H 7
I 8
J 9
Step S1062, consulting the adjusted preset encoding table based on the third identification code to obtain a number sequence corresponding to the third identification code.
For example, if the third identification code is DGCAFJ, the number column corresponding to the third identification code is 3,0,9,2, 15, 13.
Step S1063, randomly inserting each prime number in the first quantum random number sequence into the number sequence corresponding to the third identification code, to obtain an initial unlocking password.
For example, the first quantum random number sequence is 2,4,5,6,8, the number sequence corresponding to the third identification code is 3,0,9,2, 15, 13, the prime numbers in the first quantum random number sequence are 2 and 5, 2 and 5 are randomly inserted into the number sequence 3,0,9,2, 15, 13 corresponding to the third identification code to obtain a new number sequence 3,0,2,9,2, 15,5, 13, and the new number sequence is used as the initial unlocking password to obtain the initial unlocking password 3029215513.
Table 2 preset encoding table after adjustment
Character display column Digital display column
A 2
B 7
C 9
D 3
E 11
F 15
G 0
H 4
I 5
J 13
Step S1064, selecting the number of the initial unlocking password at the designated position.
For example, the initial unlocking password is 3029215513, the designated positions of the initial unlocking password are in the order of 1,3,5,7 and 9, and all the numbers selected are 3,2,2,5,1.
Step S1065, generating the unlocking password according to all the selected numbers.
The unlocking password may be generated by selecting all the digits according to the order of the digits.
For example, the initial unlocking password is 3029215513, the designated positions of the initial unlocking passwords are in the order of 1,3,5,7 and 9, all the selected digits are 3,2,2,5,1, and the unlocking password generated according to the ordering mode of all the selected digits is 32251.
As shown in fig. 4, in some embodiments, step S109 includes steps S1091 through S1095.
Step S1091, obtaining all historical unlocking passwords from an unlocking password database, and judging whether the unlocking passwords are used for the first time according to all the historical unlocking passwords.
Step S1092, if the unlock code is used for the first time, obtaining second time information, where the second time information is time information when the user inputs the unlock code on the code lock.
It can be understood that if the unlocking password is not used for the first time, a certain potential safety hazard may exist in the unlocking of the coded lock, and the user is required to resend an unlocking request for unlocking the coded lock at the APP of the terminal device.
Step S1093, calculating a duration between the first time information and the second time information.
Step S1094, comparing the duration with a preset duration.
And step 1095, unlocking the coded lock and storing the unlocking password into the unlocking password database if the duration is smaller than the preset duration.
It can be understood that if the duration is not less than the preset duration, it may be that the user does not unlock the coded lock after obtaining the unlocking code, and at this time, some illegal personnel may steal the unlocking code to unlock the coded lock, and by comparing the duration with the preset duration, when the duration is less than the preset duration, the safety of the method for unlocking the coded lock may be further improved.
In some embodiments, before the unlocking password is sent to the user, the method further includes encrypting the unlocking password, as shown in fig. 5, and the method for encrypting the unlocking password includes steps S501 to S507.
Step S501, obtaining third time information, and generating a second quantum random number sequence by using the quantum random number generator based on the third time information; the third time information is time information when the unlocking password is generated.
Step S502, referring to a preset encoding table according to the second quantum random number sequence, and generating a first encrypted string.
It can be understood that the second quantum random number sequence is generated by using the quantum number random generator, and a preset encoding table is consulted according to the second quantum random number sequence to generate a first encryption character string, so that timeliness and uniqueness of the first encryption character string can be improved, and the effect of encrypting the unlocking password can be improved.
For example, referring to a preset encoding table according to the second quantum random number sequence, generating the first encrypted character string may be to replace each number in the second quantum random number sequence with a character one by one according to the second quantum random number sequence referring to the preset encoding table.
For example, the second quantum random number sequence is 0,1,3,5,7,6, the preset encoding table is table 1, and the first encrypted string is abddfhg.
Step S503, randomly generating a second random array and a third random array, and referring to the preset encoding table according to the second random array and the third random array to obtain a second character string and a third character string; the second character string is a character string corresponding to the second random array, and the third character string is a character string corresponding to the third random array;
wherein the second random array and the third random array may be generated using a random number generator.
For example, the first random array is 4,6,9,0,1,5, the second random array is 3,9,2,7,9,0, the preset encoding table is shown in table 1, the second string is EGJABF, and the third string is DJCHJA.
Step S504, the characters of the second character string and the third character string at the appointed position are selected respectively.
For example, the second string is EGJABF, the third string is DJCHJA, the specified positions of the first string are in order 1,3,5, and the specified positions of the second string are in order 2,4,6, and then all the selected characters are E, J, B, J, H, a.
Step S505, a second encryption character string is generated according to all the selected characters.
For example, the generating the second encrypted string according to all the selected characters may be generating the second encrypted string after randomly ordering all the selected characters.
For example, the selected characters are E, J, B, J, H, a, and the character sequence generated by randomly sequencing all the selected characters is B, H, J, E, a, J, and the generated second encrypted character string is the character EJBJHA.
And step S506, encrypting the unlocking password by adopting the first encryption character string to obtain a first encryption unlocking password.
And step S507, encrypting the first encryption unlocking password by adopting the second encryption character string to obtain a second encryption unlocking password.
It can be understood that the unlocking password is encrypted twice, so that the security of the unlocking password can be further improved, and the unlocking password is prevented from being stolen.
Referring to fig. 6, fig. 6 is a schematic block diagram of an unlocking device 100 of a coded lock according to an embodiment of the present application, and as shown in fig. 6, the unlocking device 100 of a coded lock includes:
a first obtaining module 101, configured to obtain identification information of a terminal device in response to an unlocking request of a user for a coded lock; the user sends the unlocking request by using the terminal equipment;
And the authentication module 102 is configured to authenticate the unlocking request of the user according to the identification information.
A generating module 103, configured to obtain first time information if the authentication passes, and generate a first quantum random number sequence by using a quantum random number generator based on the first time information; the first time information is time information when the authentication passes.
A second obtaining module 104, configured to obtain a first identifier and a second identifier; the first identification code is the identification code of the coded lock, and the second identification code is the identification code of the terminal equipment.
A first generating module 105, configured to generate a third identifier according to the first identifier and the second identifier.
And the second generation module 106 is configured to generate an unlocking password according to the first quantum random number sequence and the third identification code, and replace the first identification code with the third identification code.
And the sending module 108 is used for sending the unlocking password to the user.
And a third obtaining module 109, configured to obtain the unlock code in response to the user input of the unlock code.
And the unlocking module 110 is used for unlocking the coded lock according to the unlocking code.
As shown in fig. 7, in some embodiments, the authentication module 102 includes:
a generation unit for randomly generating a first random array;
the first acquisition unit is used for acquiring the first algorithm and processing the first random array by utilizing the first algorithm to obtain a first authentication array;
the second acquisition unit is used for acquiring the second algorithm and processing the first random array by utilizing the second algorithm to obtain a second authentication array;
the comparison unit is used for comparing and analyzing the first authentication array and the second authentication array;
and the determining unit is used for determining that the authentication passes if the first authentication array is consistent with the second authentication array.
As shown in fig. 8, in some embodiments, the second generation module 106 includes:
and the adjusting unit is used for randomly replacing each number in the number display column in the preset encoding table with any number to obtain the adjusted preset encoding table.
And the consulting unit is used for consulting the adjusted preset coding table based on the third identification code to obtain a number row corresponding to the third identification code.
And the interpolation unit is used for randomly inserting each prime number in the first quantum random number sequence into the number sequence corresponding to the third identification code to obtain an initial unlocking password.
And the selecting unit is used for selecting the number of the initial unlocking password at the designated position.
And the generating unit is used for generating the unlocking password according to all the selected numbers.
As shown in fig. 9, in some embodiments, the unlocking module 110 includes:
and the judging unit is used for acquiring all the historical unlocking passwords from the unlocking password database and judging whether the unlocking passwords are used for the first time according to all the historical unlocking passwords.
The acquisition unit is used for acquiring second time information when the unlocking password is input by the user on the password lock if the unlocking password is used for the first time.
And the calculating unit is used for calculating the duration between the first time information and the second time information.
And the comparison unit is used for comparing the duration with a preset duration.
And the unlocking unit is used for unlocking the coded lock if the duration is smaller than the preset duration, and storing the unlocking code into the unlocking code database.
As shown in fig. 6, in some embodiments, the unlocking device 100 of the combination lock further includes an encryption module 107, as shown in fig. 10, and in some embodiments, the encryption module 107 includes:
The first generation unit is used for acquiring third time information and generating a second quantum random number sequence by using the quantum random number generator based on the third time information; the third time information is time information when the unlocking password is generated.
And the consulting unit is used for consulting a preset coding table according to the second quantum random number sequence to generate a first encryption character string.
The second generation unit is used for randomly generating a second random array and a third random array, and consulting the preset coding table according to the second random array and the third random array to obtain a second character string and a third character string; the second character string is a character string corresponding to the second random array, and the third character string is a character string corresponding to the third random array.
And the selection unit is used for respectively selecting the characters of the second character string and the third character string at the appointed position.
And the third generation unit is used for generating a second encryption character string according to all the selected characters.
And the first encryption unit is used for encrypting the unlocking password by adopting the first encryption character string to obtain a first encrypted unlocking password.
And the second encryption unit is used for encrypting the first encryption unlocking password by adopting the second encryption character string to obtain a second encryption unlocking password.
It should be noted that, for convenience and brevity of description, specific working processes of the above-described device and each module and unit may refer to corresponding processes in the foregoing unlocking method embodiments of the trick lock, which are not described herein again.
The unlocking apparatus 100 of the combination lock provided in the above embodiment may be implemented in the form of a computer program that can be run on the terminal device 200 as shown in fig. 11.
Referring to fig. 11, fig. 11 is a schematic block diagram of a structure of a terminal device 200 according to an embodiment of the present application, where the terminal device 200 includes a processor 201 and a memory 202, and the processor 201 and the memory 202 are connected through a system bus 203, and the memory 202 may include a nonvolatile storage medium and an internal memory.
The non-volatile storage medium may store a computer program. The computer program comprises program instructions that, when executed by the processor 201, cause the processor 201 to perform any of the above-described methods of unlocking a combination lock.
The processor 201 is used to provide computing and control capabilities supporting the operation of the overall terminal device 200.
The internal memory provides an environment for the execution of a computer program in a non-volatile storage medium that, when executed by the processor 201, causes the processor 201 to perform any of the above-described methods of unlocking a combination lock.
It will be appreciated by those skilled in the art that the structure shown in fig. 11 is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation of the terminal device 200 related to the present application, and that a specific terminal device 200 may include more or less components than those shown in the drawings, or may combine some components, or have a different arrangement of components.
It should be appreciated that the processor 201 may be a central processing unit (Central Processing Unit, CPU), and the processor 201 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In some embodiments, the processor 201 is configured to execute a computer program stored in the memory to implement the following steps:
responding to an unlocking request of a user for the coded lock, and acquiring identification information of terminal equipment; the user sends the unlocking request by using the terminal equipment;
authenticating the unlocking request of the user according to the identification information;
if the authentication is passed, acquiring first time information, and generating a first quantum random number sequence by using a quantum random number generator based on the first time information; wherein, the first time information is the time information when the authentication passes;
acquiring a first identification code and a second identification code; the first identification code is the identification code of the coded lock, and the second identification code is the identification code of the terminal equipment;
generating a third identification code according to the first identification code and the second identification code;
generating an unlocking password according to the first quantum random number sequence and the third identification code, and replacing the first identification code with the third identification code;
sending the unlocking password to the terminal equipment;
responding to the input of the unlocking password by the user, and acquiring the unlocking password;
And unlocking the coded lock according to the unlocking code.
In some embodiments, the identification information includes a first algorithm, a second algorithm identical to the first algorithm is provided in the coded lock, and the processor 201 is configured to, when implementing the authentication of the unlocking request of the user according to the user identification information, implement:
randomly generating a first random array;
acquiring the first algorithm, and processing the first random array by using the first algorithm to obtain a first authentication array;
acquiring the second algorithm, and processing the first random array by using the second algorithm to obtain a second authentication array;
comparing the first authentication array with the second authentication array;
and if the first authentication array is consistent with the second authentication array, determining that the authentication passes.
In some embodiments, the third identification code is a first character string, and when implementing the generating the unlock password according to the first quantum random number sequence and the third identification code, the processor 201 is configured to implement:
randomly replacing each number in a number display column in a preset encoding table with any number to obtain an adjusted preset encoding table;
Referring to the adjusted preset coding table based on the third identification code to obtain a number sequence corresponding to the third identification code;
randomly inserting each prime number in the first quantum random number sequence into the number sequence corresponding to the third identification code to obtain an initial unlocking password;
selecting the number of the initial unlocking password at the designated position;
and generating the unlocking password according to all the selected numbers.
In some embodiments, when implementing the unlocking of the combination lock according to the unlocking combination, the processor 201 is configured to implement:
acquiring all historical unlocking passwords from an unlocking password database, and judging whether the unlocking passwords are used for the first time according to all the historical unlocking passwords;
if the unlocking password is used for the first time, acquiring second time information, wherein the second time information is the time information when the user inputs the unlocking password on the password lock;
calculating the time length between the first time information and the second time information;
comparing the time length with a preset time length;
and if the time length is smaller than the preset time length, unlocking the coded lock, and storing the unlocking code into the unlocking code database.
In some embodiments, before implementing the sending the unlock code to the user, the processor 201 is further configured to implement:
acquiring third time information, and generating a second quantum random number sequence by using the quantum random number generator based on the third time information; the third time information is time information when the unlocking password is generated;
referring to a preset coding table according to the second quantum random number sequence, and generating a first encryption character string;
randomly generating a second random array and a third random array, and referring to the preset coding table according to the second random array and the third random array to obtain a second character string and a third character string; the second character string is a character string corresponding to the second random array, and the third character string is a character string corresponding to the third random array;
respectively selecting characters of the second character string and the third character string at the appointed position;
generating a second encrypted character string according to all the selected characters;
encrypting the unlocking password by adopting the first encryption character string to obtain a first encryption unlocking password;
and encrypting the first encryption unlocking password by adopting the second encryption character string to obtain a second encryption unlocking password.
It should be noted that, for convenience and brevity of description, the specific working process of the terminal device 200 described above may refer to the corresponding process of the unlocking method of the coded lock, and will not be described herein.
The embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program when executed by one or more processors causes the one or more processors to realize the unlocking method of the coded lock provided by the embodiment of the application.
The computer readable storage medium may be an internal storage unit of the terminal device 200 of the foregoing embodiment, for example, a hard disk or a memory of the terminal device 200. The computer readable storage medium may also be an external storage device of the terminal device 200, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which the terminal device 200 is equipped with.
While the application has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the application. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (7)

1. A method of unlocking a combination lock, the method comprising:
responding to an unlocking request of a user for the coded lock, and acquiring identification information of terminal equipment; the user sends the unlocking request by using the terminal equipment;
authenticating the unlocking request of the user according to the identification information;
if the authentication is passed, acquiring first time information, and generating a first quantum random number sequence by using a quantum random number generator based on the first time information; wherein, the first time information is the time information when the authentication passes;
acquiring a first identification code and a second identification code; the first identification code is the identification code of the coded lock, and the second identification code is the identification code of the terminal equipment;
generating a third identification code according to the first identification code and the second identification code;
generating an unlocking password according to the first quantum random number sequence and the third identification code, and replacing the first identification code with the third identification code;
sending the unlocking password to the terminal equipment;
responding to the input of the unlocking password by the user, and acquiring the unlocking password;
Unlocking the coded lock according to the unlocking code;
the third identification code is a first character string, and the generating an unlocking password according to the first quantum random number sequence and the third identification code includes:
randomly replacing each number in a number display column in a preset encoding table with any number to obtain an adjusted preset encoding table;
referring to the adjusted preset coding table based on the third identification code to obtain a number sequence corresponding to the third identification code;
randomly inserting each prime number in the first quantum random number sequence into the number sequence corresponding to the third identification code to obtain an initial unlocking password;
selecting the number of the initial unlocking password at the designated position;
and generating the unlocking password according to all the selected numbers.
2. The method for unlocking a coded lock according to claim 1, wherein the identification information includes a first algorithm, a second algorithm identical to the first algorithm is provided in the coded lock, and the authenticating the unlocking request of the user according to the user identification information includes:
randomly generating a first random array;
acquiring the first algorithm, and processing the first random array by using the first algorithm to obtain a first authentication array;
Acquiring the second algorithm, and processing the first random array by using the second algorithm to obtain a second authentication array;
comparing the first authentication array with the second authentication array;
and if the first authentication array is consistent with the second authentication array, determining that the authentication passes.
3. The unlocking method of a combination lock according to claim 1, wherein unlocking the combination lock according to the unlocking combination comprises:
acquiring all historical unlocking passwords from an unlocking password database, and judging whether the unlocking passwords are used for the first time according to all the historical unlocking passwords;
if the unlocking password is used for the first time, acquiring second time information, wherein the second time information is the time information when the user inputs the unlocking password on the password lock;
calculating the time length between the first time information and the second time information;
comparing the time length with a preset time length;
and if the time length is smaller than the preset time length, unlocking the coded lock, and storing the unlocking code into the unlocking code database.
4. The method of unlocking a combination lock according to claim 1, wherein prior to said transmitting the unlocking combination to the user, the method further comprises encrypting the unlocking combination, the method comprising:
Acquiring third time information, and generating a second quantum random number sequence by using the quantum random number generator based on the third time information; the third time information is time information when the unlocking password is generated;
referring to a preset coding table according to the second quantum random number sequence, and generating a first encryption character string;
randomly generating a second random array and a third random array, and referring to the preset coding table according to the second random array and the third random array to obtain a second character string and a third character string; the second character string is a character string corresponding to the second random array, and the third character string is a character string corresponding to the third random array;
respectively selecting characters of the second character string and the third character string at the appointed position;
generating a second encrypted character string according to all the selected characters;
encrypting the unlocking password by adopting the first encryption character string to obtain a first encryption unlocking password;
and encrypting the first encryption unlocking password by adopting the second encryption character string to obtain a second encryption unlocking password.
5. An unlocking device of a combination lock, comprising:
The first acquisition module is used for responding to an unlocking request of a user for the coded lock and acquiring identification information of the terminal equipment; the user sends the unlocking request by using the terminal equipment;
the authentication module is used for authenticating the unlocking request of the user according to the identification information;
the generation module is used for acquiring first time information if the authentication passes, and generating a first quantum random number sequence by using a quantum random number generator based on the first time information; wherein, the first time information is the time information when the authentication passes;
the second acquisition module is used for acquiring the first identification code and the second identification code; the first identification code is the identification code of the coded lock, and the second identification code is the identification code of the terminal equipment;
the first generation module is used for generating a third identification code according to the first identification code and the second identification code;
the second generation module is used for generating an unlocking password according to the first quantum random number sequence and the third identification code and replacing the first identification code with the third identification code;
the sending module is used for sending the unlocking password to the user;
The third acquisition module is used for responding to the input of the unlocking password by the user and acquiring the unlocking password;
the unlocking module is used for unlocking the coded lock according to the unlocking code;
wherein the third identification code is a first character string, and the second generation module includes:
the adjusting unit is used for randomly replacing each number in the number display column in the preset encoding table with any number to obtain an adjusted preset encoding table;
the consulting unit is used for consulting the adjusted preset coding table based on the third identification code to obtain a number column corresponding to the third identification code;
the interpolation unit is used for randomly inserting each prime number in the first quantum random number sequence into the number sequence corresponding to the third identification code to obtain an initial unlocking password;
the selecting unit is used for selecting the number of the initial unlocking password at the designated position;
and the generating unit is used for generating the unlocking password according to all the selected numbers.
6. A terminal device comprising a processor, a memory and a computer program stored on the memory and executable by the processor, wherein the computer program when executed by the processor implements the method of unlocking a combination lock according to any one of claims 1 to 4.
7. A computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, wherein the computer program, when executed by a processor, implements a method of unlocking a combination lock according to any one of claims 1 to 4.
CN202310787042.3A 2023-06-30 2023-06-30 Unlocking method, device, equipment and storage medium of coded lock Active CN116527258B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310787042.3A CN116527258B (en) 2023-06-30 2023-06-30 Unlocking method, device, equipment and storage medium of coded lock

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310787042.3A CN116527258B (en) 2023-06-30 2023-06-30 Unlocking method, device, equipment and storage medium of coded lock

Publications (2)

Publication Number Publication Date
CN116527258A CN116527258A (en) 2023-08-01
CN116527258B true CN116527258B (en) 2023-09-22

Family

ID=87399767

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310787042.3A Active CN116527258B (en) 2023-06-30 2023-06-30 Unlocking method, device, equipment and storage medium of coded lock

Country Status (1)

Country Link
CN (1) CN116527258B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117092493B (en) * 2023-10-19 2024-01-16 深圳市百千成电子有限公司 PCBA automatic test system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108055235A (en) * 2017-11-01 2018-05-18 华中科技大学 A kind of control method of smart lock, relevant device and system
CN108320355A (en) * 2017-12-29 2018-07-24 中国船舶重工集团公司第七八研究所 A kind of the emergency cryptosystem open system and its open method of intelligent door lock
CN109658545A (en) * 2018-04-02 2019-04-19 深圳中泰智丰物联网科技有限公司 A kind of cipher set-up method and network access system of network lock
KR20190094727A (en) * 2018-02-05 2019-08-14 충북대학교 산학협력단 Locking device and method for controlling the same
CN110443925A (en) * 2019-08-06 2019-11-12 深圳市沃特沃德股份有限公司 Generation method, device, storage medium and the computer equipment of temporary password
CN115100762A (en) * 2022-05-31 2022-09-23 深圳市旭子科技有限公司 Safe unlocking method for generating 12-bit true random dynamic password
CN116318675A (en) * 2023-03-22 2023-06-23 浙江北泰智能科技股份有限公司 Dynamic password generation method, system, device, computer equipment and medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108055235A (en) * 2017-11-01 2018-05-18 华中科技大学 A kind of control method of smart lock, relevant device and system
CN108320355A (en) * 2017-12-29 2018-07-24 中国船舶重工集团公司第七八研究所 A kind of the emergency cryptosystem open system and its open method of intelligent door lock
KR20190094727A (en) * 2018-02-05 2019-08-14 충북대학교 산학협력단 Locking device and method for controlling the same
CN109658545A (en) * 2018-04-02 2019-04-19 深圳中泰智丰物联网科技有限公司 A kind of cipher set-up method and network access system of network lock
CN110443925A (en) * 2019-08-06 2019-11-12 深圳市沃特沃德股份有限公司 Generation method, device, storage medium and the computer equipment of temporary password
CN115100762A (en) * 2022-05-31 2022-09-23 深圳市旭子科技有限公司 Safe unlocking method for generating 12-bit true random dynamic password
CN116318675A (en) * 2023-03-22 2023-06-23 浙江北泰智能科技股份有限公司 Dynamic password generation method, system, device, computer equipment and medium

Also Published As

Publication number Publication date
CN116527258A (en) 2023-08-01

Similar Documents

Publication Publication Date Title
US9525549B2 (en) Method and apparatus for securing a mobile application
US8843745B2 (en) Methods of authorizing a computer license
CN100432889C (en) System and method providing disconnected authentication
CN110149328B (en) Interface authentication method, device, equipment and computer readable storage medium
US8561174B2 (en) Authorization method with hints to the authorization code
CN106664200B (en) Method, computing device, and storage medium for controlling access to a resource
US20030163738A1 (en) Universal password generator
JPH11306088A (en) Ic card and ic card system
CN116527258B (en) Unlocking method, device, equipment and storage medium of coded lock
WO2003065169A2 (en) Access system utilizing multiple factor identification and authentication
US20060143450A1 (en) Method and apparatus for authenticating a password
CN111125456B (en) Virtual bit password comparison method, system and intelligent lock
US11502840B2 (en) Password management system and method
CN112866987A (en) Networking verification method, equipment and computer readable storage medium
CN112464188B (en) Binding method of payment terminal and peripheral password keyboard
WO2017031903A1 (en) File processing method and apparatus for electronic device
JP6962676B2 (en) Authentication-related information transmission control program, authentication-related information transmission control device, and authentication-related information transmission control method
US20200313870A1 (en) Execution device, command device, methods executed by same, and computer program
CN118072426A (en) Hash-based intelligent door lock user information storage method, unlocking method and intelligent door lock
JP2023064316A (en) Transmitting device, communication system, transmitting method, and transmitting program
US20200265125A1 (en) Method for managing access to a device, and access system
KR101669770B1 (en) Device for authenticating password and operating method thereof
CN117176357A (en) Multi-factor authentication encryption storage method and system based on intelligent password key
CN113345139A (en) Unlocking method, intelligent lock cylinder and intelligent lock system
CN117711094A (en) Dynamic password generation method of intelligent door lock and related 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