Project Hub: LockRoot

LockRoot is a local, offline-first password manager engineered for strict security boundaries across Android, iOS, Windows, Linux, and macOS.

Designed for users who reject cloud synchronization, account-based recovery, and telemetry, LockRoot operates under a zero-trust model regarding network and filesystem integrity. The vault lives exclusively on the local device, encrypted via a 256-bit key derived from a master password. There are no backdoors, no password reset flows, and no remote recovery options.


The Core Philosophy

Encryption does not save a master password like password123. Lockroot can protect the vault properly, but it cannot make a weak password brave.

Unlike commercial password managers that prioritize user retention via cloud backups and recovery keys, LockRoot prioritizes absolute local data sovereignty. If a device is lost without an encrypted export, the data is lost. If the master password is forgotten, the vault is permanently inaccessible. This rigid design eliminates the vast majority of remote attack vectors, including credential stuffing against cloud providers, malicious server-side code updates, and coerced cloud data exfiltration.


Technical Features

1. Robust Cryptographic Pipeline

LockRoot implements a modern, memory-hard cryptographic pipeline designed to defeat offline parallelized brute-forcing by Graphical Processing Units (GPUs) and Application-Specific Integrated Circuits (ASICs).

  • Key Derivation: Argon2id (RFC 9106) utilizing 64 MiB of memory, 3 iterations, and 2 parallel lanes. This targets an execution time of 500ms–1000ms on mid-range mobile ARM processors.
  • Authenticated Encryption: AES-256-GCM is used universally across all platforms to encrypt the vault payload.
  • Metadata Binding: Envelope metadata (version, KDF parameters, cipher strings) is bound into the AES-GCM Associated Data (AAD), ensuring any structural tampering results in a failed decryption rather than garbage plaintext.

2. Strict Memory Zeroing

The master password is never stored on disk. When a user authenticates, the password bytes are held in memory only as long as necessary to derive the Argon2id key.

  • Android (Kotlin): Utilizes Arrays.fill(bytes, '\u0000') guarded by a @Volatile sink variable to prevent the JVM optimizer from stripping the zeroing instruction.
  • iOS (Swift): Leverages sodium_memzero from Clibsodium wrapped in a Swift defer {} block to guarantee synchronous wiping upon block exit.
  • Windows/Linux (.NET 8): Executes CryptographicOperations.ZeroMemory on ReadOnlySpan<char> buffers.

3. Platform-Specific Boundary Defenses

Because a local vault is only as secure as the host operating system, LockRoot implements platform-specific defensive layers.

  • Android: Blocks task-switcher previews and screenshots using WindowManager.LayoutParams.FLAG_SECURE. Disables Android Auto-Backup (android:allowBackup="false").
  • iOS: Integrates with iOS Data Protection using .completeFileProtection, ensuring the vault file is cryptographically locked by the Secure Enclave when the device is locked.
  • Windows: Requests screen capture exclusions via the SetWindowDisplayAffinity Win32 API.
  • Clipboard Eviction: Automatically evicts copied secrets from the system clipboard after 20 seconds, handling platform inconsistencies (e.g., bypassing Android 13+ clipboard UI notifications where possible).

The v2 Vault Envelope Format

All LockRoot clients (mobile and desktop) utilize a standardized JSON envelope (Lockroot_VAULT). This allows seamless export and import across diverse operating systems.

Structure:

{
  "magic": "Lockroot_VAULT",
  "version": 2,
  "kdf": {
    "name": "argon2id",
    "memory": 65536,
    "iterations": 3,
    "parallelism": 2,
    "salt": "<base64_encoded_32_byte_salt>"
  },
  "cipher": {
    "name": "aes-256-gcm",
    "nonce": "<base64_encoded_12_byte_nonce>"
  },
  "ciphertext": "<base64_encrypted_payload>",
  "tag": "<base64_16_byte_aead_tag>"
}

To prevent Denial-of-Service (DoS) attacks via maliciously crafted vault files, the parsers strictly bound the KDF parameters (e.g., rejecting files demanding >256>256 MiB of memory or >10>10 iterations) before executing the expensive Argon2id hash.


Threat Model & Scope Definitions

LockRoot operates under a specific, well-defined threat model. It assumes the host operating system is uncompromised and the user chooses a strong master password (minimum 12 characters).

In Scope (Supported Defenses)

  • Offline Brute Force: A stolen encrypted vault file is protected against rapid cracking via the memory-hard KDF.
  • Envelope Tampering: Modifying the KDF iteration count in the JSON envelope to weaken derivation is detected by the AEAD tag.
  • Passive Keylogging via Clipboard: The 20-second clipboard eviction mitigates exposure to malicious apps monitoring clipboard state.
  • Over-the-Shoulder Sniping: Auto-locking on inactivity (Windows/Linux) or backgrounding (iOS) limits exposure windows.

Out of Scope (Unsupported / Prevented Vectors)

  • Compromised/Rooted Devices: LockRoot cannot protect data in RAM from a privileged process (e.g., malware utilizing ptrace or rooting tools).
  • Active Keyloggers: If a malicious keyboard captures the master password during entry, the vault is compromised.
  • Weak Master Passwords: While Argon2id slows down cracking, a password like password12345 will eventually fall to a dictionary attack.
  • Shoulder Surfing: Using the ‘reveal password’ eye icon in a public space is a physical security issue outside the software boundary.

Architecture Summary by Platform

    Master Password


      Argon2id


    256-bit Key


   AES-256-GCM


  Encrypted Vault


   Local Storage

The repository is modularized by platform to allow native API access:

  • app/ (Android): Implements CryptoService.kt for Argon2id and LegacyAesGcmCipher.kt.
  • ios/ (iOS): Implements VaultViewModel.swift and CryptoService.swift using CryptoKit and Clibsodium.
  • macos/ (macOS): Shares the Swift PM structure with iOS, utilizing randombytes_buf for cryptographically secure random number generation.
  • windows/ (Windows): Uses .NET AesGcm and BouncyCastle’s Argon2id implementation.
  • linux/ (Linux): Uses the Avalonia cross-platform UI framework atop the .NET cryptography stack.

This hub serves as the entry point to the deep technical documentation surrounding LockRoot.

  • LockRoot Case Study: A deep architectural dive (3000+ words) detailing the transition to the v2 vault format, cryptographic parameter selection, and the engineering required to securely wipe memory across three different language runtimes (Kotlin, Swift, C#).
  • Engineering Notes: 10 specific engineering notes documenting the investigation and implementation of clipboard eviction, legacy XChaCha20 migration, AEAD metadata binding, and DoS prevention.
  • Technical Articles: 5 deep technical explorations of the cryptographic pipeline, threat models, and platform-specific UI defenses (e.g., FLAG_SECURE).
  • LockRoot FAQ: Technical questions answering specifics about the framework’s cryptographic choices.

Creator & License

LockRoot is open-source software licensed under the AGPL-3.0-or-later license, ensuring any modifications to the core cryptographic pipeline must remain open to public scrutiny.

Built by Regaan, Security Researcher at the ROT Independent Security Research Lab.