WO2023221950A1 - 电子锁处理方法以及装置 - Google Patents

电子锁处理方法以及装置 Download PDF

Info

Publication number
WO2023221950A1
WO2023221950A1 PCT/CN2023/094371 CN2023094371W WO2023221950A1 WO 2023221950 A1 WO2023221950 A1 WO 2023221950A1 CN 2023094371 W CN2023094371 W CN 2023094371W WO 2023221950 A1 WO2023221950 A1 WO 2023221950A1
Authority
WO
WIPO (PCT)
Prior art keywords
password
electronic lock
dynamic
configuration information
shared key
Prior art date
Application number
PCT/CN2023/094371
Other languages
English (en)
French (fr)
Inventor
李海东
石飞
Original Assignee
阿里云计算有限公司
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 阿里云计算有限公司 filed Critical 阿里云计算有限公司
Publication of WO2023221950A1 publication Critical patent/WO2023221950A1/zh

Links

Classifications

    • 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/00857Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys where the code of the data carrier can be programmed
    • 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/00571Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys operated by interacting with a central unit
    • 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/00817Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys where the code of the lock can be programmed
    • G07C2009/00825Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys where the code of the lock can be programmed remotely by lines or wireless communication
    • 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/00817Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys where the code of the lock can be programmed
    • G07C2009/00841Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys where the code of the lock can be programmed by a portable device

