<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rasty Turek</title>
    <description>The latest articles on DEV Community by Rasty Turek (@rasty).</description>
    <link>https://dev.to/rasty</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3824944%2Fe04e1050-a03f-48a2-8542-b2836ef9224b.PNG</url>
      <title>DEV Community: Rasty Turek</title>
      <link>https://dev.to/rasty</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rasty"/>
    <language>en</language>
    <item>
      <title>Pattern-Based Key Derivation: How Vaultaire Turns a Drawn Shape into AES-256 Encryption</title>
      <dc:creator>Rasty Turek</dc:creator>
      <pubDate>Sun, 15 Mar 2026 06:16:15 +0000</pubDate>
      <link>https://dev.to/rasty/pattern-based-key-derivation-how-vaultaire-turns-a-drawn-shape-into-aes-256-encryption-4a0m</link>
      <guid>https://dev.to/rasty/pattern-based-key-derivation-how-vaultaire-turns-a-drawn-shape-into-aes-256-encryption-4a0m</guid>
      <description>&lt;p&gt;Most vault apps use a 4-6 digit PIN as an access code. The PIN unlocks the app, and the files behind it may or may not be encrypted. Vaultaire does something different: the pattern you draw IS the encryption key material.&lt;/p&gt;

&lt;p&gt;Here's how the pipeline works:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;User draws a pattern on a 5x5 grid, connecting at least 4 dots&lt;/li&gt;
&lt;li&gt;The dot sequence is serialized into a byte array&lt;/li&gt;
&lt;li&gt;The byte array is fed into PBKDF2 with a per-vault random salt and 600,000 iterations&lt;/li&gt;
&lt;li&gt;PBKDF2 outputs a 256-bit key&lt;/li&gt;
&lt;li&gt;That key is used for AES-256-GCM file encryption with a unique IV per file&lt;/li&gt;
&lt;li&gt;When the app closes, the key is wiped from memory&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The interesting part is step 3. PBKDF2 (Password-Based Key Derivation Function 2) is deliberately slow. Each guess costs ~1ms of computation. An attacker trying a billion patterns faces a million seconds — about 11.5 days — per vault. And they don't know which pattern is "correct" because there's no verification oracle: every pattern produces a valid-looking key.&lt;/p&gt;

&lt;p&gt;Why not Argon2? CryptoKit on iOS doesn't support it natively. Bringing in a third-party implementation means trusting unaudited code for the most security-critical operation in the app. PBKDF2 at 600K iterations with unique salts meets NIST SP 800-132 recommendations. When Apple adds Argon2 to CryptoKit, I'll migrate.&lt;/p&gt;

&lt;p&gt;The 5x5 grid gives roughly 53 billion possible patterns (connecting 4+ dots with order mattering). Combined with the slow KDF and per-vault salt, this produces usable security for the consumer threat model: casual snooping, device seizure, and coercion scenarios.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://vaultaire.app/features/security-features/" rel="noopener noreferrer"&gt;For the full architecture including ChaCha20 metadata encryption and Secure Enclave integration&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>swift</category>
      <category>security</category>
    </item>
  </channel>
</rss>
