Pattern Encryption: How Drawing a Shape Protects Your Files
You draw a pattern with your finger. PBKDF2 turns that gesture into a vault key, which unlocks a separate random key protecting your files with AES-256-GCM. No password field, no short PIN. Just your pattern and a deliberately layered key hierarchy.
Vaultaire serializes a shape drawn on a 5×5 grid and processes it with PBKDF2-HMAC-SHA512, 600,000 iterations, and a device-wide salt stored in the iOS Keychain. The 256-bit result is a vault key: it encrypts the vault index and unwraps the separate random master key that AES-256-GCM uses for file content and metadata.
What Is Pattern Encryption?
Most vault apps hide behind a PIN or a password. You type in four digits, and your photos appear. Sounds secure enough, right?
Here is the problem: a four-digit PIN has exactly 10,000 possible combinations. A computer can try every single one in under a second. Six digits? A million combinations. Still trivially fast for modern hardware. Even an eight-character password, if it uses only lowercase letters, gives you about 200 billion possibilities. That sounds like a lot until you learn that a standard laptop can test billions of password hashes per second.
Pattern encryption takes a fundamentally different approach. Instead of typing characters into a box, you draw a geometric shape across a grid of dots. The specific path you trace — which dots you touch, in what order, with what geometry — becomes the input to a password-based key derivation function. The result is not merely checked by the interface: it must unlock an authenticated encrypted index and the random master key inside it.
The distinction matters. When you enter a PIN into some apps, the app only checks whether you typed the right number. If you did, it opens, even though the files may be protected mainly by access control. Vaultaire instead feeds the drawn pattern into PBKDF2 to derive a 256-bit vault key. That key must authenticate and decrypt the vault index before it can unwrap the random master key used on the files. An unrecognized pattern is presented as an empty vault, but the underlying AES-GCM authentication still distinguishes a correct key from an incorrect one.
A PIN-based access gate can be like a locked door placed in front of otherwise readable files. Vaultaire’s pattern is closer to the combination on a safe: it derives the key that opens an encrypted index, which in turn releases the separate key protecting the contents. The interface cannot simply bypass that cryptographic chain.
How It Works, Step by Step
Here is what happens from the moment your finger touches the screen to the moment your files become unreadable to everyone else.
Step 1: You Draw Your Pattern
Vaultaire presents a 5×5 grid of dots. You draw a continuous path connecting at least 6 dots with at least two direction changes. The app records exactly which dots you visited and in what order. This sequence is your pattern.
Unlike the 3×3 grids commonly used for Android lock screens, Vaultaire uses a 5×5 grid. This is not a cosmetic choice. Twenty-five positions allow far more paths, crossings, skips, and direction changes than nine positions. The larger theoretical space helps, but actual security still depends on the unpredictability of the path you choose. A familiar letter or simple shape remains guessable even when the grid can express billions of alternatives.
Step 2: The Pattern Derives a Vault Key
Your drawn pattern is serialized with the grid size and fed into PBKDF2 (Password-Based Key Derivation Function 2) with HMAC-SHA512, 600,000 iterations, and a random device-wide salt. The salt is a nonsecret value stored in the iOS Keychain as a WhenUnlockedThisDeviceOnly item. It makes the local derivation device-bound; it is not unique to each vault and does not add entropy to a human-chosen pattern.
The key derivation process is deliberately expensive. PBKDF2 runs 600,000 HMAC-SHA512 iterations for each candidate pattern, raising the cost of a guessing attack. This does not turn a low-entropy pattern into 256 bits of security, and attack time depends on the attacker’s hardware. Its purpose is narrower and measurable: make every guess substantially more expensive than a simple hash.
Step 3: Your Files Get Encrypted
When the vault is first created, Vaultaire generates a random 256-bit master key. The pattern-derived vault key encrypts the index and wraps that master key; it does not encrypt every file directly. The master key is used with AES-256-GCM for file headers, content, thumbnails, and related metadata. Fresh nonces ensure repeated plaintext does not produce repeated ciphertext under the same key.
GCM mode adds an important layer: authentication. It does not just scramble your data — it also generates a tag that detects any tampering. If a single bit of the encrypted file is modified, the decryption will fail. Nobody can tamper with your files without you knowing.
Step 4: Active Key State Is Cleared
When Vaultaire locks, it clears its active vault and master-key state and requires another unlock ceremony before showing the files again. While the vault is open, those symmetric key bytes necessarily exist in the app process so CryptoKit can perform AES-GCM operations. Vaultaire also keeps recovery information, including the pattern and phrase-encrypted recovery envelope, inside an AES-GCM encrypted database stored in the iOS Keychain. That is materially different from claiming that the pattern and every key copy are stored nowhere.
The Math Behind It (In Plain English)
You do not need a computer science degree to understand why this works. The security comes down to three numbers: how many patterns are possible, how long each guess takes, and how many guesses an attacker can make.
Entropy: The Measure of Unpredictability
Entropy is a fancy word for “how hard is this to guess.” A coin flip has 1 bit of entropy (two outcomes). A four-digit PIN has about 13 bits of entropy (10,000 outcomes). A well-chosen pattern on a 5×5 grid, connecting 8 or more dots, can exceed 30 bits of entropy — more than a billion possible patterns.
The pattern’s entropy sets the ceiling for a guessing attack. PBKDF2 cannot create entropy that the gesture does not contain, but it can make each candidate much more expensive to test.
Key Derivation: Making Guesses Expensive
PBKDF2 takes the serialized pattern and runs 600,000 rounds of HMAC-SHA512. Attack estimates must use a measured cost on the hardware doing the guessing: at exactly one millisecond per complete candidate, one billion candidates would take one million seconds, or about 11.6 days, on one worker. A slower measured candidate cost increases that time; parallel hardware reduces it. The 256-bit output length does not change the size of the pattern search space.
The device-wide salt is stored in Keychain and is not designed to be secret. Keychain and iOS Data Protection may make extraction harder in a device-seizure scenario, but the cryptographic analysis must assume that an examiner who acquires the encrypted files may also acquire the salt. The salt prevents precomputation across devices; it is not a substitute for a strong pattern.
AES-256: The Standard That Governments Trust
AES-256 is the encryption standard used by the U.S. government for classified information. The “256” refers to the key length in bits. A 256-bit key has 2256 possible values — a number so large that if every atom in the observable universe were a computer, and each computer could test a trillion keys per second, they still would not crack it before the heat death of the universe.
The security of AES-256 does not depend on keeping the algorithm secret. But the full system is not protected by the AES key space alone: the practical guessing bound comes from the pattern’s entropy, the PBKDF2 work factor, and the protection around the device salt and encrypted storage. AES-256-GCM provides strong authenticated encryption once the correct random master key has been unlocked.
What an Attack Would Have to Overcome
Let us consider the main ways someone might try to access your encrypted files, what Vaultaire does to raise the cost, and where the limits remain.
Brute Force: Trying Every Pattern
PBKDF2 makes every pattern candidate pay for 600,000 HMAC-SHA512 iterations. That is a meaningful defense, but not a promise of a fixed number of years: the result depends on pattern choice, measured derivation speed, parallelism, and whether the examiner has recovered the device salt. Longer, less predictable paths matter because PBKDF2 raises guess cost rather than creating new entropy.
Smudge Attacks: Reading Your Screen
On a 3×3 grid, smudge marks on a screen can narrow down the possible patterns significantly. On a 5×5 grid, the smudge pattern reveals which dots were touched but not the order, direction, or connections between them. The combinatorial explosion makes this approach impractical.
Shoulder Surfing: Watching You Draw
Patterns drawn quickly on a small phone screen are extremely difficult to memorize by observation, especially on a 5×5 grid. Research shows that observers have a much harder time replicating complex patterns compared to overhearing a PIN or password being spoken aloud.
Device Seizure: Taking Your Phone
If someone takes your phone, Vaultaire’s file contents and indexes remain AES-GCM ciphertext until the required keys are available. The app does not store a conventional password-verifier record, but that does not remove offline verification. The filename of each encrypted vault index contains a truncated hash of the vault key, and AES-GCM authenticated decryption also succeeds or fails for a candidate key. Device protection and pattern strength therefore remain part of the threat model.
A separate password hash is not required to test a guess against authenticated ciphertext. Vaultaire’s AES-GCM tags provide a high-confidence success or failure result, and the index filename provides a cheaper preliminary check. The defense is the cost and unpredictability of the credential plus iOS protection of local material, not the absence of a verification oracle.
Choosing a Strong Pattern
The encryption is only as strong as the pattern you choose. Here is how to maximize your security with minimal effort.
What Makes a Pattern Strong
- Use more dots. Connect at least 8 of the 25 available dots. Every additional dot multiplies the number of possible patterns.
- Cross your own path. Patterns that loop back, skip dots, or change direction unexpectedly are much harder to reproduce from memory or observation.
- Avoid obvious shapes. Letters (L, Z, S), simple geometric shapes (squares, triangles), and straight lines are the first things an attacker would try.
- Use the full grid. Patterns that stay in one corner or along one edge waste the available entropy. Spread out.
What to Avoid
- Minimum-length patterns. Vaultaire requires at least 6 dots and two direction changes, but meeting the minimum does not make a path unpredictable. Use more of the grid when you can remember the result reliably.
- Simple geometric shapes. An L-shape, a zigzag, or a straight diagonal line are the pattern equivalents of “password123.”
- Starting from the same corner every time. Research on Android lock patterns shows that most people start from the top-left dot. Attackers know this.
The Sweet Spot
A pattern connecting 8–12 dots with at least two direction changes provides excellent security while remaining easy for you to remember through muscle memory. You do not need to memorize it like a password — your hand remembers the motion, the same way it remembers how to write your signature.
Why You Should Feel Safe
Pattern encryption in Vaultaire is not merely a prettier PIN pad. The gesture is processed by a real key derivation function and must unlock authenticated encrypted data. Its strength still depends on the gesture you choose, so Vaultaire combines the larger grid with a high PBKDF2 work factor instead of presenting the 256-bit output length as 256 bits of human-secret entropy.
Your pattern and local vault key are not sent to Vaultaire. If optional backup is enabled, a separate pattern-derived backup key encrypts CloudKit records and an encrypted recovery manifest lets the recovery phrase restore the vault and backup keys. Vaultaire does not hold a provider key that decrypts those records, but the device and recovery credentials remain security-critical parts of the design.
You draw a shape. That shape protects your files. The math does the rest.
Frequently Asked Questions
What happens if I forget my pattern?
When you create a vault, Vaultaire generates a custom nine-word recovery sentence. PBKDF2 derives a recovery key from that sentence, which opens an encrypted envelope containing the vault key. If you lose both the pattern and recovery phrase, Vaultaire has no server-side key that can restore the vault.
Is a pattern really more secure than a password?
A well-chosen pattern on a 5×5 grid can match or exceed the entropy of a typical password. The advantage is usability: people choose weak passwords because strong ones are hard to remember. Patterns leverage muscle memory, making it natural to use a complex one without conscious memorization.
Can someone screenshot or record my pattern?
Vaultaire applies a best-effort screenshot shield to the pattern grid and reacts when iOS reports active screen capture. iOS does not provide a public secure-screen flag for arbitrary app content, so these controls reduce accidental capture but cannot guarantee that every capture method is blocked.
What encryption algorithm does Vaultaire use?
Vaultaire uses PBKDF2-HMAC-SHA512 with 600,000 iterations to derive a vault key from the pattern and a device-wide Keychain salt. That vault key encrypts the vault index and wraps a random 256-bit master key. AES-256-GCM under the master key protects file content, headers, metadata, and thumbnails with authenticated encryption.
Is the pattern stored on my device?
Vaultaire stores recovery information, including the pattern, inside an AES-GCM encrypted recovery database held in the iOS Keychain. The pattern is not sent to Vaultaire or stored in plaintext files. While a vault is open, key bytes exist in the app process; locking drops Vaultaire’s active key state.
Can Vaultaire access my encrypted files?
Vaultaire does not operate a service that receives your pattern, recovery phrase, decryption keys, or readable vault contents. Encrypted iCloud backups remain in your private CloudKit database. This provider boundary does not protect an open vault from a compromised app build, operating system, or device.
Try Pattern Encryption
Draw your first pattern and see how it feels to have your files truly protected.
Download Vaultaire Free