Definitions

  • the embodiments of this specification relate to the technical field of electronic code locks, and in particular to electronic lock processing methods.
  • An electronic password lock is an electronic product that controls the operation of a circuit or chip (access control system) through password input, thereby controlling the closing of a mechanical switch and completing unlocking and locking tasks.
  • embodiments of this specification provide an electronic lock processing method.
  • One or more embodiments of this specification simultaneously relate to an electronic lock processing device, a computing device, a computer-readable storage medium and a computer program, so as to solve the technical deficiencies existing in the existing technology.
  • a first electronic lock processing method including:
  • a first electronic lock processing device including:
  • a receiving module configured to receive an unlocking request, where the unlocking request contains a dynamic password
  • a decoding module configured to decode the dynamic password and obtain the group index of the password group and the intermediate password of the target electronic lock
  • a determination module configured to determine the password configuration information corresponding to the password group according to the group index, and to determine the shared key corresponding to the target electronic lock;
  • a comparison module configured to process the password configuration information and the shared key, generate a reference password, and compare the reference password with the intermediate password;
  • the unlocking module is configured to perform the unlocking operation of the target electronic lock if the comparison is consistent.
  • a second electronic lock processing method including:
  • the intermediate password and the group index of the password group are encoded to generate the dynamic password and return it.
  • a second electronic lock processing device including:
  • the receiving module is configured to receive an acquisition request for the dynamic password of the target electronic lock, wherein the acquisition request includes the lock identification of the target electronic lock and the to-be-processed project information associated with the target electronic lock;
  • a determination module configured to determine the password group corresponding to the dynamic password based on the item information to be processed, and determine the password configuration information corresponding to the password group;
  • a processing module configured to determine the shared key corresponding to the target electronic lock based on the lock identification, and generate an intermediate password based on the password configuration information and the shared key;
  • the encoding module is configured to encode the intermediate password and the group index of the password group, generate the dynamic password and return it.
  • a computing device including:
  • the memory is used to store computer-executable instructions
  • the processor is used to execute the computer-executable instructions to implement any one of the steps of the electronic lock processing method.
  • a computer-readable storage medium which stores computer-executable instructions. When the instructions are executed by a processor, any one of the steps of the electronic lock processing method is implemented.
  • a computer program is provided, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above electronic lock processing method.
  • One embodiment of this specification receives a unlocking request, wherein the unlocking request contains a dynamic password, decodes the dynamic password, obtains the grouping index of the password group and the intermediate password of the target electronic lock, and determines it according to the grouping index.
  • the password configuration information corresponding to the password group and determine the shared key corresponding to the target electronic lock, Process the password configuration information and the shared key to generate a reference password, and compare the reference password with the intermediate password. If the comparison is consistent, unlock the target electronic lock. operate.
  • the electronic lock is expanded to support multiple groups of dynamic passwords, and each group of dynamic passwords is set with different password configuration information, which is conducive to making the electronic lock meet the needs of different usage scenarios; in addition, by generating a reference password, and based on the reference password
  • the method of verifying the intermediate password determines whether the intermediate password meets the unlocking conditions. Verifying the intermediate password in this way will help ensure the accuracy of the verification results, thereby improving the security of the electronic lock.
  • Figure 1 is an architectural diagram of an electronic lock processing process provided by an embodiment of this specification
  • Figure 2 is a flow chart of the first electronic lock processing method provided by an embodiment of this specification
  • FIG. 3 is a schematic diagram of an electronic lock processing process provided by an embodiment of this specification.
  • Figure 4 is a schematic structural diagram of a first electronic lock processing device provided by an embodiment of this specification.
  • Figure 5 is a flow chart of a second electronic lock processing method provided by an embodiment of this specification.
  • Figure 6 is a process flow chart of an electronic lock processing method provided by an embodiment of this specification.
  • Figure 7 is a schematic structural diagram of a second electronic lock processing device provided by an embodiment of this specification.
  • Figure 8 is a structural block diagram of a computing device provided by an embodiment of this specification.
  • first, second, etc. may be used to describe various information in one or more embodiments of this specification, the information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other.
  • the first may also be called the second, and similarly, the second may also be called the first.
  • the word "if” as used herein may be interpreted as "when” or “when” or “in response to determining.”
  • Dynamic password a password that changes with a certain factor. For example: changes over time.
  • Security cryptographic module a security component that implements cryptographic algorithms and can be used to ensure the security of key storage and use.
  • Key derivation Using a specific algorithm to process an initial key to generate another key. Algorithms and initial The original key is the same and the derived key is the same.
  • TOTP algorithm Time-based One-time Password algorithm, an algorithm for calculating one-time passwords based on a shared key and the current time.
  • an electronic lock processing method is provided.
  • This specification also relates to an electronic lock processing device, a computing device, a computer-readable storage medium, and a computer program, which are described in detail one by one in the following embodiments. .
  • Figure 1 shows an architectural diagram of an electronic lock processing process provided according to an embodiment of this specification, including:
  • the shared key and password configuration information of the electronic lock are shared between the electronic lock and the server, and time synchronization is maintained.
  • the server generates a dynamic password based on the shared key, password configuration information and the current time, and sends it to the user terminal of the authorized user; after the user obtains the dynamic password, he enters the dynamic password on the electronic lock to try to unlock; the electronic lock receives After the dynamic password is generated, decode the dynamic password to determine the index of the password configuration information based on the decoding result, use the index to retrieve the corresponding password configuration information, and generate a reference key based on the shared key, password configuration information, and the current time, and then Verify the dynamic password entered by the user by comparing the reference password with the dynamic password entered by the user. If the comparison fails, unlocking will be refused. If the comparison is successful, the password policy defined in the password configuration information will determine whether to unlock the lock. .
  • an electronic lock can support multiple sets of dynamic passwords at the same time.
  • the change period maximum validity period
  • password length e.g., a password that is used to verify the dynamic password entered by the user, which is beneficial to ensuring the accuracy of the verification results, thereby improving the security of the electronic lock.
  • Figure 2 shows a flow chart of a first electronic lock processing method provided according to an embodiment of this specification, which specifically includes the following steps.
  • Step 202 Receive an unlocking request, where the unlocking request contains a dynamic password.
  • the electronic lock processing method provided by the embodiments of this specification is applied to electronic locks, that is, target electronic locks. Users can send unlocking requests to the electronic lock by entering a dynamic password into the electronic lock.
  • the dynamic password is generated by the server and returned to the user, and the dynamic password is a password that changes with a certain factor.
  • the dynamic password can change with time. Therefore, the dynamic password can carry its aging information, including but not limited to the valid period, valid duration, valid times, etc. Therefore, after the electronic lock receives the user's unlocking request, the dynamic password can be verified to determine whether it meets the unlocking conditions.
  • the user needs to unlock the electronic lock, he or she can first send a dynamic password acquisition request for the electronic lock to the server, where the acquisition request contains the pending items associated with the electronic lock.
  • Information such as house viewing or rental information, etc.
  • different password groups correspond to different password configuration information, such as group index, password length, password change period, password policy, etc.
  • the group index for example: the electronic lock supports 100 sets of passwords, and the index values are 00 to 99;
  • Password change period can be set to various granularity periods, such as: 1 minute, 10 minutes, 30 minutes, 1 hour, 1 day, 3 days, 1 week, 1 month, 1 year, etc.;
  • Password length can support various password lengths, such as: 4, 6, 8, 10, etc.;
  • the password policy is the unlocking policy corresponding to the group password, including the number of times the password is valid, the password validity period, etc. For example: restricting the password to a single unlock within the validity period, dynamic passwords automatically converting into static passwords with a longer validity period after being verified within the validity period, etc.
  • the password length or password validity period of dynamic passwords corresponding to different projects to be processed includes but are not limited to shared resource projects such as online house viewing projects, shared bicycle projects, or self-service ticket collection projects.
  • shared resource projects such as online house viewing projects, shared bicycle projects, or self-service ticket collection projects.
  • the dynamic password is generally set to be valid once, and the length of the dynamic password will be relatively short; or in a shared bicycle project, when providing users with a dynamic password
  • the dynamic password can be set to be valid for one time or multiple times.
  • the length of the dynamic password can be appropriately increased to ensure the complexity of the password; or in the self-service ticket collection project, when providing the user with a dynamic password for self-service ticket collection , the usage status of the dynamic password can be updated according to the ticket collection result. Specifically, when it is detected that the user uses the dynamic password to collect the ticket, but the ticket collection result is that the ticket collection fails, the usage status of the dynamic password is still kept valid, and when detecting When the user's ticket collection result is that the ticket collection is successful, the valid status of the dynamic password provided for the user is updated to an invalid status.
  • the server can determine the password group corresponding to the dynamic password based on the pending project information carried in the request, determine the password configuration information corresponding to the password group, and then determine The electronic lock corresponds to the shared key, and generates an intermediate password based on the password configuration information and the shared key; then the intermediate password and the group index of the password group are encoded to generate a dynamic password and send it via short message, business APP or applet. , sending the dynamic password to the user's user terminal.
  • the user After the user obtains the dynamic password through the user terminal, the user can send an unlocking request to the electronic lock by entering the dynamic password into the electronic lock.
  • Step 204 Decode the dynamic password to obtain the group index of the password group and the intermediate password of the target electronic lock.
  • the server generates an intermediate password by processing the password configuration information corresponding to the password group and the shared key corresponding to the electronic lock; and then encodes the intermediate password and the group index of the password group to generate a dynamic password, and After receiving the dynamic password, the electronic lock needs to verify the dynamic password. Specifically, it needs to verify the intermediate password. Therefore, the dynamic password can be decoded first to obtain the group index of the password group contained in the dynamic password. The intermediate password of the electronic lock is introduced, and then the group index is used to verify the intermediate password to determine whether the dynamic password meets the unlocking conditions.
  • the server when it encodes the intermediate password and the group index of the password group, it can use a scrambling algorithm to encode it to ensure the security of the intermediate password.
  • the scrambling algorithm can be a universal Scrambling algorithm CAS (Common Scrambling Algorithm).
  • the electronic lock decodes the dynamic password to obtain the group index of the password group and the intermediate password of the target electronic lock.
  • the dynamic password can be decoded through a descrambling algorithm to generate the password contained in the dynamic password.
  • the user inputs the dynamic password into the electronic lock within the validity period and attempts to unlock the lock; after the electronic lock receives the dynamic password input by the user, it can use the descrambling algorithm to decode the dynamic password to extract the intermediate password from the decoding result.
  • the password and the group index of the password group, and then the intermediate password is verified by the group index.
  • the server scrambles the intermediate password and the group index to generate a dynamic password.
  • the electronic lock decodes the dynamic password and needs to perform descrambling.
  • the same formula is used for descrambling and scrambling, and the LFSR uses the same initial value. Therefore, if the server uses the common scrambling algorithm CAS (Common Scrambling Algorithm) to scramble the intermediate password and group index to generate a dynamic password, the electronic lock also needs to use the same formula as the common scrambling algorithm to descramble the dynamic password. Processing, but in actual applications, the specific scrambling and descrambling algorithm used can be determined according to actual needs and is not limited here.
  • CAS Common Scrambling Algorithm
  • Step 206 Determine the password configuration information corresponding to the password group according to the group index, and determine the shared key corresponding to the target electronic lock.
  • multiple password groups are pre-stored in the server.
  • Different password groups correspond to different password configuration information, such as group index, group password length, group password change period, group password policy, etc.
  • the shared key of the electronic lock is also stored in the server; the password group stored in the server, the password configuration information corresponding to different password groups, and the shared key of the electronic lock are all synchronized with the electronic lock, that is, the electronic lock.
  • the password group stored in the lock, the password configuration information corresponding to different password groups, and the shared key of the electronic lock are all the same as the password group stored on the server, the password configuration information corresponding to different password groups, and the shared key of the electronic lock. consistent.
  • the electronic lock After the electronic lock receives the unlocking request, it can decode the dynamic password contained in the unlocking request, obtain the group index of the password group contained in the dynamic password and the intermediate password of the electronic lock, and then determine the password group based on the group index, and then Determine the password configuration information corresponding to the password group and the shared key corresponding to the electronic lock, so as to use the password configuration information and the shared key to verify the dynamic password input by the user, thereby determining whether to unlock the lock.
  • the electronic lock is expanded to support multiple groups of dynamic passwords, and each group of dynamic passwords is set with different password configuration information, which is beneficial to enable the electronic lock to meet the needs of different projects or different usage scenarios.
  • the electronic lock can store its shared key in the security password module. Therefore, the shared key corresponding to the target electronic lock can be determined by calling the security password module and determining the stored key of the security password module. The shared key corresponding to the target electronic lock.
  • a security password module can be installed in the electronic lock, and the security password module can have a built-in shared key of the electronic lock.
  • the shared key can be burned into the security password module when the production line is producing the security password module. It can be configured during the electronic lock installation process; for electronic locks with networking capabilities, the shared key of the electronic lock can also be pulled from the server when the electronic lock is connected to the Internet.
  • the embodiment of this specification uses a security password module to protect the shared key of the electronic lock, which is beneficial to improving the security of the shared key.
  • Step 208 Process the password configuration information and the shared key to generate a reference password, and compare the reference password with the intermediate password.
  • the electronic lock After the electronic lock determines its shared key and the password configuration information corresponding to the password group, it can generate a reference password based on the shared key and password configuration information, where the reference password generation process is used to generate an intermediate password with the server. The process is consistent, and the intermediate password is verified based on the reference password to determine whether the intermediate password meets the unlocking conditions. Verifying the intermediate password in this way is conducive to improving the security of the electronic lock.
  • the password configuration information and the shared key are processed to generate a reference password.
  • the current time information can be determined, and the current time information, the shared key and the password configuration information include The password switching cycle is processed to generate a reference password.
  • the server when the server generates the intermediate password, since the password configuration information it uses contains the password switching period, when generating the intermediate password, the current time can be determined first to determine the current time based on the current time, shared key, and password configuration information.
  • the intermediate password is generated according to the password switching period in the password switching cycle.
  • the switching time of the intermediate password can be determined through the current time and the password switching period, so that the electronic lock can determine whether the intermediate password meets the unlocking conditions based on the switching time, thereby improving the efficiency of the electronic lock. Use security.
  • the electronic lock decodes to obtain the group index of the password group, obtains the password configuration information corresponding to the password group based on the group index, and determines the shared key corresponding to the target electronic lock, it can use a process similar to the intermediate password generation process on the server side.
  • the current time information may be determined first, and the password switching period contained in the current time information, the shared key, and the password configuration information may be processed to generate a reference password.
  • the time of the electronic lock is synchronized with the time of the server to ensure that when the intermediate password is verified using the current time information of the electronic lock, the shared key, and the reference password generated by the password switching cycle contained in the password configuration information, the generated verification accuracy of test results.
  • the system time of the electronic lock can be calibrated during installation.
  • the time can be synchronized with the server when the electronic lock is connected to the Internet.
  • the password configuration information in the electronic lock can be written in the electronic lock firmware, or it can be configured during installation or pulled from the server when connected to the Internet. The details can be determined according to actual needs and are not limited here.
  • the password configuration information includes password switching period and password length
  • processing the password configuration information and the shared key to generate a reference password includes:
  • different password groups correspond to different password configuration information, such as group index, password length, password change period, password policy, etc. Since the password length or password validity period of the dynamic password corresponding to different project information to be processed may be different, for example, in an online house viewing project, when a dynamic password is provided to the user for house viewing, the dynamic password is generally set to be valid for one time. And the length of the dynamic password will be relatively short.
  • the server can determine the password group corresponding to the dynamic password based on the pending project information carried in the request, determine the password configuration information corresponding to the password group, and then determine the password corresponding to the electronic lock.
  • the shared key can be processed using a key derivation algorithm to generate a derived key; the current time on the server is then determined to use the time-based one-time password algorithm (TOTP algorithm) to compare the current time and the derived key.
  • TOTP algorithm time-based one-time password algorithm
  • the key and the password switching cycle in the password configuration information are processed to generate an intermediate password, where the length of the intermediate password is consistent with the password length in the password configuration information.
  • the electronic lock needs to generate a reference password and use this reference password to verify the intermediate password entered by the user, it must use the same method as the intermediate password to generate the reference password, specifically to determine the shared key and password configuration information.
  • the shared key can be processed through the key derivation algorithm to generate the derived key, and then the current time of the electronic lock can be determined, and the current time, derived key and password switching cycle in the password configuration information can be calculated through the TOTP algorithm. Process and generate a reference password, where the length of the reference password is consistent with the password length in the password configuration information, so as to use the reference password to verify the intermediate password input by the user.
  • the key derivation algorithm in the embodiment of this specification can be two key derivation algorithms: PBKDF2 (password-base KDF) or Scrypt (a password-base KDF algorithm), but the details can be determined according to actual needs and are not discussed here. Make restrictions.
  • the embodiments of this specification use a key derivation algorithm to process the shared key, generate a derived key, and generate a reference password or intermediate password based on the derived key, which is beneficial to increasing the difficulty of cracking the reference password or intermediate password, thereby helping to reduce sharing The probability of key leakage to ensure the security of passwords or electronic locks.
  • Step 210 If the comparison is consistent, perform the unlocking operation of the target electronic lock.
  • the electronic lock compares the reference password with the intermediate password, and determines that the two comparisons are consistent, it is determined that the intermediate password or the dynamic password meets the unlocking conditions. Therefore, the electronic lock can be unlocked. operation; and if it is determined that the comparison between the two is inconsistent, it is determined that the intermediate password or the dynamic password does not meet the unlocking conditions, and therefore, the unlocking operation of the electronic lock is not performed.
  • the electronic lock stores multiple password groups, and different password groups correspond to different password configuration information, such as group index, password length, password change period, password policy, etc. Therefore, when the intermediate password is generated based on the password configuration information corresponding to different password groups, the intermediate password has a corresponding password policy, and the password policy It can include the number of times the password is valid, the password validity period, etc. Therefore, if it is determined that the reference password is consistent with the intermediate password, before executing the unlocking operation of the target electronic lock, it is necessary to determine whether the dynamic password meets the corresponding requirements based on the password policy. Unlocking condition; if yes, perform the unlocking operation of the target electronic lock.
  • the intermediate password corresponds to a certain password policy
  • the password policy can include the number of times the password is valid, the password validity period, etc., therefore, even if it is determined that the reference password is consistent with the intermediate password, before the unlocking operation of the electronic lock is performed, It is also necessary to use the password policy corresponding to the intermediate password to further verify the intermediate password to determine whether it meets the unlocking conditions. If it meets the unlocking conditions, the electronic lock can be unlocked. If not, the electronic lock will not be executed. unlocking operation.
  • the password policy includes a password validity period, determine whether the dynamic password meets the corresponding unlocking conditions according to the password policy, including:
  • the password policy includes the number of times the password is valid, determine whether the dynamic password meets the corresponding unlocking conditions according to the password policy, including:
  • the intermediate password corresponds to a certain password policy
  • the password policy may include the number of times the password is valid, the password validity period, etc.
  • the password policy includes the password validity period, it means that the dynamic password is only valid within The dynamic password is only valid if entered within a fixed period of time. That is, the user enters the dynamic password into the electronic lock within a fixed period of time, and then the dynamic password is deemed to be valid, and then the electronic lock can be triggered to perform the unlocking operation.
  • the receiving time of the unlocking request can be further determined, that is, the receiving time of the dynamic password or the intermediate password is determined, and then it is determined whether the receiving time belongs to the password policy corresponding to the dynamic password. If the included password is valid period, it is determined that the dynamic password meets the corresponding unlocking conditions, so it can trigger the unlocking operation of the electronic lock.
  • the password policy when the password policy includes the number of valid times of the password, it means that the dynamic password has valid times of use. For example, if the number of valid times of the password is equal to 3, it means that the user can use the dynamic password to successfully unlock the electronic lock 3 times.
  • the lock cannot be successfully unlocked. Therefore, when it is determined that the reference password is consistent with the dynamic password, it can be further determined that the electronic lock has received the dynamic password and successfully unlocked the number of times within the historical time, and determined whether the number is less than the number contained in the password policy corresponding to the dynamic password. If the number of times the password is valid is less than , it is determined that the dynamic password meets the corresponding unlocking conditions, so the unlocking operation of the electronic lock can be triggered.
  • the intermediate password is verified twice in this way, which is beneficial to further ensuring the validity of the intermediate password, thereby ensuring the safety of the electronic lock.
  • the password configuration information corresponding to different password groups in the electronic lock can include a password policy, and the password policy can not only limit the dynamic password to unlock within the validity period, or limit the number of valid unlocks of the dynamic password, You can also set the dynamic password to be automatically converted into a static password with a longer validity period after passing the verification within the validity period.
  • the details can be determined according to actual needs and are not limited here.
  • This manual provides a solution for unlocking an electronic lock using a dynamic password.
  • the electronic lock supports multiple sets of dynamic passwords and does not require an Internet connection during operation. It is suitable for shared resource projects with no network or weak network.
  • the embodiment of this specification uses a security password module to protect the shared key of the electronic lock, which is beneficial to ensuring its security.
  • the shared key and password configuration information of the electronic lock are shared between the electronic lock and the server, and time synchronization is maintained.
  • the server uses the key derivation algorithm to process the shared key of the electronic lock to generate a derived key, and then uses the TOTP algorithm to process the derived key, the current time, and the change period in the password configuration information to generate an intermediate password, and then The intermediate password and the group identifier corresponding to the password group described in the password configuration information are scrambled and encoded to generate a dynamic password and send it to the user terminal of the authorized user.
  • the electronic lock After the user obtains the dynamic password, he enters the dynamic password on the electronic lock to try to unlock the lock; after receiving the dynamic password, the electronic lock scrambles and decodes the dynamic password to extract the intermediate password and group index based on the decoding result, and then uses the group
  • the index retrieves the password configuration information of the corresponding password group, then obtains the shared key of the electronic lock in the security password module, and uses the key derivation algorithm to process the shared key to generate a derived key, and then uses the TOTP algorithm to calculate the derived key.
  • the key, current time and change period in the password configuration information are processed to generate a reference password (intermediate password on the electronic lock side).
  • the reference password is compared with the intermediate password obtained by decoding to verify the dynamic password entered by the user. , if the comparison fails, unlocking will be refused. If the comparison is successful, whether to unlock will be decided based on the password policy defined by the password configuration information.
  • One embodiment of this specification receives a unlocking request, wherein the unlocking request contains a dynamic password, decodes the dynamic password, obtains the grouping index of the password group and the intermediate password of the target electronic lock, and determines it according to the grouping index.
  • Password configuration information corresponding to the password group and determine the shared key corresponding to the target electronic lock, process the password configuration information and the shared key, generate a reference password, and compare the reference password with the The intermediate passwords are compared with each other, and if the comparisons are consistent, the unlocking operation of the target electronic lock is performed.
  • the electronic lock is expanded to support multiple groups of dynamic passwords, and each group of dynamic passwords is set with different password configuration information, which is conducive to making the electronic lock meet the needs of different projects or different usage scenarios; in addition, by generating a reference password, and The method of verifying the intermediate password based on the reference password determines whether the intermediate password meets the unlocking conditions. Verifying the intermediate password in this way will help ensure the accuracy of the verification results, thereby improving the security of the electronic lock. .
  • Figure 4 shows a schematic structural diagram of a first electronic lock processing device provided by an embodiment of this specification. As shown in Figure 4, the device includes:
  • the receiving module 402 is configured to receive an unlocking request, where the unlocking request contains a dynamic password
  • the decoding module 404 is configured to decode the dynamic password and obtain the group index of the password group and the intermediate password of the target electronic lock;
  • the determination module 406 is configured to determine the password configuration information corresponding to the password group according to the group index, and determine the shared key corresponding to the target electronic lock;
  • the comparison module 408 is configured to process the password configuration information and the shared key, generate a reference password, and compare the reference password with the intermediate password;
  • the unlocking module 410 is configured to perform the unlocking operation of the target electronic lock if the comparison is consistent.
  • the decoding module 404 is further configured to:
  • the dynamic password is decoded through a descrambling algorithm to generate a group index of the password groups contained in the dynamic password and an intermediate password of the target electronic lock.
  • the comparison module 408 is further configured to:
  • the password configuration information includes password switching period and password length
  • comparison module 408 is further configured as:
  • the password configuration information includes a password policy
  • the unlocking module 410 is also configured to:
  • the password policy includes a password validity period
  • the unlocking module 410 is further configured as:
  • the password policy includes the number of times the password is valid
  • the unlocking module 410 is further configured as:
  • the determining module 406 is further configured to:
  • the above is a schematic solution of the first electronic lock processing device in this embodiment. It should be noted that the technical solution of the first electronic lock processing device and the technical solution of the above-mentioned first electronic lock processing method belong to the same concept. The technical solution of the first electronic lock processing device is not described in detail. Please refer to the description of the technical solution of the first electronic lock processing method mentioned above.
  • Figure 5 shows a flow chart of a second electronic lock processing method according to an embodiment of this specification, which specifically includes the following steps.
  • Step 502 Receive a dynamic password acquisition request for the target electronic lock, where the acquisition request contains to-be-processed project information associated with the target electronic lock.
  • Step 504 Determine the password group corresponding to the dynamic password according to the item information to be processed, and determine the password configuration information corresponding to the password group.
  • Step 506 Determine the shared key corresponding to the target electronic lock, and generate an intermediate password based on the password configuration information and the shared key.
  • the password configuration information includes a password switching period
  • generating an intermediate password based on the password configuration information and the shared key includes:
  • the password configuration information includes password switching period and password length
  • generating an intermediate password based on the password configuration information and the shared key includes:
  • Step 508 Encode the intermediate password and the group index of the password group, generate the dynamic password and return.
  • encoding the intermediate cipher and the group index of the cipher group includes:
  • the intermediate cipher and the group index of the cipher group are encoded using a scrambling algorithm.
  • One embodiment of this specification receives a dynamic password acquisition request for a target electronic lock, where the acquisition request contains pending project information associated with the target electronic lock, and determines the dynamic password corresponding to the pending project information based on the pending project information.
  • Password grouping determine the password configuration information corresponding to the password group, determine the shared key corresponding to the target electronic lock, and generate an intermediate password based on the password configuration information and the shared key, and compare the intermediate password
  • the group index of the password group is encoded, and the dynamic password is generated and returned.
  • the electronic lock is expanded to support multiple groups of dynamic passwords, and each group of dynamic passwords is set with different password configuration information, which is conducive to making the electronic lock meet the needs of different usage scenarios.
  • a scrambling algorithm can be used to encode them to ensure the security of the intermediate password.
  • the above is a schematic solution of the second electronic lock processing method in this embodiment. It should be noted that the technical solution of the second electronic lock processing method belongs to the same concept as the technical solution of the first electronic lock processing method mentioned above. The technical solution of the second electronic lock processing method has not been described in detail. Please refer to the description of the technical solution of the first electronic lock processing method mentioned above.
  • FIG. 6 shows a process flow chart of an electronic lock processing method provided by an embodiment of this specification, which specifically includes the following steps.
  • Step 602 The server receives the user's dynamic password acquisition request for the target electronic lock, where the acquisition request contains online room viewing information associated with the target electronic lock.
  • Step 604 Determine the password group corresponding to the dynamic password based on the online house viewing information, and determine the password configuration information corresponding to the password group.
  • Step 606 Determine the shared key corresponding to the target electronic lock, process the shared key through a key derivation algorithm, and generate a corresponding derived key.
  • Step 608 Determine the current time of the server, and use a time-based one-time password algorithm to process the current time, derived key and password switching cycle of the server to generate an intermediate password, where the length of the intermediate password is consistent with the length of the password. .
  • Step 610 Encode the intermediate password and the group index of the password group using a scrambling algorithm to generate a dynamic password and return it to the user.
  • Step 612 The electronic lock receives the unlocking request submitted by the user, where the unlocking request contains the dynamic password.
  • Step 614 Decode the dynamic password using a descrambling algorithm to generate a group index of the password groups contained in the dynamic password and an intermediate password of the target electronic lock.
  • Step 616 Determine the password configuration information corresponding to the password group according to the group index, and determine the shared key corresponding to the target electronic lock.
  • Step 618 Process the shared key through a key derivation algorithm to generate a corresponding derived key.
  • Step 620 Determine the current time of the electronic lock, and process the current time, derived key and password switching cycle of the electronic lock through a time-based one-time password algorithm to generate a reference password, where the length of the reference password is the same as the password. Same length.
  • Step 622 Compare the reference password with the intermediate password.
  • Step 624 If the comparison is consistent and the dynamic password is determined to meet the corresponding unlocking conditions according to the password policy, the unlocking operation of the target electronic lock is performed.
  • the embodiment of this specification determines whether the intermediate password meets the unlocking conditions by generating a reference password and verifying the intermediate password based on the reference password. Verifying the intermediate password in this way is conducive to ensuring the accuracy of the verification results. , thus helping to improve the safety of electronic locks.
  • Figure 7 shows a schematic structural diagram of a second electronic lock processing device provided by an embodiment of this specification. As shown in Figure 7, the device includes:
  • the receiving module 702 is configured to receive an acquisition request for the dynamic password of the target electronic lock, where the acquisition request includes the lock identification of the target electronic lock and the to-be-processed project information associated with the target electronic lock;
  • the determination module 704 is configured to determine the password group corresponding to the dynamic password based on the item information to be processed, and determine the password configuration information corresponding to the password group;
  • the processing module 706 is configured to determine the shared key corresponding to the target electronic lock according to the lock identification, and generate an intermediate password based on the password configuration information and the shared key;
  • the encoding module 708 is configured to encode the intermediate password and the group index of the password group, generate the dynamic password and return it.
  • the password configuration information includes a password switching period
  • processing module 706 is further configured to:
  • the password configuration information includes password switching period and password length
  • processing module 706 is further configured to:
  • the encoding module 708 is further configured to:
  • the intermediate cipher and the group index of the cipher group are encoded using a scrambling algorithm.
  • the above is a schematic solution of the second electronic lock processing device in this embodiment. It should be noted that the technical solution of the second electronic lock processing device belongs to the same concept as the technical solution of the second electronic lock processing method mentioned above. The technical solution of the second electronic lock processing device has not been described in detail. Please refer to the description of the technical solution of the second electronic lock processing method mentioned above.
  • Figure 8 shows a structural block diagram of a computing device 800 provided according to an embodiment of this specification. This calculation is designed
  • the components of device 800 include, but are not limited to, memory 810 and processor 820.
  • the processor 820 is connected to the memory 810 through a bus 830, and the database 850 is used to save data.
  • Computing device 800 also includes an access device 840 that enables computing device 800 to communicate via one or more networks 860 .
  • networks include the Public Switched Telephone Network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communications networks such as the Internet.
  • Access device 840 may include one or more of any type of network interface (eg, a network interface card (NIC)), wired or wireless, such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, Worldwide Interconnection for Microwave Access ( Wi-MAX) interface, Ethernet interface, Universal Serial Bus (USB) interface, cellular network interface, Bluetooth interface, Near Field Communication (NFC) interface, etc.
  • NIC network interface card
  • the above-mentioned components of the computing device 800 and other components not shown in FIG. 8 may also be connected to each other, such as through a bus. It should be understood that the structural block diagram of the computing device shown in FIG. 8 is for illustrative purposes only and does not limit the scope of this description. Those skilled in the art can add or replace other components as needed.
  • Computing device 800 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet computer, personal digital assistant, laptop computer, notebook computer, netbook, etc.), a mobile telephone (e.g., smartphone ), a wearable computing device (e.g., smart watch, smart glasses, etc.) or other type of mobile device, or a stationary computing device such as a desktop computer or PC.
  • a mobile computer or mobile computing device e.g., tablet computer, personal digital assistant, laptop computer, notebook computer, netbook, etc.
  • a mobile telephone e.g., smartphone
  • a wearable computing device e.g., smart watch, smart glasses, etc.
  • stationary computing device such as a desktop computer or PC.
  • Computing device 800 may also be a mobile or stationary server.
  • the processor 820 is configured to execute the following computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the above electronic lock processing method are implemented.
  • the above is a schematic solution of a computing device in this embodiment. It should be noted that the technical solution of the computing device and the technical solution of the above-mentioned electronic lock processing method belong to the same concept. For details that are not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the above electronic lock processing method. .
  • An embodiment of this specification also provides a computer-readable storage medium that stores computer-executable instructions.
  • the computer-executable instructions are executed by a processor, the steps of the above electronic lock processing method are implemented.
  • the above is a schematic solution of a computer-readable storage medium in this embodiment. It should be noted that the technical solution of the storage medium and the technical solution of the above-mentioned electronic lock processing method belong to the same concept. For details that are not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the above-mentioned electronic lock processing method. .
  • An embodiment of this specification also provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the electronic lock processing method.
  • the computer instructions include computer program code, which may be in the form of source code, object code, executable file or some intermediate form.
  • the computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory) , Random Access Memory (RAM, Random Access Memory), electrical carrier signals, telecommunications signals, and software distribution media, etc.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • electrical carrier signals telecommunications signals
  • software distribution media etc.
  • the content contained in the computer-readable medium can be appropriately added or deleted according to the requirements of legislation and patent practice in the jurisdiction.
  • the computer-readable medium Excludes electrical carrier signals and telecommunications signals.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)
  • Lock And Its Accessories (AREA)

