Skip to content
markksantosPublic

Repository files navigation

⌨️ EchoType

Time Machine for your keystrokes — silently capture, encrypt, and search everything you type.

Swift SwiftUI macOS License

Features · Getting Started · Tech Stack


✨ Features

  • Global Keystroke Capture — Records every keypress across all apps using a low-level CGEventTap on a dedicated background thread
  • AES-256-GCM Encryption — All keystroke data is encrypted at rest with a master password; plaintext never touches disk
  • Instant Search — Floating search panel (⌘⇧E) with debounced queries, date range filters, and per-app filtering
  • Touch ID Unlock — Store your derived encryption key in the Secure Enclave with biometric protection via Keychain
  • Secure Field Detection — Automatically pauses recording when a password field is focused using Accessibility API inspection
  • App Exclusion List — Exclude specific apps from capture with a running-apps picker in Settings
  • Session Grouping — Keystroke streams are split into logical sessions based on 30-second inactivity gaps
  • Auto-Lock — Zeros the in-memory encryption key on screen lock, sleep, or after 5 minutes of inactivity
  • Data Retention — Configurable retention policy (7–365 days or forever) with manual purge support
  • Export — Save session transcripts as plain text or Markdown via NSSavePanel
  • Menu Bar Native — Lives entirely in the menu bar with no Dock icon; green/yellow/red status indicator with pulse animation
  • Global Hotkeys — ⌘⇧E to toggle search, ⌘⇧P to pause/resume recording from anywhere

🚀 Getting Started

Prerequisites

  • macOS 13.0 (Ventura) or later
  • Swift 5.9+
  • Xcode 15+ or Swift toolchain installed

Installation

git clone https://github.com/markksantos/EchoType.git
cd EchoType
swift build

Running (development)

swift run EchoTypeApp

On first launch you'll be prompted to set a master password, then guided through granting permissions.

Note: swift run produces a bare executable. macOS ties Input Monitoring & Accessibility grants to a signed application bundle, so for day-to-day use (and for the permissions to stick across rebuilds) build a real .app:

Scripts/build-app.sh          # assembles build/EchoType.app (release)
open build/EchoType.app

Tests

swift test

The suite covers the security-critical core: PBKDF2 key derivation, AES-256-GCM round-trips and tamper detection, encrypted-store read/write/re-encrypt, session grouping, retention, app exclusion, and search. UI, Keychain, and the CGEventTap are exercised manually (they require a signed bundle and a live window server).

Permissions

EchoType requires two macOS privacy permissions to function:

Permission Why
Accessibility Reads the active app name, window title, and detects secure text fields via AXUIElement
Input Monitoring Captures keystrokes globally via CGEventTap

The app includes a step-by-step permission guide on first launch. A restart is required after granting Input Monitoring for the event tap to activate.

🛠️ Tech Stack

Category Technology
Language Swift 5.9
UI SwiftUI + AppKit (MenuBarExtra, NSPanel)
Encryption CryptoKit (AES-256-GCM)
Key Derivation CommonCrypto (PBKDF2-HMAC-SHA256, 600K iterations)
Biometrics LocalAuthentication + Keychain Services
Persistence SQLite3 (C API via system library target, WAL mode)
Keystroke Capture CoreGraphics (CGEventTap)
Accessibility ApplicationServices (AXUIElement)
Architecture Swift Concurrency (actors, async/await)
Platform macOS 13.0+

📁 Project Structure

EchoType/
├── Package.swift
├── LICENSE
├── Resources/
│   └── EchoType.entitlements        # Hardened Runtime entitlements (unsandboxed)
├── Scripts/
│   ├── build-app.sh                 # SPM build -> build/EchoType.app
│   ├── sign-and-notarize.sh         # codesign + notarytool + stapler
│   └── make-dmg.sh                  # drag-to-Applications DMG
├── Sources/
│   ├── CSQLite/                     # SQLite3 C-API system library target
│   ├── EchoEngine/                  # headless core (no UI deps)
│   │   ├── EchoEngineController.swift
│   │   ├── Capture/                 # CGEventTap, buffer, app monitor, secure-field
│   │   ├── Crypto/                  # PBKDF2, AES-256-GCM, Keychain, secure-zero
│   │   ├── Export/                  # text / Markdown export
│   │   ├── Permissions/             # Accessibility + Input Monitoring checks
│   │   ├── Privacy/                 # exclusion list, auto-lock, retention, login item
│   │   ├── Search/                  # substring search engine
│   │   └── Storage/                 # encrypted store, SQLite wrapper, migrations
│   ├── EchoUI/                      # SwiftUI + AppKit views
│   │   ├── MenuBar/  Onboarding/  Search/  Settings/  Shared/
│   └── EchoTypeApp/                 # @main App, AppDelegate, Info.plist
├── Tests/
│   └── EchoEngineTests/             # crypto, storage, search, grouping, retention
└── tasks/
    └── todo.md

📦 Building & Distribution

EchoType is distributed directly (DMG / GitHub Releases), not via the Mac App Store: a global CGEventTap and the Accessibility API are not permitted inside the App Sandbox. The app ships unsandboxed under a Developer ID with the Hardened Runtime + notarization.

# 1. Assemble the .app bundle
Scripts/build-app.sh

# 2. Code-sign (Hardened Runtime), notarize, and staple
export DEVELOPER_ID="Developer ID Application: Your Name (TEAMID1234)"
export NOTARY_PROFILE="echotype-notary"   # see below
Scripts/sign-and-notarize.sh

# 3. Build the distributable DMG
Scripts/make-dmg.sh        # -> build/EchoType-1.0.dmg

One-time notarization credential setup:

xcrun notarytool store-credentials echotype-notary \
  --apple-id "[email protected]" \
  --team-id "TEAMID1234" \
  --password "app-specific-password"   # from appleid.apple.com

Resources/EchoType.entitlements is intentionally minimal — Input Monitoring and Accessibility are runtime TCC permissions, not codesigning entitlements, so no allow exceptions are needed under the Hardened Runtime.

📄 License

MIT License © 2026 Mark Santos

Built with ❤️ by NoSleepLab

Releases

Packages

Contributors

Languages