English
How does an offline lock accept a code the cloud made five minutes ago?
The lock has no network at all. The code was created on a server long after it was installed. It works anyway. Who told the lock, and how?
A host in Lisbon makes a few taps in an app, a server invents a code, and a guest in Kyoto keys it straight into a lock that has no Wi-Fi and no internet connection of any kind. The opens. At no point did anyone tell the lock that this code existed.
The explanation people reach for, about these offline codes, is that the code must have been pushed to the lock at some earlier point. It was not: nothing was ever pushed. The code was not sent. It was computed in two separate places, and that is what makes it valid.
The lock and the platform share a secret and know how to run the same calculation
Offline codes work on a kind of opening contract. At the factory, or at pairing, the lock and its 's cloud agree on two things: a secret value belonging to that lock alone, and an agreed way of turning that secret and a range of dates into digits.
igloohome, whose entire product line runs on this principle, describes it in banking terms: "Our unique algoPIN uses technology that's similar to a banking token's One Time Password (OTP)". At pairing, "your smartphone will sync the unique PIN token to our secure cloud servers", and codes are then made from "algorithms and seeds... with the validity duration built into it" (igloohome, how it works).
So when the host asks for a code valid from Tuesday to Friday, the server runs the calculation: the secret, plus that window, produce digits. And when the guest keys those digits in, the lock, in essence, runs the same calculation from its own copy of the secret and its own clock, then checks whether the digits are among the ones it would have produced for a window containing the present moment. If they match, it opens. The code never traveled to the lock. What was installed there, years earlier, is the ability to recognize it, in the form of the secret.
If you have ever used a bank's digit-generating token, or a two-factor authentication app, you have used the same technique: two parties sharing a "seed", as the trade calls it, do not need to communicate to agree on a number.

Everything the lock will ever have to accept is already fixed on the first day
This principle takes the credential path, as another article describes it, to its extreme. In a system where the rights are written onto the cards, the card physically carries the decision, or rather the written orders that will drive the lock. Here the credential is pure information, carried in a message, a booking confirmation, or a guest's memory. The lock needs no infrastructure at all, which is why this is the technique you find everywhere doors have no mains power, no network coverage and nobody on site, or at least nobody nearby: rental cabins, lockboxes, basement gates, the far corners of apartment buildings.
Two of the drawbacks of this technique are well understood, and they mean adapting your methods to allow for them.
First, a code granting access cannot be canceled from a distance. Short of a trip to the door, it can only expire, so the real safety lever is keeping the windows of access short (on which see how long does it take to revoke access?).
Second, the lock's clock is its only reference, it drifts alone on its battery, and a lock that has drifted refuses good codes without anybody being told (on which see how does a battery lock know what time it is?).
A third drawback follows from this principle alone, and it is the one people rarely anticipate. Everything the lock will ever accept is already contained in the arithmetic agreed on the first day. An unusual schedule, a fine-grained rule, an immediate change of mind: each has to have been provided for in the digit scheme, or given up. Where an online lock can be given a new rule, this one can only be given numbers its original arithmetic already knows how to produce.
| Pushed to an online lock | Computed twice, offline | Stored at installation, by hand | |
|---|---|---|---|
| The code travels | To the lock, over the network | Never | Once, under somebody's fingers at the keypad |
| Creating one from far away | Yes, as long as the lock is reachable | Yes, always | No |
| Canceling it early | Yes, in seconds | Mostly no: it expires, it is not recalled | Only by going back to the door |
| What the door needs | A radio, a box or Wi-Fi, and their power | A clock and a battery | A battery |
| What defeats it | The network chain breaking | The clock drifting, or a window left too long | Somebody forgetting to delete it |
Computing offline trades revocation for independence. Whether that trade is a good one depends entirely on the door it is made for.
Where this principle lives in DeviceDB
Battery-powered igloohome hardware, a mortise lock, a deadbolt and a key box: DeviceDB lists offline access codes on all three.
So when a code arrives in a booking email for a cabin with no network access at all, it did not take the road ahead of you. The cloud did not tell the lock. It gave you the result of a calculation the lock will know how to run again on the day you stand in front of it.