Abstract

一种电子锁处理方法以及装置,电子锁处理方法包括:接收开锁请求(S202),其中,开锁请求中包含动态密码,对动态密码进行解码处理,获得密码分组的分组索引及目标电子锁的中间密码(S204),根据分组索引确定密码分组对应的密码配置信息,并确定目标电子锁对应的共享密钥(S206),对密码配置信息及共享密钥进行处理,生成参考密码,并将参考密码与中间密码进行比对(S208),在比对一致的情况下,执行目标电子锁的开锁操作(S210)。

Description

电子锁处理方法以及装置
本申请要求于2022年05月18日提交中国专利局、申请号为202210542675.3、申请名称为“电子锁处理方法以及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本说明书实施例涉及电子密码锁技术领域,特别涉及电子锁处理方法。
背景技术
随着科技的发展,电子密码锁已经成为了组成公共安全防范系统的重要电子装置。电子密码锁是一种通过密码输入来控制电路或是芯片工作(访问控制系统),从而控制机械开关的闭合,完成开锁、闭锁任务的电子产品。
但是,目前的电子密码锁大多将预先设置好的密码存储于存储器中,当输入的密码与预先设置好的密码一致时完成开锁,由于密码固定,极易被破解,导致密码泄露造成安全问题。因此,亟需一种有效的方法以解决此类问题。
发明内容
有鉴于此,本说明书实施例提供了电子锁处理方法。本说明书一个或者多个实施例同时涉及电子锁处理装置,一种计算设备,一种计算机可读存储介质以及一种计算机程序,以解决现有技术中存在的技术缺陷。
根据本说明书实施例的第一方面,提供了第一种电子锁处理方法,包括:
接收开锁请求,其中,所述开锁请求中包含动态密码;
对所述动态密码进行解码处理,获得密码分组的分组索引及目标电子锁的中间密码;
根据所述分组索引确定所述密码分组对应的密码配置信息,并确定所述目标电子锁对应的共享密钥;
对所述密码配置信息及所述共享密钥进行处理,生成参考密码,并将所述参考密码与所述中间密码进行比对;
在比对一致的情况下,执行所述目标电子锁的开锁操作。
根据本说明书实施例的第二方面,提供了第一种电子锁处理装置,包括:
接收模块,被配置为接收开锁请求,其中,所述开锁请求中包含动态密码;
解码模块,被配置为对所述动态密码进行解码处理,获得密码分组的分组索引及目标电子锁的中间密码;
确定模块,被配置为根据所述分组索引确定所述密码分组对应的密码配置信息,并确定所述目标电子锁对应的共享密钥;
比对模块,被配置为对所述密码配置信息及所述共享密钥进行处理,生成参考密码,并将所述参考密码与所述中间密码进行比对;
开锁模块,被配置为在比对一致的情况下,执行所述目标电子锁的开锁操作。
根据本说明书实施例的第三方面,提供了第二种电子锁处理方法,包括:
接收针对目标电子锁的动态密码获取请求,其中,所述获取请求中包含与所述目标电子锁关联的待处理项目信息;
根据所述待处理项目信息,确定动态密码对应的密码分组,并确定所述密码分组对应的密码配置信息;
确定所述目标电子锁对应的共享密钥,并基于所述密码配置信息及所述共享密钥生成中间密码;
对所述中间密码及所述密码分组的分组索引进行编码处理,生成所述动态密码并返回。
根据本说明书实施例的第四方面,提供了第二种电子锁处理装置,包括:
接收模块,被配置为接收针对目标电子锁的动态密码的获取请求,其中,所述获取请求中包含目标电子锁的锁标识及与所述目标电子锁关联的待处理项目信息;
确定模块,被配置为根据所述待处理项目信息,确定动态密码对应的密码分组,并确定所述密码分组对应的密码配置信息;
处理模块,被配置为根据所述锁标识确定所述目标电子锁对应的共享密钥,并基于所述密码配置信息及所述共享密钥生成中间密码;
编码模块,被配置为对所述中间密码及所述密码分组的分组索引进行编码处理,生成所述动态密码并返回。
根据本说明书实施例的第五方面,提供了一种计算设备,包括:
存储器和处理器;
所述存储器用于存储计算机可执行指令,所述处理器用于执行所述计算机可执行指令实现任意一项所述电子锁处理方法的步骤。
根据本说明书实施例的第六方面,提供了一种计算机可读存储介质,其存储有计算机可执行指令,该指令被处理器执行时实现任意一项所述电子锁处理方法的步骤。
根据本说明书实施例的第七方面,提供了一种计算机程序,其中,当所述计算机程序在计算机中执行时,令计算机执行上述电子锁处理方法的步骤。
本说明书一个实施例通过接收开锁请求,其中,所述开锁请求中包含动态密码,对所述动态密码进行解码处理,获得密码分组的分组索引及目标电子锁的中间密码,根据所述分组索引确定所述密码分组对应的密码配置信息,并确定所述目标电子锁对应的共享密钥, 对所述密码配置信息及所述共享密钥进行处理,生成参考密码,并将所述参考密码与所述中间密码进行比对,在比对一致的情况下,执行所述目标电子锁的开锁操作。
本说明书实施例中,电子锁扩展支持多组动态密码,每组动态密码设置不同密码配置信息,有利于使得该电子锁可满足不同使用场景的需要;另外,通过生成参考密码,并基于参考密码对中间密码进行校验的方式,判断中间密码是否满足开锁条件,通过这种方式对中间密码进行校验,有利于保证校验结果的准确性,从而有利于提高电子锁的安全性。
附图说明
图1是本说明书一个实施例提供的一种电子锁处理过程的架构图;
图2是本说明书一个实施例提供的第一种电子锁处理方法的流程图;
图3是本说明书一个实施例提供的一种电子锁处理过程的示意图;
图4是本说明书一个实施例提供的第一种电子锁处理装置的结构示意图;
图5是本说明书一个实施例提供的第二种电子锁处理方法的流程图;
图6是本说明书一个实施例提供的一种电子锁处理方法的处理过程流程图;
图7是本说明书一个实施例提供的第二种电子锁处理装置的结构示意图;
图8是本说明书一个实施例提供的一种计算设备的结构框图。
具体实施方式
在下面的描述中阐述了很多具体细节以便于充分理解本说明书。但是本说明书能够以很多不同于在此描述的其它方式来实施,本领域技术人员可以在不违背本说明书内涵的情况下做类似推广,因此本说明书不受下面公开的具体实施的限制。
在本说明书一个或多个实施例中使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本说明书一个或多个实施例。在本说明书一个或多个实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本说明书一个或多个实施例中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。
应当理解,尽管在本说明书一个或多个实施例中可能采用术语第一、第二等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本说明书一个或多个实施例范围的情况下,第一也可以被称为第二,类似地,第二也可以被称为第一。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。
首先,对本说明书一个或多个实施例涉及的名词术语进行解释。
动态密码:随着某个因子变化的密码。例如:随时间变化。
安全密码模块:实现密码算法的安全组件,可用以保证密钥的存储和使用的安全性。
密钥派生:使用特定的算法对一个初始密钥进行处理,生成另外一个密钥。算法和初 始密钥相同,派生密钥也相同。
TOTP算法:Time-based One-time Password algorithm,一种基于共享密钥和当前时间计算一次性密码的算法。
随着电子技术的发展,电子门锁的应用越来越广泛,尤其是指纹锁、密码锁等得到了广泛应用。目前在租赁或平时使用过程中,第三人需要在管理员不在时开锁有时成为必要需求。现有技术通常对于电子锁均实现了远程开锁,但大多数通过网络进行远程控制或者通过时间等生成远程开锁码等形成使用密码进行开锁。由于远程网络控制这种需要网络配合,同时需要增加网络组件等,增加了成本。
在本说明书中,提供了电子锁处理方法,本说明书同时涉及电子锁处理装置,一种计算设备,一种计算机可读存储介质,以及一种计算机程序,在下面的实施例中逐一进行详细说明。
图1示出了根据本说明书一个实施例提供的一种电子锁处理过程的架构图,包括:
电子锁、服务端、用户及用户终端。
其中,电子锁和服务端之间共享该电子锁的共享密钥和密码配置信息,并保持时间同步。服务端基于共享密钥、密码配置信息和当前时间生成一个动态密码,并将其发送到授权用户的用户终端;用户取得动态密码后,在电子锁上输入该动态密码尝试开锁;电子锁接收到动态密码后,对该动态密码进行解码,以根据解码结果确定密码配置信息的索引,利用该索引检索对应的密码配置信息,并根据共享密钥、密码配置信息和当前时间生成参考密钥,然后将参考密码与用户输入的动态密码进行比对的方式,对用户输入的动态密码进行校验,若比对失败则拒绝开锁,若比对成功,则根据密码配置信息定义的密码策略决定是否开锁。
本说明书实施例中,一个电子锁上可以同时支持多组动态密码,在电子锁和服务端共享的密码配置信息中预先设定每组密码的变化周期(最大有效期)、密码长度以及密码策略(允许开锁次数、时段等),以利用密码配置信息对用户输入的动态密码进行校验,有利于保证校验结果的准确性,从而有利于提高电子锁的安全性。
图2示出了根据本说明书一个实施例提供的第一种电子锁处理方法的流程图,具体包括以下步骤。
步骤202,接收开锁请求,其中,所述开锁请求中包含动态密码。
具体的,本说明书实施例提供的电子锁处理方法,应用于电子锁,即目标电子锁。用户可通过在电子锁输入动态密码的方式,向电子锁发送开锁请求。
其中,动态密码由服务端生成并返回给用户,且该动态密码为随着某个因子变化的密码,例如,该动态密码可随时间变化。因此,该动态密码中可携带其时效信息,包括但不限于有效时段、有效时长、有效次数等。因此,电子锁接收用户的开锁请求后,即可对该动态密码进行验证,以确定其是否满足开锁条件。
实际应用中,用户在存在对该电子锁进行开锁的需求的情况下,可先向服务端发送该电子锁的动态密码获取请求,其中,该获取请求中包含与该电子锁关联的待处理项目信息,例如看房或租房信息等。
由于服务端中预先存储了多个密码分组,不同密码分组对应不同的密码配置信息,例如,分组索引、密码长度、密码变化周期、密码策略等。
其中,分组索引,例如:电子锁支持100组密码,索引值分别是00~99;
密码变化周期,可以设置各种粒度的周期,例如:1分钟、10分钟、30分钟、1小时、1天、3天、1周、1月、1年等;
密码长度,可以支持各种密码长度,例如:4、6、8、10等;
密码策略,即该分组密码对应的开锁策略,包括密码有效次数、密码有效时段等。例如:限制密码在有效期内单次开锁、动态密码在有效期内验证通过后自动转换成为更长有效期的静态密码等。
另外,由于不同待处理项目对应的动态密码的密码长度或密码有效时长可能会存在差异,而待处理项目包括但不限于网约看房项目、共享单车项目或自助取票项目等共享资源项目,例如,在网约看房项目中,提供动态密码给用户进行看房时,一般设置动态密码单次有效,并且动态密码的长度会相对较短;或者在共享单车项目中,在为用户提供动态密码进行车辆解锁时,可设置动态密码单次或多次有效,动态密码的长度可适当增长,以保证密码复杂度;或者在自助取票项目中,在为用户提供动态密码进行自助取票时,可根据取票结果更新动态密码的使用状态,具体可在检测用户使用动态密码进行取票,但取票结果为取票失败时,仍保持该动态密码的使用状态的有效状态,而在检测到用户的取票结果为取票成功时,将为用户提供的动态密码的有效状态更新为无效状态。
因此,服务端在接收到该动态密码获取请求后,可根据请求中携带的待处理项目的待处理项目信息,确定动态密码对应的密码分组,并确定该密码分组对应的密码配置信息,然后确定该电子锁对应的共享密钥,并基于密码配置信息及共享密钥生成中间密码;再对中间密码及密码分组的分组索引进行编码处理,生成动态密码并通过短消息、业务APP或小程序方式,将动态密码发送到用户的用户终端。
用户在通过用户终端获取该动态密码后,即可通过在电子锁输入动态密码的方式,向电子锁发送开锁请求。
步骤204,对所述动态密码进行解码处理,获得密码分组的分组索引及目标电子锁的中间密码。
具体的,由于服务端通过将密码分组对应的密码配置信息以及该电子锁对应的共享密钥进行处理,生成中间密码;再对中间密码及密码分组的分组索引进行编码处理,生成动态密码,而电子锁在接收到动态密码后,需对动态密码进行验证,具体即需对中间密码进行验证,因此,可先对动态密码进行解码处理,获得动态密码所包含的密码分组的分组索 引及该电子锁的中间密码,然后利用分组索引对该中间密码进行验证,以确定该动态密码是否满足开锁条件。
具体实施时,服务端在对中间密码及密码分组的分组索引进行编码处理时,可使用加扰算法对其进行编码处理,以保证该中间密码的安全性,其中,该加扰算法可以是通用加扰算法CAS(Common Scrambling Algorithm)。
因此,电子锁对所述动态密码进行解码处理,获得密码分组的分组索引及目标电子锁的中间密码,具体可通过解扰算法对所述动态密码进行解码处理,生成所述动态密码包含的密码分组的分组索引,及目标电子锁的中间密码。
具体的,用户在有效期内将动态密码输入到电子锁中,尝试开锁;电子锁接收到用户输入的动态密码后,可使用解扰算法对该动态密码进行解码,以从解码结果中提取出中间密码和密码分组的分组索引,然后通过分组索引对中间密码进行校验。
其中,服务端对中间密码和分组索引进行加扰处理生成动态密码,则电子锁对该动态密码进行解码,则需进行解扰处理,解扰与加扰使用相同的公式,且LFSR使用相同的初始值。因此,若服务端使用通用加扰算法CAS(Common Scrambling Algorithm)对中间密码和分组索引进行加扰处理生成动态密码,则电子锁同样需使用与通用加扰算法同样的公式对动态密码进行解扰处理,但实际应用中,具体使用的加扰解扰算法可根据实际需求确定,在此不做限定。
步骤206,根据所述分组索引确定所述密码分组对应的密码配置信息,并确定所述目标电子锁对应的共享密钥。
具体的,如前所述,服务端中预先存储了多个密码分组,不同密码分组对应不同的密码配置信息,例如,分组索引、分组密码长度、分组密码变化周期、分组密码策略等,另外,服务端中还存储了该电子锁的共享密钥;而服务端中所存储的密码分组、不同密码分组对应的密码配置信息以及该电子锁的共享密钥均与该电子锁同步,即该电子锁中所存储的密码分组、不同密码分组对应的密码配置信息以及该电子锁的共享密钥均与服务端所存储的密码分组、不同密码分组对应的密码配置信息以及该电子锁的共享密钥一致。
因此,电子锁接收到开锁请求后,可对开锁请求中包含的动态密码进行解码处理,获得动态密码包含的密码分组的分组索引以及该电子锁的中间密码,然后根据分组索引确定密码分组,再确定密码分组对应的密码配置信息,以及该电子锁对应的共享密钥,以利用该密码配置信息和共享密钥对用户输入的动态密码进行校验,从而确定是否开锁。
本说明书实施例中,电子锁扩展支持多组动态密码,每组动态密码设置不同密码配置信息,有利于使得该电子锁可满足不同项目或不同使用场景的需要。
具体实施时,电子锁可将其共享密钥存储至安全密码模块,因此,确定所述目标电子锁对应的共享密钥,具体可通过调用安全密码模块,并确定所述安全密码模块存储的、所述目标电子锁对应的共享密钥。
具体的,电子锁中可设置安全密码模块,而安全密码模块可内置该电子锁的共享密钥,其中,共享密钥可以在产线生产安全密码模块时烧录到该安全密码模块中,也可以在电子锁安装环节配置进去;针对具备联网功能的电子锁,还可以在电子锁联网时从服务端拉取该电子锁的共享密钥。
本说明书实施例采用安全密码模块保护电子锁的共享密钥,有利于提高共享密钥的安全性。
步骤208,对所述密码配置信息及所述共享密钥进行处理,生成参考密码,并将所述参考密码与所述中间密码进行比对。
具体的,电子锁在确定其共享密钥,以及密码分组对应的密码配置信息后,可基于该共享密钥以及密码配置信息生成参考密码,其中,参考密码的生成过程,与服务端生成中间密码的过程一致,以基于参考密码对中间密码进行校验,从而判断中间密码是否满足开锁条件,通过这种方式对中间密码进行校验,有利于提高电子锁的安全性。
具体实施时,对所述密码配置信息及所述共享密钥进行处理,生成参考密码,具体可确定当前时间信息,并对所述当前时间信息、所述共享密钥以及所述密码配置信息包含的密码切换周期进行处理,生成参考密码。
具体的,服务端在生成中间密码时,由于其使用的密码配置信息中包含密码切换周期,因此,在生成中间密码时,可先确定当前时间,以基于当前时间、共享密钥以及密码配置信息中的密码切换周期生成中间密码,其中,通过当前时间及密码切换周期即可确定中间密码的切换时间,以使得电子锁可根据该切换时间确定该中间密码是否满足开锁条件,从而提高电子锁的使用安全性。
基于此,电子锁在解码获得密码分组的分组索引,根据分组索引获得该密码分组对应的密码配置信息,并确定目标电子锁对应的共享密钥后,可使用与服务端的中间密码生成过程相似的方式,生成参考密码,具体可先确定当前时间信息,并对所述当前时间信息、所述共享密钥以及所述密码配置信息包含的密码切换周期进行处理,生成参考密码。
其中,电子锁的时间与服务端的时间保持同步,以保证利用电子锁的当前时间信息、共享密钥以及密码配置信息包含的密码切换周期生成的参考密码对中间密码进行校验时,生成的校验结果的准确性。
实际应用中,电子锁的系统时间可以在安装时完成时间校准,针对具备联网功能的电子锁,可以在电子锁联网时与服务端完成时间同步。电子锁中的密码配置信息可以写在电子锁固件中,也可以是在安装时配置或联网时从服务端拉取,具体可根据实际需求确定,在此不做限制。
具体实施时,密码配置信息包括密码切换周期及密码长度;
相应的,所述对所述密码配置信息及所述共享密钥进行处理,生成参考密码,包括:
通过密钥派生算法对所述共享密钥进行处理,生成对应的派生密钥;
确定当前时间信息,并通过基于时间的一次性密码算法,对所述当前时间信息、所述派生密钥以及所述密码切换周期进行处理,生成参考密码,其中,所述参考密码的长度与所述密码长度一致。
具体的,由于服务端预先存储了多个密码分组,不同密码分组对应不同的密码配置信息,例如,分组索引、密码长度、密码变化周期、密码策略等。而由于不同待处理项目信息对应的动态密码的密码长度或密码有效时长可能会存在差异,例如,网约看房项目中,提供动态密码给用户进行看房时,一般设置动态密码单次有效,并且动态密码的长度会相对较短。
因此,服务端在接收到动态密码获取请求后,可根据请求中携带的待处理项目信息,确定动态密码对应的密码分组,并确定该密码分组对应的密码配置信息,然后确定该电子锁对应的共享密钥,并可使用密钥派生算法对共享密钥进行处理,生成一个派生密钥;再确定服务端的当前时间,以通过基于时间的一次性密码算法(TOTP算法)对当前时间、派生密钥以及密码配置信息中的密码切换周期进行处理,生成中间密码,其中,该中间密码的长度即与该密码配置信息中的密码长度一致。
基于此,电子锁若需生成参考密码,并利用该参考密码对用户输入的中间密码进行校验,则需使用与生成中间密码同样的方式生成参考密码,具体即确定共享密钥以及密码配置信息后,即可通过密钥派生算法对共享密钥进行处理,生成派生密钥,然后确定电子锁的当前时间,并通过TOTP算法对当前时间、派生密钥以及密码配置信息中的密码切换周期进行处理,生成参考密码,其中,参考密码的长度与该密码配置信息中的密码长度一致,以利用该参考密码对用户输入的中间密码进行校验。
其中,本说明书实施例的密钥派生算法可以是PBKDF2(password-base KDF)或Scrypt(一种password-base KDF算法)这两种密钥派生算法,但具体可根据实际需求确定,在此不做限制。
本说明书实施例利用密钥派生算法对共享密钥进行处理,生成派生密钥,并基于派生密钥生成参考密码或中间密码,有利于增加参考密码或中间密码的破解难度,从而有利于降低共享密钥泄露的概率,以保证密码或电子锁的安全性。
步骤210,在比对一致的情况下,执行所述目标电子锁的开锁操作。
具体的,电子锁在将参考密码与中间密码进行比对,并在确定二者比对一致的情况下,即确定该中间密码或该动态密码满足开锁条件,因此,可执行该电子锁的开锁操作;而在确定二者比对不一致的情况下,即确定该中间密码或该动态密码不满足开锁条件,因此,不执行该电子锁的开锁操作。
具体实施时,由于电子锁存储多个密码分组,且不同密码分组对应不同的密码配置信息,例如,分组索引、密码长度、密码变化周期、密码策略等。因此,在基于不同密码分组对应的密码配置信息生成中间密码时,该中间密码则具有对应的密码策略,该密码策略 可以包括密码有效次数、密码有效时段等,因此,若确定参考密码与中间密码比对一致,在执行目标电子锁的开锁操作之前,还需根据所述密码策略确定所述动态密码是否满足对应的开锁条件;若是,则执行所述目标电子锁的开锁操作。
具体的,由于中间密码对应一定的密码策略,而该密码策略可以包括密码有效次数、密码有效时段等,因此,即使确定参考密码与中间密码比对一致,但在执行电子锁的开锁操作前,还需利用该中间密码对应的密码策略,对该中间密码进行进一步的验证,以确定其是否满足开锁条件,若满足,则可执行电子锁的开锁操作,若不满足,则不执行该电子锁的开锁操作。
通过这种方式对中间密码进行二次校验,有利于更进一步的确保中间密码的有效性,从而有利于保证电子锁的使用安全性。
进一步的,若密码策略中包含密码有效时段,则根据所述密码策略确定所述动态密码是否满足对应的开锁条件,包括:
确定所述开锁请求的接收时间,并确定所述接收时间是否属于所述密码有效时段;
若是,则确定所述动态密码满足对应的开锁条件。
或者,若密码策略中包含密码有效次数,则根据所述密码策略确定所述动态密码是否满足对应的开锁条件,包括:
确定所述动态密码的接收次数,并确定所述接收次数是否小于所述密码有效次数;
若是,则确定所述动态密码满足对应的开锁条件。
具体的,如前所述,中间密码对应一定的密码策略,而该密码策略可以包括密码有效次数、密码有效时段等,在密码策略中包含密码有效时段的情况下,即表征该动态密码仅在固定时段输入才有效,即用户在固定时段内将动态密码输入电子锁,才视为该动态密码有效,然后可触发电子锁执行开锁操作。因此,在确定参考密码与动态密码比对一致的情况下,可进一步确定开锁请求的接收时间,即确定动态密码或中间密码的接收时间,然后确定该接收时间是否属于该动态密码对应密码策略中包含的密码有效时段,若属于,则确定该动态密码满足对应的开锁条件,因此可触发电子锁的开锁操作。
或者,在密码策略中包含密码有效次数的情况下,即表征该动态密码存在有效的使用次数,例如,若密码有效次数等于3,则表征用户可使用该动态密码对电子锁成功开锁3次,在用户第四次将该动态密码输入电子锁,则无法成功开锁。因此,在确定参考密码与动态密码比对一致的情况下,可进一步确定电子锁在历史时间内接收到该动态密码并成功开锁的次数,并确定该次数是否小于该动态密码对应密码策略中包含的密码有效次数,若小于,则确定该动态密码满足对应的开锁条件,因此可触发电子锁的开锁操作。
本说明书实施例通过这种方式对中间密码进行二次校验,有利于更进一步的确保中间密码的有效性,从而有利于保证电子锁的使用安全性。
另外,本说明书实施例中,电子锁中不同密码分组对应的密码配置信息中可包含密码策略,而该密码策略除可限制动态密码在有效期内开锁,或可限制动态密码的有效开锁次数外,还可设置动态密码在有效期内验证通过后,可自动转换成为更长有效期的静态密码等,具体可根据实际需求确定,在此不做限制。
本说明书提供一种利用动态密码对电子锁进行开锁的方案,该电子锁支持多组动态密码,工作过程中无需联网,适用于无网或弱网的共享资源项目。此外,本说明书实施例采用安全密码模块保护该电子锁的共享密钥,有利于保证其安全性。
本说明书实施例提供的一种电子锁处理过程的示意图如图3所示。
其中,电子锁和服务端之间共享该电子锁的共享密钥和密码配置信息,并保持时间同步。服务端利用密钥派生算法对电子锁的共享密钥进行处理,生成派生密钥,然后利用TOTP算法对派生密钥、当前时间以及密码配置信息中的变化周期进行处理,生成一个中间密码,再对中间密码以及该密码配置信息所述密码分组对应的分组标识进行加扰编码,生成动态密码,并将其发送到授权用户的用户终端。
用户取得该动态密码后,在电子锁上输入该动态密码尝试开锁;电子锁接收到动态密码后,对该动态密码进行加扰解码,以基于解码结果提取中间密码以及分组索引,再利用该分组索引检索对应密码分组的密码配置信息,然后在安全密码模块中获取电子锁的共享密钥,并利用密钥派生算法对该共享密钥进行处理,生成派生密钥,接着利用TOTP算法对派生密钥、当前时间和密码配置信息中的变化周期进行处理生成参考密码(电子锁端的中间密码),最后将参考密码与解码获得的中间密码进行比对的方式,对用户输入的动态密码进行校验,若比对失败则拒绝开锁,若比对成功,则根据密码配置信息定义的密码策略决定是否开锁。
本说明书一个实施例通过接收开锁请求,其中,所述开锁请求中包含动态密码,对所述动态密码进行解码处理,获得密码分组的分组索引及目标电子锁的中间密码,根据所述分组索引确定所述密码分组对应的密码配置信息,并确定所述目标电子锁对应的共享密钥,对所述密码配置信息及所述共享密钥进行处理,生成参考密码,并将所述参考密码与所述中间密码进行比对,在比对一致的情况下,执行所述目标电子锁的开锁操作。
本说明书实施例中,电子锁扩展支持多组动态密码,每组动态密码设置不同密码配置信息,有利于使得该电子锁可满足不同项目或不同使用场景的需要;另外,通过生成参考密码,并基于参考密码对中间密码进行校验的方式,判断中间密码是否满足开锁条件,通过这种方式对中间密码进行校验,有利于保证校验结果的准确性,从而有利于提高电子锁的安全性。
与上述方法实施例相对应,本说明书还提供了电子锁处理装置实施例,图4示出了本说明书一个实施例提供的第一种电子锁处理装置的结构示意图。如图4所示,该装置包括:
接收模块402,被配置为接收开锁请求,其中,所述开锁请求中包含动态密码;
解码模块404,被配置为对所述动态密码进行解码处理,获得密码分组的分组索引及目标电子锁的中间密码;
确定模块406,被配置为根据所述分组索引确定所述密码分组对应的密码配置信息,并确定所述目标电子锁对应的共享密钥;
比对模块408,被配置为对所述密码配置信息及所述共享密钥进行处理,生成参考密码,并将所述参考密码与所述中间密码进行比对;
开锁模块410,被配置为在比对一致的情况下,执行所述目标电子锁的开锁操作。
可选地,所述解码模块404,进一步被配置为:
通过解扰算法对所述动态密码进行解码处理,生成所述动态密码包含的密码分组的分组索引,及目标电子锁的中间密码。
可选地,所述比对模块408,进一步被配置为:
确定当前时间信息,并对所述当前时间信息、所述共享密钥以及所述密码配置信息包含的密码切换周期进行处理,生成参考密码。
可选地,所述密码配置信息包括密码切换周期及密码长度;
相应的,所述比对模块408,进一步被配置为:
通过密钥派生算法对所述共享密钥进行处理,生成对应的派生密钥;
确定当前时间信息,并通过基于时间的一次性密码算法,对所述当前时间信息、所述派生密钥以及所述密码切换周期进行处理,生成参考密码,其中,所述参考密码的长度与所述密码长度一致。
可选地,所述密码配置信息中包含密码策略;
相应的,所述开锁模块410,还被配置为:
根据所述密码策略确定所述动态密码是否满足对应的开锁条件;
若是,则执行所述目标电子锁的开锁操作。
可选地,所述密码策略中包含密码有效时段;
相应的,所述开锁模块410,进一步被配置为:
确定所述开锁请求的接收时间,并确定所述接收时间是否属于所述密码有效时段;
若是,则确定所述动态密码满足对应的开锁条件。
可选地,所述密码策略中包含密码有效次数;
相应的,所述开锁模块410,进一步被配置为:
确定所述动态密码的接收次数,并确定所述接收次数是否小于所述密码有效次数;
若是,则确定所述动态密码满足对应的开锁条件。
可选地,所述确定模块406,进一步被配置为:
调用安全密码模块,并确定所述安全密码模块存储的、所述目标电子锁对应的共享密钥。
上述为本实施例的第一种电子锁处理装置的示意性方案。需要说明的是,该第一种电子锁处理装置的技术方案与上述的第一种电子锁处理方法的技术方案属于同一构思,第一种电子锁处理装置的技术方案未详细描述的细节内容,均可以参见上述第一种电子锁处理方法的技术方案的描述。
图5示出了根据本说明书一个实施例提供的第二种电子锁处理方法的流程图,具体包括以下步骤。
步骤502,接收针对目标电子锁的动态密码获取请求,其中,所述获取请求中包含与所述目标电子锁关联的待处理项目信息。
步骤504,根据所述待处理项目信息,确定所述动态密码对应的密码分组,并确定所述密码分组对应的密码配置信息。
步骤506,确定所述目标电子锁对应的共享密钥,并基于所述密码配置信息及所述共享密钥生成中间密码。
可选地,所述密码配置信息包括密码切换周期;
相应的,所述基于所述密码配置信息及所述共享密钥生成中间密码,包括:
确定当前时间信息,并对所述当前时间信息、所述共享密钥以及所述密码切换周期进行处理,生成中间密码。
可选地,所述密码配置信息包括密码切换周期及密码长度;
相应的,所述基于所述密码配置信息及所述共享密钥生成中间密码,包括:
通过密钥派生算法对所述共享密钥进行处理,生成对应的派生密钥;
确定当前时间信息,并通过基于时间的一次性密码算法,对所述当前时间信息、所述派生密钥以及所述密码切换周期进行处理,生成中间密码,其中,所述中间密码的长度与所述密码长度一致。
步骤508,对所述中间密码及所述密码分组的分组索引进行编码处理,生成所述动态密码并返回。
可选地,所述对所述中间密码及所述密码分组的分组索引进行编码处理,包括:
通过加扰算法对所述中间密码及所述密码分组的分组索引进行编码处理。
本说明书一个实施例通过接收针对目标电子锁的动态密码获取请求,其中,所述获取请求中包含与所述目标电子锁关联的待处理项目信息,根据所述待处理项目信息,确定动态密码对应的密码分组,并确定所述密码分组对应的密码配置信息,确定所述目标电子锁对应的共享密钥,并基于所述密码配置信息及所述共享密钥生成中间密码,对所述中间密码及所述密码分组的分组索引进行编码处理,生成所述动态密码并返回。
本说明书实施例中,电子锁扩展支持多组动态密码,每组动态密码设置不同密码配置信息,有利于使得该电子锁可满足不同使用场景的需要。另外,在对中间密码及密码分组的分组索引进行编码处理时,可使用加扰算法对其进行编码处理,以保证该中间密码的安全性。利用密钥派生算法对共享密钥进行处理,生成派生密钥,并基于派生密钥生成参考密码或中间密码,有利于增加参考密码或中间密码的破解难度,从而有利于降低共享密钥泄露的概率,以保证密码或电子锁的安全性。
上述为本实施例的第二种电子锁处理方法的示意性方案。需要说明的是,该第二种电子锁处理方法的技术方案与上述的第一种电子锁处理方法的技术方案属于同一构思,第二种电子锁处理方法的技术方案未详细描述的细节内容,均可以参见上述第一种电子锁处理方法的技术方案的描述。
下述结合附图6,以本说明书提供的电子锁处理方法在网约看房项目的应用为例,对所述电子锁处理方法进行进一步说明。其中,图6示出了本说明书一个实施例提供的一种电子锁处理方法的处理过程流程图,具体包括以下步骤。
步骤602,服务端接收用户针对目标电子锁的动态密码获取请求,其中,获取请求中包含与目标电子锁关联的网约看房信息。
步骤604,根据网约看房信息,确定动态密码对应的密码分组,并确定密码分组对应的密码配置信息。
步骤606,确定目标电子锁对应的共享密钥,通过密钥派生算法对共享密钥进行处理,生成对应的派生密钥。
步骤608,确定服务端的当前时间,并通过基于时间的一次性密码算法,对服务端的当前时间、派生密钥以及密码切换周期进行处理,生成中间密码,其中,中间密码的长度与该密码长度一致。
步骤610,通过加扰算法对中间密码及密码分组的分组索引进行编码处理,生成动态密码并返回至用户。
步骤612,电子锁接收用户提交的开锁请求,其中,开锁请求中包含动态密码。
步骤614,通过解扰算法对动态密码进行解码处理,生成动态密码包含的密码分组的分组索引,及目标电子锁的中间密码。
步骤616,根据分组索引确定密码分组对应的密码配置信息,并确定目标电子锁对应的共享密钥。
步骤618,通过密钥派生算法对共享密钥进行处理,生成对应的派生密钥。
步骤620,确定电子锁的当前时间,并通过基于时间的一次性密码算法,对电子锁的当前时间、派生密钥以及密码切换周期进行处理,生成参考密码,其中,参考密码的长度与该密码长度一致。
步骤622,将参考密码与中间密码进行比对。
步骤624,在比对一致,并在根据密码策略确定动态密码满足对应的开锁条件的情况下,执行目标电子锁的开锁操作。
本说明书实施例通过生成参考密码,并基于参考密码对中间密码进行校验的方式,判断中间密码是否满足开锁条件,通过这种方式对中间密码进行校验,有利于保证校验结果的准确性,从而有利于提高电子锁的安全性。
与上述方法实施例相对应,本说明书还提供了电子锁处理装置实施例,图7示出了本说明书一个实施例提供的第二种电子锁处理装置的结构示意图。如图7所示,该装置包括:
接收模块702,被配置为接收针对目标电子锁的动态密码的获取请求,其中,所述获取请求中包含目标电子锁的锁标识及与所述目标电子锁关联的待处理项目信息;
确定模块704,被配置为根据所述待处理项目信息,确定动态密码对应的密码分组,并确定所述密码分组对应的密码配置信息;
处理模块706,被配置为根据所述锁标识确定所述目标电子锁对应的共享密钥,并基于所述密码配置信息及所述共享密钥生成中间密码;
编码模块708,被配置为对所述中间密码及所述密码分组的分组索引进行编码处理,生成所述动态密码并返回。
可选地,所述密码配置信息包括密码切换周期;
相应的,所述处理模块706,进一步被配置为:
确定当前时间信息,并对所述当前时间信息、所述共享密钥以及所述密码切换周期进行处理,生成中间密码。
可选地,所述密码配置信息包括密码切换周期及密码长度;
相应的,所述处理模块706,进一步被配置为:
通过密钥派生算法对所述共享密钥进行处理,生成对应的派生密钥;
确定当前时间信息,并通过基于时间的一次性密码算法,对所述当前时间信息、所述派生密钥以及所述密码切换周期进行处理,生成中间密码,其中,所述中间密码的长度与所述密码长度一致。
可选地,所述编码模块708,进一步被配置为:
通过加扰算法对所述中间密码及所述密码分组的分组索引进行编码处理。
上述为本实施例的第二种电子锁处理装置的示意性方案。需要说明的是,该第二种电子锁处理装置的技术方案与上述的第二种电子锁处理方法的技术方案属于同一构思,第二种电子锁处理装置的技术方案未详细描述的细节内容,均可以参见上述第二种电子锁处理方法的技术方案的描述。
图8示出了根据本说明书一个实施例提供的一种计算设备800的结构框图。该计算设 备800的部件包括但不限于存储器810和处理器820。处理器820与存储器810通过总线830相连接,数据库850用于保存数据。
计算设备800还包括接入设备840,接入设备840使得计算设备800能够经由一个或多个网络860通信。这些网络的示例包括公用交换电话网(PSTN)、局域网(LAN)、广域网(WAN)、个域网(PAN)或诸如因特网的通信网络的组合。接入设备840可以包括有线或无线的任何类型的网络接口(例如,网络接口卡(NIC))中的一个或多个,诸如IEEE802.11无线局域网(WLAN)无线接口、全球微波互联接入(Wi-MAX)接口、以太网接口、通用串行总线(USB)接口、蜂窝网络接口、蓝牙接口、近场通信(NFC)接口,等等。
在本说明书的一个实施例中,计算设备800的上述部件以及图8中未示出的其他部件也可以彼此相连接,例如通过总线。应当理解,图8所示的计算设备结构框图仅仅是出于示例的目的,而不是对本说明书范围的限制。本领域技术人员可以根据需要,增添或替换其他部件。
计算设备800可以是任何类型的静止或移动计算设备,包括移动计算机或移动计算设备(例如,平板计算机、个人数字助理、膝上型计算机、笔记本计算机、上网本等)、移动电话(例如,智能手机)、可佩戴的计算设备(例如,智能手表、智能眼镜等)或其他类型的移动设备,或者诸如台式计算机或PC的静止计算设备。计算设备800还可以是移动式或静止式的服务器。
其中,处理器820用于执行如下计算机可执行指令,该计算机可执行指令被处理器执行时实现上述电子锁处理方法的步骤。
上述为本实施例的一种计算设备的示意性方案。需要说明的是,该计算设备的技术方案与上述的电子锁处理方法的技术方案属于同一构思,计算设备的技术方案未详细描述的细节内容,均可以参见上述电子锁处理方法的技术方案的描述。
本说明书一实施例还提供一种计算机可读存储介质,其存储有计算机可执行指令,该计算机可执行指令被处理器执行时实现上述电子锁处理方法的步骤。
上述为本实施例的一种计算机可读存储介质的示意性方案。需要说明的是,该存储介质的技术方案与上述的电子锁处理方法的技术方案属于同一构思,存储介质的技术方案未详细描述的细节内容,均可以参见上述电子锁处理方法的技术方案的描述。
本说明书一实施例还提供一种计算机程序,其中,当所述计算机程序在计算机中执行时,令计算机执行上述电子锁处理方法的步骤。
上述为本实施例的一种计算机程序的示意性方案。需要说明的是,该计算机程序的技术方案与上述的电子锁处理方法的技术方案属于同一构思,计算机程序的技术方案未详细描述的细节内容,均可以参见上述电子锁处理方法的技术方案的描述。
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在 一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。
所述计算机指令包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括电载波信号和电信信号。
需要说明的是,对于前述的各方法实施例,为了简便描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本说明书实施例并不受所描述的动作顺序的限制,因为依据本说明书实施例,某些步骤可以采用其它顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定都是本说明书实施例所必须的。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其它实施例的相关描述。
以上公开的本说明书优选实施例只是用于帮助阐述本说明书。可选实施例并没有详尽叙述所有的细节,也不限制该发明仅为所述的具体实施方式。显然,根据本说明书实施例的内容,可作很多的修改和变化。本说明书选取并具体描述这些实施例,是为了更好地解释本说明书实施例的原理和实际应用,从而使所属技术领域技术人员能很好地理解和利用本说明书。本说明书仅受权利要求书及其全部范围和等效物的限制。

