努力用Bento4工具解密CENC编码的文件

时间:2016-09-17 09:42:10

标签: encryption mpeg-dash bento

我有一个我在CENC加密的文件,我现在尝试使用来自bento4 mp4decrypt工具的mp4decrypt对其进行解密。该文件由mp4文件中的单个h264轨道组成。这是mp4info --verbose

的输出
File:
major brand:      dash
minor version:    0
compatible brand: iso6
compatible brand: dash
Movie:
 duration:   0 ms
 time scale: 120000
 fragments:  yes

Found 1 Tracks
Track 1:
flags:        7 ENABLED IN-MOVIE IN-PREVIEW
id:           1
type:         Video
duration: 0 ms    
language: und
media:
sample count: 0
timescale:    120000
duration:     0 (media timescale units)
duration:     0 (ms)
bitrate (computed): 6386.097 Kbps
display width:  1920.000000
display height: 817.021271
Sample Description 0
[ENCRYPTED]
  Coding:         encv
  Scheme Type:    cenc
  Scheme Version: 65536
  Scheme URI:
Protection System Details:
[schi] size=8+32
  [tenc] size=12+20
    default_AlgorithmID = 1
    default_IV_size = 8
    default_KID = [23 b6 70 1b e9 8b 4e ea 80 4e 9b 59 6c 59 37 a5]
Bytes: 0000000000000001000000000000000000000000000000000780033000480000004800000000000000010a41564320436f64696e670000000000000000000000000000000000000000000018ffff000000476176634301640028ffe1002e67640028acc8501e019effc0c7c0c81a808080a000007d200017701c00000301c9c380000773595359803c60c65801000668e938233c8f
Coding:      avc1 (H.264)
Width:       1920
Height:      816
Depth:       24
AVC Profile:          100 (High)
AVC Profile Compat:   0
AVC Level:            40
AVC NALU Length Size: 4
AVC SPS: [67640028acc8501e019effc0c7c0c81a808080a000007d200017701c00000301c9c380000773595359803c60c658]
AVC PPS: [68e938233c8f]
Codecs String: avc1.640028

所以要使用上面的密钥解密它,我肯定会这样做:

mp4decrypt --key 1:23b6701be98b4eea804e9b596c5937a5 --show-progress input.mp4 output.mp4

MP4 Decrypter - Version 1.4
(Bento4 Version 1.5.0.0)
(c) 2002-2015 Axiomatic Systems, LLC
usage: mp4decrypt [options] <input> <output>
Options are:
--show-progress : show progress details
--key <id>:<k>
  <id> is either a track ID in decimal or a 128-bit KID in hex,
  <k> is a 128-bit key in hex
  (several --key options can be used, one for each track or KID)
  note: for dcf files, use 1 as the track index
  note: for Marlin IPMP/ACGK, use 0 as the track ID
  note: KIDs are only applicable to some encryption methods like MPEG-CENC
  --fragments-info <filename>
  Decrypt the fragments read from <input>, with track info read
  from <filename>.

我得到的只是命令行上的零输出,输出文件仍然无法播放。

有什么想法吗?视频轨道用于整个文件,它本身不会分割成段。

1 个答案:

答案 0 :(得分:0)

您正尝试使用密钥ID而不是密钥本身来破译文件。 “23 b6 70 1b e9 8b 4e ea 80 4e 9b 59 6c 59 37 a5”是密钥的标识符,而不是密钥本身。当然你不会破译。它位于文件中,以便DRM系统检索密钥(发送或搜索keyID以获取密钥本身作为回报)。 尝试使用键值进行解密。 您的mp4encrypt命令应该与以下选项一起使用: --key 1 :: 0000000000000000 因为你的IV大小是8