Pattern Lock: How Drawing a Shape Opens Your Vault
Pattern lock means you unlock your vault by drawing a shape on a 5×5 grid of dots instead of typing a password. Hidden Folder runs the shape through PBKDF2-HMAC-SHA512 (600,000 rounds) with a salt kept in your Mac's Keychain. The result is the 256-bit key that opens your vault.
What is pattern lock?
On the lock screen you see a grid of 25 dots. You press and drag across at least 6 of them, with at least one change of direction, then let go. That path is your key. There is no username, no account and no biometric prompt. Touch ID is left out on purpose, because a pattern is meant to be a secret you hold in your head, not something your finger can be pressed into.
How it works, step by step
- Pattern
- PBKDF2 + device salt
- Vault key
- Master key
- AES-256-GCM files
-
You draw the pattern
The app writes the path down as a string of dot numbers, for example
5x5:0,1,2,7,12,13. That string exists only in memory. -
The app slows the guess down
It runs the string through PBKDF2-HMAC-SHA512 for 600,000 rounds, mixed with a 32-byte random salt. The salt is stored in your Mac's Keychain and does not leave this Mac. This takes roughly half a second on an M1 Mac, which is the point.
-
The result is your vault key
The 256-bit output opens the vault's encrypted index and unwraps the master key.
-
The master key opens your files
A random 256-bit master key encrypts your files, thumbnails and metadata with AES-256-GCM. Changing the pattern changes the vault key, not the master key, so nothing has to be re-encrypted.
The math in plain English
Why a slow key derivation matters
There are far fewer possible patterns than possible passwords. A computer can try patterns quickly unless each try is made expensive. PBKDF2 with 600,000 rounds makes every guess cost real computing time. The OWASP cheat sheet lists 220,000 rounds as its figure for PBKDF2-HMAC-SHA512, so this is well above that.
Why the salt lives in the Keychain
The salt is random and tied to this Mac. Someone who copies the vault folder to another computer gets ciphertext but not the salt, so they cannot even start guessing patterns against it. The salt does not protect you once an attacker controls your logged-in Mac, because the Keychain is open to you.
Why AES-256-GCM
AES-256 in Galois/Counter Mode encrypts the data and also adds a tag that detects tampering. If someone changes one byte of an encrypted file, it fails to open rather than opening as garbage.
What an attacker would have to beat
- A copied vault folder: they need the device salt from your Keychain before they can test a single pattern.
- Someone with your Mac account while the vault is locked: they see random-looking files with random names. Original names, dates and tags are inside the encrypted index.
- Brute force with the salt and the files: each guess costs 600,000 hashing rounds. A short pattern is still the weak link in this case, which is why the app asks for at least 6 dots and a turn.
- Screen capture: the vault window is excluded from screenshots and screen sharing where macOS honors that setting. See screen-capture protection.
Getting it right
- Use more than 6 dots. Longer paths with several turns are harder to guess than the shortest allowed shape.
- Avoid initials, a single straight line, a Z or an L. Those are the shapes people try first.
- Do not draw it where someone can watch your hand. Watching is the easiest attack on any pattern.
- Write your recovery phrase on paper and keep it away from the Mac.
What pattern lock does not protect against
- Someone watching you draw it (shoulder surfing), or a camera pointed at your hands.
- Malware or a keylogger on a Mac that is already unlocked.
- A weak pattern. A drawn shape holds less entropy than a long random passphrase, and the spec does not claim otherwise.
- Forensics on flash storage after you delete things. Deleting is not secure erasure on an SSD.
Wrong patterns never show an error. An unknown pattern simply opens an empty vault. That is covered on the hidden vaults page.
Keyboard and accessibility
Drawing with a mouse or trackpad is not possible for everyone. The lock screen also accepts a keyboard path: Tab to the grid, arrow keys to move, Space to add a dot, Return to submit.
Frequently asked questions
Can I use a password instead of a pattern?
Not in the plan for the first release. The product is built around a pattern. This could change before launch.
Why is there no Touch ID?
A pattern is meant to be a secret you remember. A fingerprint can be pressed against a sensor by someone else, so the design leaves biometrics out.
What happens if I draw the wrong pattern?
You see an empty vault, not an error. This lets you hold more than one vault without any list showing how many exist. See hidden vaults.
What if I forget my pattern?
Use your recovery phrase from the lock screen. If you lose both, nobody can recover the vault, including the developer, because there is no account and no server copy of your keys.
How many dots do I need?
At least 6 dots and at least one change of direction.
Is a pattern as strong as a password?
No. A drawn pattern has fewer possible values than a long random passphrase. The key derivation and the device-bound salt make guessing slow and force an attacker to have your Keychain data, but a long passphrase would be stronger.