Claims (14)

  1. 一种电子锁处理方法,包括:
    接收开锁请求,其中,所述开锁请求中包含动态密码;
    对所述动态密码进行解码处理,获得密码分组的分组索引及目标电子锁的中间密码;
    根据所述分组索引确定所述密码分组对应的密码配置信息,并确定所述目标电子锁对应的共享密钥;
    对所述密码配置信息及所述共享密钥进行处理,生成参考密码,并将所述参考密码与所述中间密码进行比对;
    在比对一致的情况下,执行所述目标电子锁的开锁操作。
  2. 根据权利要求1所述的电子锁处理方法,所述对所述密码配置信息及所述共享密钥进行处理,生成参考密码,包括:
    确定当前时间信息,并对所述当前时间信息、所述共享密钥以及所述密码配置信息包含的密码切换周期进行处理,生成参考密码。
  3. 根据权利要求1所述的电子锁处理方法,所述密码配置信息中包含密码策略;
    相应的,所述执行所述目标电子锁的开锁操作之前,还包括:
    根据所述密码策略确定所述动态密码是否满足对应的开锁条件;
    若是,则执行所述目标电子锁的开锁操作。
  4. 根据权利要求3所述的电子锁处理方法,所述密码策略中包含密码有效时段;
    相应的,所述根据所述密码策略确定所述动态密码是否满足对应的开锁条件,包括:
    确定所述开锁请求的接收时间,并确定所述接收时间是否属于所述密码有效时段;
    若是,则确定所述动态密码满足对应的开锁条件。
  5. 根据权利要求3所述的电子锁处理方法,所述密码策略中包含密码有效次数;
    相应的,所述根据所述密码策略确定所述动态密码是否满足对应的开锁条件,包括:
    确定所述动态密码的接收次数,并确定所述接收次数是否小于所述密码有效次数;
    若是,则确定所述动态密码满足对应的开锁条件。
  6. 根据权利要求1所述的电子锁处理方法,所述确定所述目标电子锁对应的共享密钥,包括:
    调用安全密码模块,并确定所述安全密码模块存储的、所述目标电子锁对应的共享密钥。
  7. 根据权利要求1所述的电子锁处理方法,所述对所述动态密码进行解码处理,获得密码分组的分组索引及目标电子锁的中间密码,包括:
    通过解扰算法对所述动态密码进行解码处理,生成所述动态密码包含的密码分组的分组索引,及目标电子锁的中间密码。
  8. 根据权利要求1所述的电子锁处理方法,所述密码配置信息包括密码切换周期及密码长度;
    相应的,所述对所述密码配置信息及所述共享密钥进行处理,生成参考密码,包括:
    通过密钥派生算法对所述共享密钥进行处理,生成对应的派生密钥;
    确定当前时间信息,并通过基于时间的一次性密码算法,对所述当前时间信息、所述派生密钥以及所述密码切换周期进行处理,生成参考密码,其中,所述参考密码的长度与所述密码长度一致。
  9. 一种电子锁处理方法,包括:
    接收针对目标电子锁的动态密码获取请求,其中,所述获取请求中包含与所述目标电子锁关联的待处理项目信息;
    根据所述待处理项目信息,确定动态密码对应的密码分组,并确定所述密码分组对应的密码配置信息;
    确定所述目标电子锁对应的共享密钥,并基于所述密码配置信息及所述共享密钥生成中间密码;
    对所述中间密码及所述密码分组的分组索引进行编码处理,生成所述动态密码并返回。
  10. 根据权利要求9所述的电子锁处理方法,所述密码配置信息包括密码切换周期;
    相应的,所述基于所述密码配置信息及所述共享密钥生成中间密码,包括:
    确定当前时间信息,并对所述当前时间信息、所述共享密钥以及所述密码切换周期进行处理,生成中间密码。
  11. 根据权利要求9所述的电子锁处理方法,所述密码配置信息包括密码切换周期及密码长度;
    相应的,所述基于所述密码配置信息及所述共享密钥生成中间密码,包括:
    通过密钥派生算法对所述共享密钥进行处理,生成对应的派生密钥;
    确定当前时间信息,并通过基于时间的一次性密码算法,对所述当前时间信息、所述派生密钥以及所述密码切换周期进行处理,生成中间密码,其中,所述中间密码的长度与所述密码长度一致。
  12. 根据权利要求9所述的电子锁处理方法,所述对所述中间密码及所述密码分组的分组索引进行编码处理,包括:
    通过加扰算法对所述中间密码及所述密码分组的分组索引进行编码处理。
  13. 一种计算设备,包括:
    存储器和处理器;
    所述存储器用于存储计算机可执行指令,所述处理器用于执行所述计算机可执行指令,该计算机可执行指令被处理器执行时实现权利要求1至12任意一项所述电子锁处理方法的步骤。
  14. 一种计算机可读存储介质,其存储有计算机可执行指令,该计算机可执行指令被处理器执行时实现权利要求1至12任意一项所述电子锁处理方法的步骤。
