axiomatic-systems / Bento4

Full-featured MP4 format, MPEG DASH, HLS, CMAF SDK and tools
http://www.bento4.com
2.02k stars 482 forks source link

Non compliant Cbc1 encryption of HEVC files (Encryption applied to NALU portions which must be in the clear) #503

Open foosoftsrlold opened 4 years ago

foosoftsrlold commented 4 years ago

While building a Dash validator, we noted that bento is not correctly encrypting hevc content when using cbc1 scheme. The problem seems to apply both to non-VCL and VCL Nalus .

This is how to replicate (only for VCL nalus)

ffmpeg -f lavfi -i testsrc=size=352x288 -t 30 -g 25 -pix_fmt yuv420p -vcodec libx265 -movflags empty_moov+default_base_moof+frag_keyframe testsrc.mp4

Bento4-SDK-1-6-0-634.x86_64-unknown-linux/bin/mp4dash -o bento-hevc-sample-cbc1 -f --encryption-key=000102030405060708090a0b0c0d0e0f:75c5709c3f058d4f3680e8c2ad47d8ec:d5fbd6b82ed93e4ef98ae40931ee33b7 --encryption-cenc-scheme=cbc1 testsrc.mp4

We noted the problem also on SPS / PPS / VPS, but in another setup.

Hope I'm not wrong....

barbibulle commented 4 years ago

You're right, I will fix this shortly.