Worried that your smart lock’s one-time password will stop working if Wi-Fi drops? Learn how offline algorithms generate secure, time-based codes that remain valid even without internet.


Imagine this: you create a one-time password (OTP) for a guest arriving tomorrow, but overnight your home Wi-Fi dies. Will the OTP still open the door? The short answer is YES—if your lock uses a modern offline algorithm. Below, we explain exactly how this works, why it’s secure, and what you should look for when buying a smart lock.


1. What “Offline” Really Means for a Smart Lock

Modern smart locks fall into two camps:

  1. Cloud-dependent – every credential (app tap, PIN, OTP) is validated on a remote server. If the internet is down, the lock refuses to open.
  2. Offline-capable – the lock itself stores the necessary logic and secret keys. It does not need live connectivity to verify an OTP.

Our locks (and most premium models released after 2022) are offline-capable. The lock’s microcontroller contains:

When you create an OTP in the companion app, the algorithm runs locally on your phone, then again inside the lock. Both sides produce the same code without ever talking to a server.


2. The Algorithm Behind Offline OTP: TOTP with a Twist

2.1 Standard TOTP (Time-based One-Time Password)

You may already know TOTP from apps like Google Authenticator:

OTP = HMAC-SHA256(SecretKey, UnixTime / TimeStep)

Because both the lock and the app share the same secret and clock, they can each compute identical OTPs.

2.2 Anti-Replay “Twist” for Smart Locks

Standard TOTP is vulnerable to replay if someone captures the code and uses it within the same 60-second window. Our firmware adds two extra checks:

These tweaks eliminate replay attacks and keep everything working when the internet is down for days.


3. Step-by-Step: Creating and Using an Offline OTP

StepWhere it happensInternet required?
1. Generate OTPAppYes (to fetch the lock’s current counter and clock)
2. Send OTP to guestAny channel you like (SMS, WhatsApp, email)Optional
3. Guest arrives and types OTPLockNo
4. Lock validates OTP internallyLockNo
5. Lock syncs usage log back to cloudLockOnly when Wi-Fi returns

4. Security FAQ

Q1. Can someone steal the secret key and create their own OTPs?
The key lives in a CC EAL5+ certified secure element. It never leaves the lock and cannot be read—even if the device is physically opened.

Q2. What if the lock’s battery dies and the RTC resets?
Our RTC has a dedicated coin cell good for 5+ years. On full power loss, the lock refuses OTP entry until the next successful app sync, ensuring no rollback attacks.

Q3. Does offline OTP work for permanent PINs or RFID cards too?
Yes. PINs, cards, and fingerprints are stored in the same secure element and evaluated locally.


5. How to Check if Your Lock Supports True Offline OTP

  1. Look for “offline algorithm” or “local TOTP engine” in the spec sheet.
  2. In the app, create an OTP, then turn on airplane mode. If the lock still opens, it’s offline-capable.
  3. Ask the vendor: “Does the lock store a unique secret per device?” A vague answer usually means cloud dependency.

6. Key Takeaway

A properly engineered smart lock doesn’t need the internet to recognize a valid visitor. By embedding the same algorithm on both phone and lock, offline OTPs remain:

So go ahead—schedule that Airbnb guest, send the cleaner a one-time code, or let the dog walker in. Even if your router takes the day off, your door won’t.


Need more details? Drop us a line at YiTechE@gmail.com for the full cryptographic white paper.

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注