PCT/CN2023/094371 2022-05-18 2023-05-15 电子锁处理方法以及装置 WO2023221950A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210542675.3 2022-05-18
CN202210542675.3A CN115147960A (zh) 2022-05-18 2022-05-18 电子锁处理方法以及装置

Publications (1)

Publication Number Publication Date
WO2023221950A1 true WO2023221950A1 (zh) 2023-11-23

Family

ID=83405840

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/094371 WO2023221950A1 (zh) 2022-05-18 2023-05-15 电子锁处理方法以及装置

Country Status (2)

Country Link
CN (1) CN115147960A (zh)
WO (1) WO2023221950A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115147960A (zh) * 2022-05-18 2022-10-04 阿里云计算有限公司 电子锁处理方法以及装置

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101294463A (zh) * 2008-06-18 2008-10-29 大连交通大学 基于电子密码锁的动态加密和开启方法
EP3125201A1 (fr) * 2015-07-29 2017-02-01 Docapost Iot Procede de commande d'ouverture d'une serrure par code a usage unique
CN107301697A (zh) * 2017-05-09 2017-10-27 南昌大学 一种电子锁的动态加密和定位方法
US20190172285A1 (en) * 2017-08-14 2019-06-06 Q & K International Group Limited Application Method of Bluetooth Low-energy Electronic Lock Based on Built-in Offline Pairing Passwords, Interactive Unlocking Method of a Bluetooth Electronic Lock and Electronic Lock System
CN112184967A (zh) * 2020-10-16 2021-01-05 云南电网有限责任公司丽江供电局 一种配电网箱开锁方法及系统
CN112863017A (zh) * 2021-02-02 2021-05-28 厦门立林科技有限公司 一种智慧社区楼宇对讲系统动态密码开锁装置、方法、设备及存储介质
CN113470229A (zh) * 2021-07-19 2021-10-01 启北公司 开锁控制方法及装置、设备及存储介质
CN114333115A (zh) * 2021-12-29 2022-04-12 广州商景网络科技有限公司 基于动态密码的解锁方法及装置、电子锁装置及控制系统
CN115147960A (zh) * 2022-05-18 2022-10-04 阿里云计算有限公司 电子锁处理方法以及装置

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106952378A (zh) * 2017-04-11 2017-07-14 徐士兰 开锁方法及装置、电子锁
KR101998249B1 (ko) * 2017-05-12 2019-07-10 주식회사 라온익스 도어의 보안을 위한 방법 및 그 전자 기기
CN110163995B (zh) * 2018-02-12 2021-04-30 天扬精密科技股份有限公司 遥控电子锁系统
CN109300211A (zh) * 2018-09-21 2019-02-01 腾讯科技(深圳)有限公司 一种门禁控制方法、装置及系统
CN110400405B (zh) * 2019-07-29 2021-10-26 北京小米移动软件有限公司 一种控制门禁的方法、装置及介质
CN112598827B (zh) * 2020-12-25 2023-01-20 北京智芯微电子科技有限公司 智能锁认证方法、安全芯片、智能锁及其管理系统
CN112750242A (zh) * 2021-01-25 2021-05-04 广州畅联信息科技有限公司 一种动态密码锁开锁方法、系统及动态密码锁电路
CN114117376B (zh) * 2022-01-28 2022-04-15 蘑菇物联技术(深圳)有限公司 身份认证的方法、分配动态密码的方法及相应的设备

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101294463A (zh) * 2008-06-18 2008-10-29 大连交通大学 基于电子密码锁的动态加密和开启方法
EP3125201A1 (fr) * 2015-07-29 2017-02-01 Docapost Iot Procede de commande d'ouverture d'une serrure par code a usage unique
CN107301697A (zh) * 2017-05-09 2017-10-27 南昌大学 一种电子锁的动态加密和定位方法
US20190172285A1 (en) * 2017-08-14 2019-06-06 Q & K International Group Limited Application Method of Bluetooth Low-energy Electronic Lock Based on Built-in Offline Pairing Passwords, Interactive Unlocking Method of a Bluetooth Electronic Lock and Electronic Lock System
CN112184967A (zh) * 2020-10-16 2021-01-05 云南电网有限责任公司丽江供电局 一种配电网箱开锁方法及系统
CN112863017A (zh) * 2021-02-02 2021-05-28 厦门立林科技有限公司 一种智慧社区楼宇对讲系统动态密码开锁装置、方法、设备及存储介质
CN113470229A (zh) * 2021-07-19 2021-10-01 启北公司 开锁控制方法及装置、设备及存储介质
CN114333115A (zh) * 2021-12-29 2022-04-12 广州商景网络科技有限公司 基于动态密码的解锁方法及装置、电子锁装置及控制系统
CN115147960A (zh) * 2022-05-18 2022-10-04 阿里云计算有限公司 电子锁处理方法以及装置

