HomeKit communication security
HomeKit provides a home automation infrastructure that uses iCloud and device security features to protect and sync private data without exposing it to Apple.
HomeKit identity and security are based on Ed25519 public-private key pairs. An Ed25519 key pair is generated on the user’s device, which becomes their HomeKit identity. The key pair is used as part of the HomeKit Accessory Protocol (HAP) to authenticate direct communication between the user’s Apple devices and their HomeKit accessories.
For homes where there is a home hub, members of the shared home can send commands to accessories through this home hub. These commands are sent, end-to-end encrypted and authenticated, from the user’s device to the home hub using Apple Identity Service (IDS), where they are forwarded to the relevant accessory using the HomeKit Accessory Protocol (HAP) or Matter, a smart home connectivity standard.
The keys — stored in keychain and included only in encrypted keychain backups — are kept up to date between devices using iCloud Keychain.
Communication between HomeKit accessories
HomeKit accessories generate their own Ed25519 key pair for use in communicating with Apple devices. If the accessory is restored to factory settings, a new key pair is generated.
To establish a relationship between an Apple device and a HomeKit accessory, keys are exchanged using the Secure Remote Password (3072-bit) protocol with an eight-digit code provided by the accessory’s manufacturer, entered on the user’s device, and then encrypted using ChaCha20-Poly1305 AEAD with HKDF-SHA512 derived keys. The accessory’s MFi certification is also verified during setup. Accessories without an MFi chip can build in support for software authentication in iOS 11.3 or later.
When the device and the HomeKit accessory communicate during use, each authenticates the other using the keys exchanged in the above process. Each session is established using the Station-to-Station protocol and is encrypted with HKDF-SHA512 derived keys based on per-session Curve25519 keys. This applies to both IP-based and Bluetooth Low Energy (BLE) accessories.
For BLE devices that support broadcast notifications, the accessory is provisioned with a broadcast encryption key by a paired device over a secure session. This key is used to encrypt the data about state changes on the accessory, which are notified using the BLE advertisements. The broadcast encryption key is an HKDF-SHA512 derived key, and the data is encrypted using the ChaCha20-Poly1305 AEAD algorithm. The broadcast encryption key is periodically changed and updated on other devices using iCloud, as described in HomeKit data security.
Communication with Matter accessories
Identity and security with Matter accessories are certificate based. For Apple homes, the root of trust Certificate Authority (CA) is generated on the initial user’s device (the “owner”), and the private key for the CA is stored in their iCloud Keychain. Each Apple device in the home generates a Certificate Signing Request (CSR) using NIST P256. This CSR is ingested by the owner’s device, which creates a Matter identity certificate for the device using their CA private key. This certificate is subsequently used to authenticate communication between users’ devices and their accessories.
Matter accessories generate their own NIST P256 key pair and CSR and receive a certificate from the CA during accessory pairing. Before the key pairs are generated, the Matter accessory and the home owner’s devices exchange keys — using the SPAKE2+ protocol with a PIN provided by the accessory’s manufacturer — and a Device Attestation process is performed. The CSR and certificate are then exchanged over this channel, encrypted using AES-CCM with HKDF-SHA256 derived keys. If the accessory is restored to factory settings, a new key pair and CSR are generated and a new certificate is issued for the accessory during pairing.
When an Apple device and the Matter accessory communicate during use, each authenticates the other using their own certificates. Each session is established using a three-phase (sigma) protocol and is encrypted with HKDF-SHA256 derived keys based on per-session P256 keys.
For more information about how Apple devices interact securely with Matter accessories, see Matter support in iOS 16 on the Apple Developer website.
HomeKit and Siri
Siri can be used to query and control accessories and to activate scenes. Minimal information about the configuration of the home is provided anonymously to Siri, to provide names of rooms, accessories and scenes that are necessary for command recognition. Audio sent to Siri may denote specific accessories or commands but such Siri data isn’t associated with other Apple features such as HomeKit.
Siri-enabled HomeKit accessories
Users can enable new features like Siri, and other HomePod features like timers, alarms, intercom and doorbell, on Siri-enabled accessories using the Home app. When these features are enabled, the accessory coordinates with a paired HomePod on the local network that hosts these Apple features. Audio is exchanged between the devices over encrypted channels using both HomeKit and AirPlay protocols.
When Listen for Hey Siri is turned on, the accessory listens for the “Hey Siri” phrase using a locally running trigger-phrase detection engine. If this engine detects the phrase, it sends the audio frames directly to a paired HomePod using HomeKit. The HomePod does a second check on the audio and may cancel the audio session if the phrase doesn’t appear to contain the trigger phrase.
When Touch for Siri is turned on, the user can press a dedicated button on the accessory to start a conversation with Siri. The audio frames are sent directly to the paired HomePod.
After a successful invocation of Siri is detected, the HomePod sends the audio to Siri servers and fulfils the user’s intent using the same security, privacy and encryption safeguards that the HomePod applies to user invocations made to the HomePod itself. If Siri has an audio reply, then Siri’s response is sent over an AirPlay audio channel to the accessory. Some Siri requests require additional information from the user (for example, asking if they want to hear more options). In that case, the accessory receives an indication that the user should be prompted, and the additional audio is streamed to the HomePod.
The accessory is required to have a visual indicator to signal to a user when it’s actively listening (for example, an LED indicator). The accessory has no knowledge of the intent of the Siri request, except for access to the audio streams, and no user data is stored on the accessory.