https://www.youtube.com/watch?v=6t6Si0BWCOo
DRM
Digital Rights Management,
-
“ ”
https://www.clien.net/service/board/park/13087716
DRM is
Very important
https://developer.apple.com/streaming/
https://tools.ietf.org/html/rfc8216
https://tools.ietf.org/html/rfc8216#section-6.2.3
https://tools.ietf.org/html/rfc8216#section-6.3.6
https://tools.ietf.org/html/rfc8216
https://tools.ietf.org/html/rfc8216#section-6.2.3
https://tools.ietf.org/html/rfc8216#section-6.3.6
HTTP Live Streaming
6.2.3. Encrypting Media Segments
6.3.6. Decrypting Encrypted Media Segments
https://tools.ietf.org/html/rfc8216#section-4.3.2.4
https://bitmovin.com/docs/encoding/faqs/what-is-hls-aes-encryption
METHOD
AES-128 SAMPLE-AES.
https://tools.ietf.org/html/rfc8216#section-4.3.2.4
https://bitmovin.com/docs/encoding/faqs/what-is-hls-aes-encryption
METHOD
URI
IV
KEYFORMAT
KEYFORMATVERSIONS
Streaming Protocol
HLS
Media Encryption
(AES-128, SAMPLE-AES)
DRM
Let’s Do It
https://www.bento4.com
$ openssl rand 16 > key.bin
16
$ xxd -ps key.bin
6f9a136bd1f95872e78ae49870a08140
https://www.tutorialspoint.com/unix_commands/xxd.htm
AES-128
MP42HLS
$ mp42hls 
--encryption-key 544cb873 … c0 `# 16 ` 
--encryption-key-uri key.bin `# URI` 
--encryption-mode AES-128 `# ` 
--encryption-iv-mode sequence `# ` 
--encryption-key-format identity `# ` 
./bunny.mp4
https://www.bento4.com/documentation/mp42hls/
stream.m3u8
$ openssl rand 32 > key.bin
16
$ xxd -ps key.bin
31cfac676e77e3aed1c23799c7d21cf80d5524960b34e … fcf37
e816
SAMPLE-AES
MP42HLS
$ mp42hls 
--encryption-key 31cfac676 … 16 `# 16 ` 
--encryption-key-uri key.bin `# URI` 
--encryption-mode SAMPLE-AES `# ` 
--encryption-iv-mode sequence `# ` 
--encryption-key-format identity `# ` 
./bunny.mp4
stream.m3u8
1
Request stream.m3u8
ClientContent Server
1
ClientContent Server
Check authorization
2
1
ClientContent Server
2
3
Response stream.m3u8
1
Content Server
2
3
4
Request key.bin
Client
1
Content Server
2
3
4
5
Check authorization
Client
1
Content Server
2
3
4
5
6
Response key.bin
Client
1
Content Server
2
3
4
5
6
7
Decrypting media
Client
It is
low level
DRM
DRM 



?
https://developer.apple.com/streaming/fps/
What is FairPlay Streaming?
A delivery mechanism for secure keys that are protected on both the
network and client
Will only work with protected HDMI for external outputs
Delivery of keys is server agnostic and can work with existing key
infrastructure, streamlining implementation
FairPlay Streaming does not provide DRM rights, enforce policies,
authenticate users, or authorize devices
https://www.encoding.com/apple-fairplay/
MP42HLS
$ mp42hls 
--encryption-key 31cfac676 … 16 
--encryption-key-uri skd://cid 
--encryption-mode SAMPLE-AES 
--encryption-iv-mode fps 
--encryption-key-format com.apple.streamingkeydelivery 
./bunny.mp4
stream.m3u8
FairPlay .
https://h2k.co/8M
https://h2k.co/8M
AVFoundation HLS
https://h2k.co/8M
AVFoundation KEY m3u8
https://h2k.co/8M
AVFoundation
https://h2k.co/8M
AVFoundation FPS
https://h2k.co/8M
FPS SPC
https://h2k.co/8M
FPS KSM SPC CK
https://h2k.co/8M
FPS KSM Content Key Context
https://h2k.co/8M
CKC AVFoundation
https://h2k.co/8M
AVFoundation
KSM
AVFoundation Delegate
SPC(Server Playback Context)
CKC(Content Key Context)
?
https://www.w3.org/TR/encrypted-media/
EME FairPlay ?
NOPE
https://www.w3.org/TR/encrypted-media/
CDM
.
Content Decryption Module
JavaScript
VideoPlayer
CDM
Media

Stack
EME
Internet
Server
Generate request for get security key
Decrypting media
JavaScript
VideoPlayer
Media Stack
CDM CDM CDM CDM
JavaScript API Call
EME
JavaScript
VideoPlayer
Media Stack
JavaScript API Call
EME
Widevine FairPlay PlayReady
(and Widevine)
PrimeTime
https://bitmovin.com/docs/player/articles/browser-drm-support
How to Detecting CDM
KeySystem
Widevine : com.widevine.alpha
PlayReady : com.microsoft.playready
com.youtube.playready
PrimeTime : com.adobe.primetime
com.adobe.access
FairPlay: com.apple.fairplay
https://stackoverflow.com/questions/35086625/determine-drm-system-supported-by-browser/35130190
try {
navigator
.requestMediaKeySystemAccess('com.widevine.alpha', config)
.then(() => console.log('widevine support ok'))
.catch(() => console.log('no widevine support'));
} catch (err) {
console.log('no widevine support');
}
(new window.WebKitMediaKeys('com.apple.fps.1_0')).keySystem;
https://www.radiantmediaplayer.com/blog/detecting-eme-cdm-browser.html
https://h2k.co/8M
‘webkitneedkey’
https://h2k.co/8M
keySession ‘webkitkeymessage'
https://h2k.co/8M
‘webkitkeymessage' SPC
https://h2k.co/8M
SPC
https://h2k.co/8M
Key Server CKC keySession
https://h2k.co/8M
HLS DASH ETC
Media Source Extensions
Streaming protocol
Widevine FairPlay ETC
Key delivery mechanism
Encrypted Media Extensions
+
High Secure DRM
CDM
JavaScript
Application
VideoElement
addEventListener()