Also Published As

Publication number Publication date
CN115147960A (zh) 2022-10-04

Similar Documents

Publication Publication Date Title
US9525549B2 (en) Method and apparatus for securing a mobile application
US20180329676A1 (en) Access control and validation using sonic tones
US8606234B2 (en) Methods and apparatus for provisioning devices with secrets
WO2016086584A1 (zh) 一种解锁管理权限的方法和认证设备
US7529371B2 (en) Replaceable sequenced one-time pads for detection of cloned service client
CN106952378A (zh) 开锁方法及装置、电子锁
JP2019508972A (ja) パスワードなしのコンピュータログインのサービス支援モバイルペアリングのためのシステム及び方法
US9639692B1 (en) Dynamic on-device passcodes to lock lost or stolen devices
CN110322599B (zh) 门锁管理方法、装置、电子设备及存储介质
EP3398289B1 (en) A method, system and apparatus using forward-secure cryptography for passcode verification
WO2023221950A1 (zh) 电子锁处理方法以及装置
US9455985B2 (en) Method for secure key injection with biometric sensors
CN107710677B (zh) 信息处理装置、信息处理方法、程序、信息处理系统和通信装置
EP2828786A1 (en) Offline authentication with embedded authorization attributes
CN108447154A (zh) 安全解锁方法及装置、加解密方法及装置、锁及服务器
US20210281403A1 (en) System and methods for encryption based on environmental factors
CN110519056B (zh) 一种登录方法、密码生成方法、及其相关装置
CN106600775A (zh) 一种应用于智能门禁系统的不联网动态密码生成方法
CN104580260A (zh) 一种适用于物联网智能终端的安全方法
US20110128119A1 (en) Unlocking a locked user device using a computer generated unlock code provided by a user
CN108510635A (zh) 一种基于光感识别的智能锁系统及其开锁方法
CN115348037A (zh) 一种终端设备的身份认证方法、装置和设备
US20210377732A1 (en) Techniques for secure authentication of the controlled devices
US20160300416A1 (en) Electronic Lock and Verification Method for Unlocking the Same
CN116776346B (zh) 一种数据安全管理系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23806902

Country of ref document: EP

Kind code of ref document: A1