Magic Switch is a free, open-source macOS utility that lets an Apple Magic Keyboard, Trackpad, or Mouse be switched between two Macs without using a shared Apple ID or physically re-pairing over USB. It solves the common problem that Apple’s Bluetooth peripherals are “sticky” - they refuse to connect cleanly to more than one machine and normally require a USB re-pair or Apple Account linking. Building on a proof-of-concept called blue-switch, Magic Switch provides a polished menu-bar UI and a reliable handoff protocol so you can request or send individual peripherals, confirm availability before changing Bluetooth state, and never leave devices stranded on neither machine.
Security and resilience are core features: pairing uses a 12-character out-of-band code to derive a PSK via PBKDF2-HMAC-SHA256 (600k iterations), per-connection HKDF-derived session keys with nonces and transcript HMACs, and ChaCha20-Poly1305 sealed messages with monotonic nonces to prevent replay. The app rate-limits crypto failures, enforces idle and total connection budgets, and canonicalizes IPs. Practical niceties include fingerprint confirmation on pairing, single-device handoffs, automatic reconnection if peripherals get “stuck,” and configurable behavior for sleep or clamshell modes (handoff to the other Mac or de-pair). Source and builds are available on GitHub.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.