`encrypted`
or `webkitneedkey`
MediaSource
MSE
Internet
EME
MediaStack
CDM
JavaScript
Application
VideoElement
MediaSource
MSE
create
attach
Internet
EME
MediaStack
addEventListener()

`encrypted`
or `webkitneedkey`
CDM
JavaScript
Application
VideoElement
MediaSource
MSE
create
attach
Internet
EME
MediaStack
request playlist and media segment
response
addEventListener()

`encrypted`
or `webkitneedkey`
CDM
JavaScript
Application
VideoElement
MediaSource
MSE
create
attach
Internet
EME
MediaStack
request playlist and media segment
response
appendBuffer()
addEventListener()

`encrypted`
or `webkitneedkey`
CDM
JavaScript
Application
VideoElement
MediaSource
MSE
create
attach
Internet
EME
MediaStack
request playlist and media segment
response
appendBuffer()
encrypted
addEventListener()

`encrypted`
or `webkitneedkey`
CDM
JavaScript
Application
VideoElement
MediaSource
MSE
create
attach
Internet
EME
MediaStack
request playlist and media segment
response
appendBuffer()
encrypted
createSession()
addEventListener()

`encrypted`
or `webkitneedkey`
CDM
JavaScript
Application
VideoElement
MediaSource
MSE
create
attach
Internet
EME
MediaStack
request playlist and media segment
response
appendBuffer()
encrypted
createSession()
KeySession
addEventListener()

`encrypted`
or `webkitneedkey`
CDM
JavaScript
Application
VideoElement
addEventListener()

`encrypted`
or `webkitneedkey`
MediaSource
MSE
create
attach
Internet
EME
MediaStack
request playlist and media segment
response
appendBuffer()
encrypted
createSession()
KeySession
addEventListener()
`message`
generateRequest()
CDM
JavaScript
Application
VideoElement
addEventListener()

`encrypted`
or `webkitneedkey`
MediaSource
MSE
create
attach
Internet
EME
MediaStack
request playlist and media segment
response
appendBuffer()
encrypted
createSession()
KeySession
addEventListener()
`message`
generateRequest()
message with SPC
CDM
JavaScript
Application
VideoElement
addEventListener()

`encrypted`
or `webkitneedkey`
MediaSource
MSE
create
attach
Internet
EME
MediaStack
request playlist and media segment
response
appendBuffer()
encrypted
createSession()
KeySession
addEventListener()
`message`
generateRequest()
message with SPC
request license(or CKC)
response
JavaScript
Application
VideoElement
addEventListener()

`encrypted`
or `webkitneedkey`
MediaSource
MSE
create
attach
Internet
CDM
EME
MediaStack
request playlist and media segment
response
appendBuffer()
encrypted
createSession()
KeySession
addEventListener()
`message`
generateRequest()
message with SPC
request license(or CKC)
response
update(license - or CKC -)
(decrypting…)
• HTTP Live Streaming : https://tools.ietf.org/html/rfc8216
• Video on demand (VOD) HLS PC : https://qiita.com/khagi/items/
6e8c8d10c77bee53487b
• Bento4 : https://www.bento4.com/
• HTTP Live Streaming : https://www.bento4.com/developers/hls/
• MP42HLS(Bento4) : https://www.bento4.com/documentation/mp42hls/
• FairPlay Streaming : https://developer.apple.com/streaming/fps/
• The Complete Guide to Apple Fairplay : https://www.encoding.com/
apple-fairplay/
• Debugging FairPlay Streaming : https://developer.apple.com/library/
content/technotes/tn2454/_index.html
• How to integrate a basic HLS stream with FairPlay : https://
www.icapps.com/blog/how-integrate-basic-hls-stream-fairplay
• JW Player Configuration Reference : https://developer.jwplayer.com/jw-
player/docs/developer-guide/customization/configuration-reference/
• JW Player Stream Tester : https://developer.jwplayer.com/tools/stream-
tester/?playerversion=8
• Browser DRM Support : https://bitmovin.com/docs/player/articles/
browser-drm-support
• videojs-contrib-eme/fireplay : https://github.com/videojs/videojs-
contrib-eme/blob/master/src/fairplay.js
• Detecting EME and CDM support in a browser for DASH DRM : https://
www.radiantmediaplayer.com/blog/detecting-eme-cdm-browser.html
• WWDC15 Media - Apple : https://devstreaming-cdn.apple.com/videos/
wwdc/2015/502sufwcpog/
502/502_content_protection_for_http_live_streaming.pdf?dl=1
• Encrypted Media Extensions : https://www.w3.org/TR/encrypted-media/
• DRM videos now on Safari iOS : https://www.theoplayer.com/blog/apple-
brings-safari-browser-fairplay-drm
• What is EME? : https://developers.google.com/web/fundamentals/
media/
eme#related_technology_2_dynamic_adaptive_streaming_over_http_das
h
• HLS Streaming, HLS Encryption & Setting High Secure DRM : https://
www.vdocipher.com/blog/2017/08/hls-streaming-hls-encryption-secure-
hls-drm/
• videojs/videojs-contrib-eme : https://github.com/videojs/videojs-contrib-
eme
• W3C, DRM 'EME' : https://m.zdnet.co.kr/news_view.asp?
article_id=20171001112609
.

스트리밍과 디지털 권리 관리