{"id":58836,"date":"2023-10-05T11:55:26","date_gmt":"2023-10-05T06:25:26","guid":{"rendered":"https:\/\/www.tothenew.com\/blog\/?p=58836"},"modified":"2023-10-12T12:03:59","modified_gmt":"2023-10-12T06:33:59","slug":"cracking-the-code-apples-drm-technology-part-1","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/cracking-the-code-apples-drm-technology-part-1\/","title":{"rendered":"Cracking the code: Apple\u2019s DRM Technology (Part-1)"},"content":{"rendered":"<h2><strong>Introduction to Fairplay DRM<\/strong><\/h2>\n<p><strong>&#8220;Fairplay DRM&#8221;<\/strong> is basically Apple&#8217;s Digital rights management technology. Fairplay is also known as Fairplay Streaming (FPS), whose main role is securely delivering the encrypted contents through HTTP Live Streaming Protocol. It prevents video download as well as ensures screen recording protection when protected content is streaming.<\/p>\n<p>In other words, Fairplay is used to stream the content securely on the iOS app, macOS app, and tvOS app. Fairplay DRM supports Apple\u2019s wireless content delivery protocol, &#8220;Airplay.&#8221;<\/p>\n<p>The content can be played on Apple devices and Operating Systems using Airplay without any additional encoding or decryption. This content maintains an equivalent level of security to that experienced when played on its original devices, like iPhones.<\/p>\n<h2><b>FairPlay DRM History<\/b><\/h2>\n<p>Fairplay DRM was originally developed by Veridisc. It was later adopted by Apple. And now known as Fairplay DRM.<\/p>\n<p>Initially, Fairplay was used by Apple for audio file protection in iTunes. But later on, Fairplay was started to protect audio and video files.<\/p>\n<h2><b>What is FairPlay Streaming Server(FPS)<\/b><\/h2>\n<p>FPS is integrated into the device operating system, which supports Apple mobile devices(iPhone\/iPad) and AppleTv. Safari on Mac OS enables Fair Play Streaming using EME interface support.<\/p>\n<p>FPS&#8217;s main role is to deliver the keys to Apple mobile devices, AppleTV, and Safari on OS, which enables playback of encrypted video content.<\/p>\n<h2><strong>Fairplay Compatibility with different Apple devices OS<\/strong><\/h2>\n<p><strong>Mobile-<\/strong><\/p>\n<ul>\n<li><em><strong>iOS Native App:<\/strong>\u00a0iOS 9.0 or later<\/em><\/li>\n<li><em><strong>iOS Safari browser:\u00a0<\/strong>11.2 or later<\/em><\/li>\n<li><em><strong>iPad OS:<\/strong>\u00a013.1 or later<\/em><\/li>\n<\/ul>\n<p><strong>AppleTV-<\/strong><\/p>\n<ul>\n<li><em><strong>tvOS:<\/strong>\u00a010.0 or later<\/em><\/li>\n<\/ul>\n<p><strong>PC-<\/strong><\/p>\n<ul>\n<li><em><strong>macOS afari browser:<\/strong>\u00a010.10 or later<\/em><\/li>\n<\/ul>\n<p><strong>Apple Watch-<\/strong><\/p>\n<ul>\n<li><em><strong>Watch OS<\/strong>\u00a0: 7 or later<\/em><\/li>\n<\/ul>\n<p><strong>Features of Fairplay DRM<\/strong><\/p>\n<ul>\n<li>Audio &amp; Video Protection<\/li>\n<li>Offline Playback<\/li>\n<li>Apple Airplay Support<\/li>\n<\/ul>\n<h2><strong>Working Of FairPlay DRM<\/strong><\/h2>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-58835\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/09\/3_-1024x421.png\" alt=\"\" width=\"2479\" height=\"1020\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/09\/3_-1024x421.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2023\/09\/3_-300x123.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/09\/3_-768x316.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/09\/3_-1536x632.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2023\/09\/3_-624x257.png 624w, \/blog\/wp-ttn-blog\/uploads\/2023\/09\/3_.png 2046w\" sizes=\"(max-width: 2479px) 100vw, 2479px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p class=\"p1\"><span class=\"s1\"><b>1. <\/b>The Client app notifies the device Operating System\u2019s AVFoundation framework to play FPS content.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\"><b>2. <\/b>AVFoundation framework downloads the Manifest file m3u8 from the content server. and parse it internally.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\"><b>3. <\/b>AVFoundation parses it internally<b> <\/b>and searches for \u201cEXT-X-KEY\u201d <b>or<\/b> <i>\u201c#EXT-X-SESSION-KEY:METHOD=\u201d<\/i> tag to see whether the content is encrypted or not.<span class=\"Apple-converted-space\">\u00a0 <\/span>if its value is <i>\u201cSAMPLE-AES\u201d <\/i>then this content is encrypted.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\"><b><i>Note:<\/i><\/b><i> <\/i><\/span><\/p>\n<blockquote>\n<p class=\"p1\"><span class=\"s1\"><b>METHOD<\/b><i> attribute<\/i> tells the player which encryption method is being used to encrypt this content. If the content is not encrypted then the value would be <b>METHOD=NONE<\/b>, For AES-128 encryption, the value would be <b>\u201cMETHOD=AES-128\u201d.<\/b><\/span><\/p>\n<\/blockquote>\n<p class=\"p1\"><span class=\"s1\"><b>4. <\/b>If the content is protected, then AVFoundation\/OS requests for FPS Key to the client application<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\"><b>5. <\/b>In this phase, the Application provides the contentId and DRM-Certificate data to AVFoundation\/OS to prepare the Server Playback Context (SPC).<\/span><\/p>\n<p class=\"p3\"><span class=\"s2\"><b>6. <\/b>In<b> <\/b><\/span><span class=\"s1\">This phase, the OS creates a server playback context (SPC). FPS protects the Server Playback Context (SPC) with the content provider\u2019s RSA public key. A number of verifications are performed by FPS to check the content provider\u2019s certificate before exchanging encrypted media.<\/span><\/p>\n<p class=\"p3\"><span class=\"s2\"><b>7. <\/b><\/span><span class=\"s1\">In this phase, the application sends an SPC message to the Key Server to prepare the CKC<b> (Content Key Context). <\/b><\/span><\/p>\n<p class=\"p3\"><span class=\"s2\"><b>8. <\/b><\/span><span class=\"s1\">Key server modules read the <b>SPC <\/b>(Server Playback Context) message from the CKC and revert back it to the app. Generally, in this phase, KSM<b> <\/b>(Key Server Module) wraps the content key and the initialization vector according to the FPS specification. Next, the server creates a Content key context in response to the application that contains the content key and the initialization vector.<\/span><\/p>\n<p class=\"p5\"><span class=\"s1\"><b>9. <\/b>The client application then provides CKC to the device OS to request a play context. <\/span>AVFoundation\/OS decrypts and plays content securely using keys contained in CKC data.<\/p>\n<p>Stay tuned for the next part of this blog series with the Code snippets.<\/p>\n<div class=\"ap-custom-wrapper\"><\/div><!--ap-custom-wrapper-->","protected":false},"excerpt":{"rendered":"<p>Introduction to Fairplay DRM &#8220;Fairplay DRM&#8221; is basically Apple&#8217;s Digital rights management technology. Fairplay is also known as Fairplay Streaming (FPS), whose main role is securely delivering the encrypted contents through HTTP Live Streaming Protocol. It prevents video download as well as ensures screen recording protection when protected content is streaming. In other words, Fairplay [&hellip;]<\/p>\n","protected":false},"author":1411,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":372},"categories":[1400,3477,1772,4683],"tags":[5481,5484,5485,5482,5480,4848,5483,3116,3629],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/58836"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/1411"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=58836"}],"version-history":[{"count":3,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/58836\/revisions"}],"predecessor-version":[{"id":59228,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/58836\/revisions\/59228"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=58836"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=58836"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=58836"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}