# Privacy by Architecture: How Deck Protects Everything You Copy

> Your clipboard holds passwords, private messages, and documents in progress. Deck keeps every copy on your Mac with four-stage filtering, AES-256-GCM encryption, Keychain-backed Touch ID, and verifiable source code.

Privacy & Security · 2026-12-04 · 5 min read

Your clipboard sees everything you copy: passwords, two-factor codes, client documents, financial details, and half-finished thoughts. A tool with that kind of visibility should treat privacy not as a checkbox, but as an architectural constraint.

[Deck](https://deckclip.app/) is built around a simple premise: **your clipboard history belongs on your Mac.** By default, there is no cloud account, no relay server, no background upload, and no telemetry. When you enable encryption, AI assistance, or peer-to-peer LAN transfer, every boundary is explicit and verifiable in the [source code](https://github.com/yuzeguitarist/Deck/tree/f6e922c6e4bf2dfce13b07cf5c759a8526fff29b).

## The Threat Model

Deck's security architecture addresses three concrete risks on a personal or work Mac:

1. **Unintended capture:** Passwords, bank card numbers, or government ID numbers copied from a browser or chat window should never enter history in the first place.
2. **Unauthorized local access:** Someone sitting down at an unlocked Mac—or inspecting `~/Library/Application Support/Deck`—should not be able to read your stored clipboard database or binary blobs.
3. **Exposure in transit or on screen:** Data shared between your own Macs over a local network, pasted across untrusted messaging channels, or shown while screen sharing should stay protected.

Each defense below maps directly to one of these surfaces.

## Stopping Sensitive Data Before It Touches Disk

The strongest protection for a secret is never recording it. Whenever the pasteboard updates, [`ClipboardService+Capture.swift`](https://github.com/yuzeguitarist/Deck/blob/f6e922c6e4bf2dfce13b07cf5c759a8526fff29b/Deck/Services/Clipboard/ClipboardService%2BCapture.swift#L112-L147) and [`ClipboardService+SensitiveContent.swift`](https://github.com/yuzeguitarist/Deck/blob/f6e922c6e4bf2dfce13b07cf5c759a8526fff29b/Deck/Services/Clipboard/ClipboardService%2BSensitiveContent.swift#L27-L72) evaluate a four-stage filtering pipeline in milliseconds—ordered from zero-allocation metadata checks to checksum validation:

| Stage | Signal inspected | Implementation |
|---|---|---|
| 1. System & password-manager markers | `org.nspasteboard.ConcealedType`, `com.apple.password`, `com.apple.securetext`, plus Spotlight's `-[NSPasteboard _shouldExcludeFromHistory]` selector | [`DeckPrivatePasteboardEventBridge.m`](https://github.com/yuzeguitarist/Deck/blob/f6e922c6e4bf2dfce13b07cf5c759a8526fff29b/Deck/Services/Clipboard/DeckPrivatePasteboardEventBridge.m#L285-L295) |
| 2. Sensitive window title | Active window title via `AXUIElement` checked against login/secret keywords (`password`, `login`, `token`, `2fa`, `keychain`, `密码`, `验证码`, and more), PID-cached with a 0.4s TTL | [`isSensitiveWindowTitle`](https://github.com/yuzeguitarist/Deck/blob/f6e922c6e4bf2dfce13b07cf5c759a8526fff29b/Deck/Services/Clipboard/ClipboardService%2BSensitiveContent.swift#L139-L158) |
| 3. Bank card numbers | Standalone 13–19 digit sequences matched against Visa, Mastercard, AmEx, UnionPay, Discover, and JCB prefixes, then verified with the Luhn checksum | [`isBankCardNumber`](https://github.com/yuzeguitarist/Deck/blob/f6e922c6e4bf2dfce13b07cf5c759a8526fff29b/Deck/Services/Clipboard/ClipboardService%2BSensitiveContent.swift#L79-L136) |
| 4. Identity documents | Checksum- and context-validated detectors across 7 jurisdictions (China Mainland 18/15-digit, Taiwan ID, Hong Kong ID, German Tax ID, US SSN/ITIN, Passport) | [`ClipboardService+IdentityNumbers.swift`](https://github.com/yuzeguitarist/Deck/blob/f6e922c6e4bf2dfce13b07cf5c759a8526fff29b/Deck/Services/Clipboard/ClipboardService%2BIdentityNumbers.swift#L16-L37) |

In addition, Deck ignores copies from **Passwords** and **Keychain Access** out of the box, lets you add any app to **Ignored Apps**, and strips tracking parameters from copied URLs locally before saving.

For Universal Clipboard items (`com.apple.is-remote-clipboard`) coming from your iPhone or iPad, macOS sets the generic history exclusion flag on all Handoff items—so Deck honors privacy markers (`ConcealedType`, `TransientType`, `AutoGeneratedType`, `com.apple.password`, `com.apple.securetext`) while still allowing ordinary Handoff copies to arrive (`#173`).

## On-Device AES-256-GCM Encryption and Keychain Storage

When you turn on **Biometric Protection** (Security Mode) in **Settings › Privacy & Security**, Deck encrypts your existing history and every future item at rest using **AES-256-GCM** via Apple CryptoKit in [`SecurityService.swift`](https://github.com/yuzeguitarist/Deck/blob/f6e922c6e4bf2dfce13b07cf5c759a8526fff29b/Deck/Services/Security/SecurityService.swift#L277-L383).

- **Keychain-resident master key:** Deck generates a 256-bit symmetric key (`com.deck.encryption` / `master-key`) and stores it in the macOS Keychain with `kSecAttrAccessibleWhenUnlockedThisDeviceOnly`. The key never writes to disk and is never synced off your Mac. To reduce Keychain round-trips during bursts while limiting RAM exposure, the key is cached in memory with a 60-second TTL (`encryptionKeyCacheTTL`) and cleared immediately when authentication resets.
- **Column-level database encryption:** Before writing to SQLite, `data`, `search_text`, `app_name`, `custom_title`, and `embedding` are sealed individually with fresh random nonces and GCM authentication tags, preventing silent tampering.
- **Offloaded blob & context encryption:** Large images or payloads above 512 KB stored as standalone blob files—as well as AI memory and long-form session context notes—are sealed with AES-GCM before touching disk.
- **Direct peer-to-peer LAN encryption:** When you sync between Macs over MultipeerConnectivity or direct IP ([`DirectConnectService.swift`](https://github.com/yuzeguitarist/Deck/blob/f6e922c6e4bf2dfce13b07cf5c759a8526fff29b/Deck/Services/Sync/DirectConnectService.swift#L234-L235)), payloads are encrypted end-to-end with AES-GCM using session keys paired via TOTP verification—no cloud relay sits in the middle.

When Biometric Protection is active, SQLite FTS5 and `sqlite-vec` indexes are emptied and disabled so no plaintext search tokens remain on disk. Search shifts to a bounded in-memory decryption scan ([`searchWithLike`](https://github.com/yuzeguitarist/Deck/blob/f6e922c6e4bf2dfce13b07cf5c759a8526fff29b/Deck/Services/Storage/DeckSQLManager%2BListQueries.swift#L639-L729)), and prepared search caches clear automatically on `NSApplication.willResignActiveNotification` and `NSWorkspace.sessionDidResignActiveNotification`.

## Biometric Gatekeeping and Screen-Share Hygiene

Encryption protects data on disk; physical access controls protect what appears on screen on an unlocked Mac:

- **Touch ID, Face ID, and Optic ID:** [`SecurityService.authenticate`](https://github.com/yuzeguitarist/Deck/blob/f6e922c6e4bf2dfce13b07cf5c759a8526fff29b/Deck/Services/Security/SecurityService.swift#L192-L215) uses `LocalAuthentication` (`deviceOwnerAuthenticationWithBiometrics`, falling back to your Mac login password) before opening the panel, exporting/importing history, clearing data, viewing statistics, or letting `deckclip` CLI / MCP clients read your history. You can keep authentication valid for 5 minutes or require it every time.
- **Hidden from screen sharing and recordings:** Turning off **Show during screen sharing** sets `win.sharingType = .none` in [`MainWindowController.swift`](https://github.com/yuzeguitarist/Deck/blob/f6e922c6e4bf2dfce13b07cf5c759a8526fff29b/Deck/Controllers/MainWindowController.swift#L173-L175), instructing macOS WindowServer to exclude the Deck panel from screen captures, video calls, and presentations.

## Encrypted Steganography for Untrusted Channels

Sometimes you need to move a sensitive note or key through a chat app or image host you do not control. [`SteganographyService.swift`](https://github.com/yuzeguitarist/Deck/blob/f6e922c6e4bf2dfce13b07cf5c759a8526fff29b/Deck/Services/Security/SteganographyService.swift#L55-L86) lets you seal text with AES-GCM under a 14-byte `DECKSTG1` header and embed it into either:

- **Zero-width text:** Encodes ciphertext bits at 2 bits per character across four zero-width Unicode scalars (`U+200B`, `U+200C`, `U+200D`, `U+FEFF`) appended to an ordinary cover sentence.
- **Image LSB (PNG):** Writes encrypted payload bits into the least significant bit of RGB channels across non-transparent pixels (`alpha >= 1`) in lossless PNG images up to 25 MB.

For sharing with someone else, [`SteganographyKeyStore.swift`](https://github.com/yuzeguitarist/Deck/blob/f6e922c6e4bf2dfce13b07cf5c759a8526fff29b/Deck/Services/Security/SteganographyKeyStore.swift#L31-L60) derives a dedicated 256-bit key from your shared passphrase using **HKDF-SHA256** and stores it separately in the Keychain (`com.deck.steganography`), keeping it isolated from your device master key.

## Verifiable Privacy: Read the Code Yourself

Privacy claims should not require blind trust. Here is what never happens without your explicit action:

- **No default telemetry:** **Upload Analytics Data** is off by default. Even when opted in, reports contain only 24-hour memory stats, warning/error log lines, app/macOS versions, locale, device name, and a random ID—never clipboard contents.
- **Explicit network boundaries:** Link previews (which fetch page titles/favicons when you copy a URL) can be disabled in one switch, AI runs only when invoked, and script plugins cannot make network requests unless explicitly declared, user-authorized per script SHA-256 hash, and routed past [`DeckOutboundNetworkPolicy`](https://github.com/yuzeguitarist/Deck/blob/f6e922c6e4bf2dfce13b07cf5c759a8526fff29b/Deck/Core/Security/DeckOutboundNetworkPolicy.swift#L6-L100).
- **Source-available transparency:** The official Deck binary is Developer ID signed and Apple notarized, and the entire codebase is public for inspection on [GitHub](https://github.com/yuzeguitarist/Deck/tree/f6e922c6e4bf2dfce13b07cf5c759a8526fff29b/Deck/Services/Security).

You can also read our [Privacy Policy](https://deckclip.app/privacy) and [Security Policy](https://deckclip.app/security), or [download Deck for macOS](https://deckclip.app/download) free for personal and commercial use.

---

- HTML: https://deckclip.app/newsroom/privacy-security
- 中文: https://deckclip.app/zh-cn/newsroom/privacy-security.md

© 2026 Yuze Pan
