CN113726508B - 一种用于无人仓离线智能锁的totp算法及系统 - Google Patents

一种用于无人仓离线智能锁的totp算法及系统 Download PDF

Info

Publication number
CN113726508B
CN113726508B CN202111002584.2A CN202111002584A CN113726508B CN 113726508 B CN113726508 B CN 113726508B CN 202111002584 A CN202111002584 A CN 202111002584A CN 113726508 B CN113726508 B CN 113726508B
Authority
CN
China
Prior art keywords
control system
module
intelligent lock
password
time
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
CN202111002584.2A
Other languages
English (en)
Other versions
CN113726508A (zh
Inventor
辛锋
高彦龙
高国中
刘静斐
谷禹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Borui Xianglun Technology Development Co Ltd
Original Assignee
Beijing Borui Xianglun Technology Development 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 Beijing Borui Xianglun Technology Development Co Ltd filed Critical Beijing Borui Xianglun Technology Development Co Ltd
Priority to CN202111002584.2A priority Critical patent/CN113726508B/zh
Publication of CN113726508A publication Critical patent/CN113726508A/zh
Application granted granted Critical
Publication of CN113726508B publication Critical patent/CN113726508B/zh
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/0863Generation of secret information including derivation or calculation of cryptographic keys or passwords involving passwords or one-time passwords
    • 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
    • GPHYSICS
    • G08SIGNALLING
    • G08BSIGNALLING OR CALLING SYSTEMS; ORDER TELEGRAPHS; ALARM SYSTEMS
    • G08B21/00Alarms responsive to a single specified undesired or abnormal condition and not otherwise provided for
    • G08B21/18Status alarms
    • G08B21/185Electrical failure alarms
    • 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/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3297Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving time stamps, e.g. generation of time stamps
    • 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/00412Electronically 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 being encrypted
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Power Engineering (AREA)
  • Business, Economics & Management (AREA)
  • Emergency Management (AREA)
  • Lock And Its Accessories (AREA)

Abstract

本发明涉及智能锁的技术领域,特别是涉及一种用于无人仓离线智能锁的TOTP算法及系统,其安全性能高,稳定性好;包括智能锁中预设有唯一防伪编号,将设备编号同步到控制系统中,控制系统中预设加密密钥,控制系统中设定动态码有效时间,控制器加密密钥、智能锁防伪编号和对应时间戳通过哈希函数生成一次性密码,控制系统通过互联网与手机APP同步连接传输,包括如下步骤:步骤1、锁体控制系统接收用户的开锁请求,加密密钥、时间戳以防伪编号通过哈希函数生成一次性动态密码,动态密码通过控制系统由互联网同步到用户手机APP。

Description

一种用于无人仓离线智能锁的TOTP算法及系统
技术领域
本发明涉及智能锁的技术领域,特别是涉及一种用于无人仓离线智能锁的TOTP算法及系统。
背景技术
TOTP算法(Time-based One-time Password algorithm)是一种从共享密钥和当前时间计算一次性密码的算法。它已被采纳为Internet工程任务组标准RFC 6238,是Initiative for Open Authentication(OATH)的基石,并被用于许多双因素身份验证系统。
TOTP是基于散列的消息认证码(HMAC)的示例。它使用加密哈希函数将密钥与当前时间戳组合在一起以生成一次性密码。由于网络延迟和不同步时钟可能导致密码接收者必须尝试一系列可能的时间来进行身份验证,因此时间戳通常以30秒的间隔增加,从而减少了潜在的搜索空间。
传统的锁具由钥匙打开,钥匙需要随身携带,比较麻烦且安全性低。随着近年来电子技术的发展,智能锁在日常生活中的应用日渐广泛。智能锁是指区别于传统机械锁,在用户识别、安全性、管理性方面更加智能化的锁具:其中,智能锁是门禁系统中锁门的执行部件。
现有智能锁密码设定后会重复使用,导致了使用安全性的下降,会对无人仓造成巨大的经济损失和破坏。
发明内容
为解决上述技术问题,本发明提供一种安全性能高,稳定性好的一种用于无人仓离线智能锁的TOTP算法及系统。
本发明的一种用于无人仓离线智能锁的TOTP算法,包括智能锁中预设有唯一防伪编号,将设备编号同步到控制系统中,控制系统中预设加密密钥,控制系统中设定动态码有效时间,控制器加密密钥、智能锁防伪编号和对应时间戳通过哈希函数生成一次性密码,控制系统通过互联网与手机APP同步连接传输,包括如下步骤:
步骤1、锁体控制系统接收用户的开锁请求,加密密钥、时间戳以防伪编号通过哈希函数生成一次性动态密码,动态密码通过控制系统由互联网同步到用户手机APP;
步骤2、用户将收集APP动态密码输入智能锁中,通过智能锁控制系统的解密密钥对动态密码进行解密,同时对生成有效时间点进行核实验证;
步骤3、控制系统对输入密码和生成动态密码进行一一验证,若一致性比对通过则进入下一步骤,否则验证不通过;
步骤4、输入密码与控制系统中与设定有效时间比对,当输入时间间隔小于与设定时间时则通过进入下一步,否则验证不通过;
步骤5、控制系统对动态密码判断是否首次使用,如是则智能锁打开,否则智能锁保持关闭。
本发明的一种用于无人仓离线智能锁的TOTP算法,所述哈希函数的算法为,将对应请求开锁时间设定为哈希值K,通过哈希函数关系计算出值,表示为:Addr=H(key)。
公式:Hi=(H(key)+di)MOD m i=1,2,...,k(k<=m-1)
其中,m为防伪编号。di是控制系统中设定的加密密钥。di值可能为1,2,3,...n。
如果di取1,出现相通动态密码后,向后移动1个位置。
本发明的一种用于无人仓离线智能锁系统,还包括控制模块、输入模块、申请模块、发送模块和解锁模块,输入模块、申请模块、发送模块和解锁模块均与控制模块连通,发送模块用于控制模块与手机APP进行连接。
本发明的一种用于无人仓离线智能锁系统,还包括报警模块,报警模块与控制模块连通,用于密码多次错误后进行通知报警。
本发明的一种用于无人仓离线智能锁系统,还包括卡读取模块,卡读取模块与控制模块连接。
与现有技术相比本发明的有益效果为:安全性能高,稳定性好。
附图说明
图1是本发明的流程机构示意图;
具体实施方式
下面结合附图和实施例,对本发明的具体实施方式作进一步详细描述。以下实施例用于说明本发明,但不用来限制本发明的范围。
如图1所示,本发明的一种用于无人仓离线智能锁的TOTP算法,包括智能锁中预设有唯一防伪编号,将设备编号同步到控制系统中,控制系统中预设加密密钥,控制系统中设定动态码有效时间,控制器加密密钥、智能锁防伪编号和对应时间戳通过哈希函数生成一次性密码,控制系统通过互联网与手机APP同步连接传输,包括如下步骤:
步骤1、锁体控制系统接收用户的开锁请求,加密密钥、时间戳以防伪编号通过哈希函数生成一次性动态密码,动态密码通过控制系统由互联网同步到用户手机APP;
步骤2、用户将收集APP动态密码输入智能锁中,通过智能锁控制系统的解密密钥对动态密码进行解密,同时对生成有效时间点进行核实验证;
步骤3、控制系统对输入密码和生成动态密码进行一一验证,若一致性比对通过则进入下一步骤,否则验证不通过;
步骤4、输入密码与控制系统中与设定有效时间比对,当输入时间间隔小于与设定时间时则通过进入下一步,否则验证不通过;
步骤5、控制系统对动态密码判断是否首次使用,如是则智能锁打开,否则智能锁保持关闭;安全性能高,稳定性好。
本发明的一种用于无人仓离线智能锁的TOTP算法,所述哈希函数的算法为,将对应请求开锁时间设定为哈希值K,通过哈希函数关系计算出值,表示为:Addr=H(key)。
公式:Hi=(H(key)+di)MOD m i=1,2,...,k(k<=m-1)
其中,m为防伪编号。di是控制系统中设定的加密密钥。di值可能为1,2,3,...n。
如果di取1,出现相通动态密码后,向后移动1个位置。
本发明的一种用于无人仓离线智能锁系统,还包括控制模块、输入模块、申请模块、发送模块和解锁模块,输入模块、申请模块、发送模块和解锁模块均与控制模块连通,发送模块用于控制模块与手机APP进行连接。
本发明的一种用于无人仓离线智能锁系统,还包括报警模块,报警模块与控制模块连通,用于密码多次错误后进行通知报警。
本发明的一种用于无人仓离线智能锁系统,还包括卡读取模块,卡读取模块与控制模块连接。
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明技术原理的前提下,还可以做出若干改进和变型,这些改进和变型也应视为本发明的保护范围。

Claims (4)

1.一种用于无人仓离线智能锁的TOTP算法,其特征在于,包括智能锁中预设有唯一防伪编号,将设备编号同步到控制系统中,控制系统中预设加密密钥,控制系统中设定动态码有效时间,控制器加密密钥、智能锁防伪编号和对应时间戳通过哈希函数生成一次性密码,控制系统通过互联网与手机APP同步连接传输,包括如下步骤:
步骤1、锁体控制系统接收用户的开锁请求,加密密钥、时间戳以防伪编号通过哈希函数生成一次性动态密码,动态密码通过控制系统由互联网同步到用户手机APP;
步骤2、用户将收集APP动态密码输入智能锁中,通过智能锁控制系统的解密密钥对动态密码进行解密,同时对生成有效时间点进行核实验证;
步骤3、控制系统对输入密码和生成动态密码进行一一验证,若一致性比对通过则进入下一步骤,否则验证不通过;
步骤4、输入密码与控制系统中与设定有效时间比对,当输入时间间隔小于与设定时间时则通过进入下一步,否则验证不通过;
步骤5、控制系统对动态密码判断是否首次使用,如是则智能锁打开,否则智能锁保持关闭;
所述哈希函数的算法为,将对应请求开锁时间设定为哈希值K,通过哈希函数关系计算出值,表示为:Addr=H(key);
公式:Hi=(H(key)+di)MOD m i=1,2,...,k(k<=m-1)
其中,m为防伪编号,di是控制系统中设定的加密密钥,di值可能为1,2,3,...n;
如果di取1,出现相通动态密码后,向后移动1个位置。
2.如权利要求1所述的一种用于无人仓离线智能锁系统,其特征在于,还包括控制模块、输入模块、申请模块、发送模块和解锁模块,输入模块、申请模块、发送模块和解锁模块均与控制模块连通,发送模块用于控制模块与手机APP进行连接。
3.如权利要求1所述的一种用于无人仓离线智能锁系统,其特征在于,还包括报警模块,报警模块与控制模块连通,用于密码多次错误后进行通知报警。
4.如权利要求1所述的一种用于无人仓离线智能锁系统,其特征在于,还包括卡读取模块,卡读取模块与控制模块连接。
CN202111002584.2A 2021-08-30 2021-08-30 一种用于无人仓离线智能锁的totp算法及系统 Active CN113726508B (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111002584.2A CN113726508B (zh) 2021-08-30 2021-08-30 一种用于无人仓离线智能锁的totp算法及系统

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111002584.2A CN113726508B (zh) 2021-08-30 2021-08-30 一种用于无人仓离线智能锁的totp算法及系统

Publications (2)

Publication Number Publication Date
CN113726508A CN113726508A (zh) 2021-11-30
CN113726508B true CN113726508B (zh) 2024-04-02

Family

ID=78679010

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111002584.2A Active CN113726508B (zh) 2021-08-30 2021-08-30 一种用于无人仓离线智能锁的totp算法及系统

Country Status (1)

Country Link
CN (1) CN113726508B (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114401426B (zh) * 2021-12-31 2023-05-05 珠海迈科智能科技股份有限公司 一种动态密钥的生成方法及其系统
CN114360111B (zh) * 2022-01-15 2023-02-24 东北大学 一种基于物联网技术的自行车智能监管防盗系统及方法

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019001588A1 (zh) * 2017-06-28 2019-01-03 西安中兴新软件有限责任公司 数据处理方法及其装置、终端、存储介质
CN110535968A (zh) * 2019-09-07 2019-12-03 长沙北之辰智能技术有限公司 一种基于动态密码的机柜门禁控制系统及方法
CN111612945A (zh) * 2020-05-06 2020-09-01 浙江中邦数码科技有限公司 一种智能锁生成动态密码的方法和智能锁系统
CN112184952A (zh) * 2019-06-17 2021-01-05 中国电信股份有限公司 智能锁控制系统、方法以及存储介质
CN112750242A (zh) * 2021-01-25 2021-05-04 广州畅联信息科技有限公司 一种动态密码锁开锁方法、系统及动态密码锁电路
CN112863017A (zh) * 2021-02-02 2021-05-28 厦门立林科技有限公司 一种智慧社区楼宇对讲系统动态密码开锁装置、方法、设备及存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019001588A1 (zh) * 2017-06-28 2019-01-03 西安中兴新软件有限责任公司 数据处理方法及其装置、终端、存储介质
CN112184952A (zh) * 2019-06-17 2021-01-05 中国电信股份有限公司 智能锁控制系统、方法以及存储介质
CN110535968A (zh) * 2019-09-07 2019-12-03 长沙北之辰智能技术有限公司 一种基于动态密码的机柜门禁控制系统及方法
CN111612945A (zh) * 2020-05-06 2020-09-01 浙江中邦数码科技有限公司 一种智能锁生成动态密码的方法和智能锁系统
CN112750242A (zh) * 2021-01-25 2021-05-04 广州畅联信息科技有限公司 一种动态密码锁开锁方法、系统及动态密码锁电路
CN112863017A (zh) * 2021-02-02 2021-05-28 厦门立林科技有限公司 一种智慧社区楼宇对讲系统动态密码开锁装置、方法、设备及存储介质

Also Published As

Publication number Publication date
CN113726508A (zh) 2021-11-30

Similar Documents

Publication Publication Date Title
US11120656B2 (en) Methods and systems for offline verification code generation based on smart door lock system
CN113726508B (zh) 一种用于无人仓离线智能锁的totp算法及系统
EP0720796B1 (en) System and method for changing the key or password in a secure distributed communications network
US10630490B2 (en) Obtaining and using time information on a secure element (SE)
US20070257813A1 (en) Secure network bootstrap of devices in an automatic meter reading network
CN110462691A (zh) 智能门锁的开锁方法、移动终端、智能门锁及云服务器
CN107438230B (zh) 安全无线测距
US8171527B2 (en) Method and apparatus for securing unlock password generation and distribution
US20070209081A1 (en) Methods, systems, and computer program products for providing a client device with temporary access to a service during authentication of the client device
EP3398289B1 (en) A method, system and apparatus using forward-secure cryptography for passcode verification
CN101291224A (zh) 在通信系统中处理数据的方法和系统
US11165569B2 (en) Method and device for securely operating a field device
CN113965328B (zh) 可信执行环境的数字钥匙离线情况的权限转移方法及系统
CN110310392A (zh) 车辆解锁方法、装置、计算机设备及存储介质
CN113656775A (zh) 一种带有效期的离线密码验证方法、系统及智能锁
Liao et al. Toward authenticating the master in the modbus protocol
CN109754503A (zh) 智能门锁开锁方法
CN113904856A (zh) 认证方法、交换机和认证系统
CN106911479A (zh) 一种安全认证系统、方法和终端设备
CN110298941A (zh) 一种智能门锁一次性临时密码生成方法
CN107231380B (zh) 一种抗攻击的身份认证方法及系统和抗攻击的汽车系统
CN115147960A (zh) 电子锁处理方法以及装置
WO2019218328A1 (zh) 一种智能门锁无线通信方法、智能门锁、网关及通信设备
CN114170709A (zh) 基于物联网的款箱管理方法和系统
US20230108551A1 (en) Cross-referencing device

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