Guide · Locks
How long to guess a 4-, 6- or 9-digit passcode? The real numbers
It depends on how fast the lock lets someone try. With no limit, a computer runs through every 4-digit code in moments. With waits after wrong tries, the same 4 digits take far longer: in Sealed, trying every 4-digit code by hand takes about 14 months, every 6-digit code about 114 years, and 9 digits a thousand times longer than 6. A guessable code, such as a birthday, falls much sooner than any of these.
On this page
Two things decide the answer
How long a guesser needs comes down to two numbers multiplied together.
- How many codes there are. Each digit has ten choices, so a 4-digit code is one of ten thousand, a 6-digit code one of a million, and a 9-digit code one of a billion. You can open Sealed with Face ID or Touch ID, a 4-, 6- or 9-digit passcode, a password or a pattern.
- How fast the lock lets someone try. This is the number people forget. A lock with no limit lets a fast thumb, or a script that taps the screen, try codes as quickly as they can be typed. A lock that makes you wait after wrong tries turns minutes into months.
The second number matters more than the first. Six digits with no limit lose to four digits with good waits.
Three situations, three very different answers
The same six digits can last an afternoon or a lifetime, depending on where the guessing happens.
A lock with no limit. Some apps let anyone type code after code with no pause. A patient person with a free evening can work through every four-digit code, and a script that taps the screen goes faster still. Here the length of the code is the only defense.
A lock that makes you wait. Each wrong try past a limit buys a longer pause, so the number of guesses per day stays small however patient the guesser is. In Sealed: With the limit left at three, a person who only types guesses on the lock screen can make at most 4 tries in the first minute, 7 in the first hour and 30 in the first day, and from the seventh wrong try on the pace is one try an hour. During a wait Sealed refuses every way in, the right passcode and Face ID included, and doesn’t count those tries as wrong.
A copy of the files. Someone who copies a vault’s files to a computer skips the lock screen entirely. What matters then is whether the key is built from the passcode. If it is, a computer tries every short code in moments. If the key is random, the passcode doesn’t help them at all. Your passcode is a gate in front of the app. It is not part of the key. Your backup is sealed with your random vault key, not with your passcode, so a short passcode doesn’t make the backup easier to open.
So when an app promises that its code would take years to guess, ask which of the three it means.
The worked numbers
At Sealed’s lock-screen pace, the time to try every code. The passcode strength checker runs the same count for your own lock.
| Passcode | Codes to try | Time to try them all |
|---|---|---|
| Four digits | Ten thousand | about 14 months |
| Six digits | A million | about 114 years |
| Nine digits | A billion | A thousand times the six-digit run |
| Pattern of nine dots | at most 985,824 | at most about 112 years |
Patterns drawn on a bigger grid hold more. On average a guesser finds a code about halfway through the run, so halve each time for a typical case. Even halved, four digits by hand is months of steady work. The lock comparison guide weighs the lock types against each other.
What makes the real time shorter
The table assumes a code picked at random, typed by a stranger. Three things cut it short: a code with a shape (a year, a date, a run of digits), a code someone has watched you type, and a code you also use to unlock the phone. No wait helps with the last two. Dual Lock adds a face to the code for that case: Dual Lock asks for your passcode and a Face ID match together, and it is part of Sealed Pro.
What the waits don’t cover
The waits cover a person typing on the lock screen. They don’t cover a person who has your phone, its passcode and enough time, or one who changes the phone’s clock and restarts it. While the iPhone stays on, a wait is timed on a clock that doesn’t move when the date is changed in Settings, so setting the date forward doesn’t end it early; after a restart, Sealed goes back to the saved end time on the normal clock.
They also don’t apply to the recovery key path, on purpose. Forgot passcode? with your recovery key works during a wait, because a wait protects nothing against a 256-bit key. A wrong passcode can still be useful to know about: break-in alerts can take a photo of the person trying. Break-in alerts are part of Sealed Pro.
Where Sealed helps, and where it doesn’t
It helps by slowing down guessing on every plan, and keeping the count across restarts of the app. The wait is part of every vault: it doesn’t need Break-In Alerts or Sealed Pro. Sealed keeps the wrong-try count and the wait when you close it and open it again, and the count clears only after a correct unlock or a passcode reset with your recovery key.
It helps with failed face matches counted the same way. A Face ID or Touch ID attempt that doesn’t match counts as a wrong try, but cancelling the prompt, or iOS cancelling it, does not. Apple says Face ID allows only five unsuccessful match attempts before the iPhone asks for its passcode.
It doesn’t protect a code someone has watched you type. Dual Lock asks for your passcode and a Face ID match together, and it is part of Sealed Pro.
It doesn’t make a guessable code strong. The numbers above assume a random one. Sealed’s default passcode is 6 digits, and you can choose 4 or 9 digits or a password instead.
Questions and answers
Is a 4-digit passcode enough for a photo vault?
Against a stranger typing guesses, the waits do most of the work. Against someone who has watched you type it, no length helps. about 14 months is the full run for 4 digits in Sealed; Sealed’s default passcode is 6 digits, and you can choose 4 or 9 digits or a password instead.
Does closing the app reset the wrong tries?
Not in Sealed. Sealed keeps the wrong-try count and the wait when you close it and open it again, and the count clears only after a correct unlock or a passcode reset with your recovery key.
Do Face ID failures count as guesses?
A Face ID or Touch ID attempt that doesn’t match counts as a wrong try, but cancelling the prompt, or iOS cancelling it, does not. Apple says Face ID allows only five unsuccessful match attempts before the iPhone asks for its passcode.
Sources
What this page says about Sealed was checked against the app on .
- Apple Support, About Face ID advanced technology — Face ID allows five unsuccessful match attempts before the passcode is required; cited through the ios.faceid_five fact (dated in facts/facts.yaml)
- Sealed on the App Store — the listing for the app whose waits are used in the worked numbers
Get Sealed
Sealed is free to download, and Sealed Pro is an optional in-app purchase.