AirPlay

AirPlay is the marketing name of Apple's technology for streaming audio and video between iTunes and iOS devices. It is an evolution of AirTunes that was limited to streaming audio from iTunes to Airport Express base stations.

Audio-only content is streamed by using the AirTunes / RAOP technology. Video/photo content is based on HTTP live streaming.

AirPlay was first introduced in iOS 4.2. Early developer builds had the feature integrated in all apps using the standard video controller, but in the final release it was limited to the iPod (Videos on iPod touch and iPad) and YouTube apps. However, it is possible to enable AirPlay in 3rd party apps on jailbroken devices.

Currently the only supported target for video/photo streaming is 2nd gen Apple TV, while other companies are expected to release compatible products in the future.

Mac users can download AirPlayer by Erica Sadun that can receive video from an iOS device. It is quite buggy at the moment, does not support audio, DRM-protected video, or iTunes as a source, but it's still an important achievement as the first independent implementation of AirPlay.

Encryption
AirPlay / AirTunes uses public-private-key cryptographic schemes to ensure that only valid devices 'talk' to each other.

There are 2 schemes in place:
 * 1) Only valid software (iTunes) can send content.
 * 2) * This was hacked by Jon Lech Johansen in August, 2004. This allowed "invalid" (other than iTunes) software - e.g. ALSA under Linux - to stream audio to 'valid' AirPort Express devices.
 * 3) Only valid devices (Apple TV & Airport Express) can receive content.
 * 4) * This scheme was hacked by James Laird in 2011, allowing "valid" software (iTunes) to stream audio to 'invalid' devices - e.g. a Linux system running Shairport.

RSA public key stored in iTunes
AirPort Express RSA Public Key, Modulus: 59dE8qLieItsH1WgjrcFRKj6eUWqi+bGLOX1HL3U3GhC/j0Qg90u3sG/1CUtwC 5vOYvfDmFI6oSFXi5ELabWJmT2dKHzBJKa3k9ok+8t9ucRqMd6DZHJ2YCCLlDR KSKv6kDqnw4UwPdpOMXziC/AMj3Z/lUVX1G7WSHCAWKf1zNS1eLvqr+boEjXuB OitnZ/bDzPHrTOZz0Dew0uowxf/+sG+NCK3eQJVxqcaJ/vEHKIVd2M+5qL71yJ Q+87X6oV3eaYvt3zWZYD6z5vYTcrtij2VZ9Zmni/UAaHqn9JdsBWLUEpVviYnh imNVvYFZeCXg/IdTQ+x4IRdiXNv5hEew==

Exponent:

By using this key any app can stream audio to an AirPort Express, but the music stays encrypted on the network.

RSA private key stored in AirPort Express
-BEGIN RSA PRIVATE KEY- MIIEpQIBAAKCAQEA59dE8qLieItsH1WgjrcFRKj6eUWqi+bGLOX1HL3U3GhC/j0Qg90u3sG/1CUt wC5vOYvfDmFI6oSFXi5ELabWJmT2dKHzBJKa3k9ok+8t9ucRqMd6DZHJ2YCCLlDRKSKv6kDqnw4U wPdpOMXziC/AMj3Z/lUVX1G7WSHCAWKf1zNS1eLvqr+boEjXuBOitnZ/bDzPHrTOZz0Dew0uowxf /+sG+NCK3eQJVxqcaJ/vEHKIVd2M+5qL71yJQ+87X6oV3eaYvt3zWZYD6z5vYTcrtij2VZ9Zmni/ UAaHqn9JdsBWLUEpVviYnhimNVvYFZeCXg/IdTQ+x4IRdiXNv5hEewIDAQABAoIBAQDl8Axy9XfW BLmkzkEiqoSwF0PsmVrPzH9KsnwLGH+QZlvjWd8SWYGN7u1507HvhF5N3drJoVU3O14nDY4TFQAa LlJ9VM35AApXaLyY1ERrN7u9ALKd2LUwYhM7Km539O4yUFYikE2nIPscEsA5ltpxOgUGCY7b7ez5 NtD6nL1ZKauw7aNXmVAvmJTcuPxWmoktF3gDJKK2wxZuNGcJE0uFQEG4Z3BrWP7yoNuSK3dii2jm lpPHr0O/KnPQtzI3eguhe0TwUem/eYSdyzMyVx/YpwkzwtYL3sR5k0o9rKQLtvLzfAqdBxBurciz aaA/L0HIgAmOit1GJA2saMxTVPNhAoGBAPfgv1oeZxgxmotiCcMXFEQEWflzhWYTsXrhUIuz5jFu a39GLS99ZEErhLdrwj8rDDViRVJ5skOp9zFvlYAHs0xh92ji1E7V/ysnKBfsMrPkk5KSKPrnjndM oPdevWnVkgJ5jxFuNgxkOLMuG9i53B4yMvDTCRiIPMQ++N2iLDaRAoGBAO9v//mU8eVkQaoANf0Z oMjW8CN4xwWA2cSEIHkd9AfFkftuv8oyLDCG3ZAf0vrhrrtkrfa7ef+AUb69DNggq4mHQAYBp7L+ k5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