Audio/video stream recording forums (http://stream-recorder.com/forum/index.php)
-   Video stream recording (http://stream-recorder.com/forum/forumdisplay.php?f=4)
-   -  

How to Decrypt .ts Files (Key is available)

(http://stream-recorder.com/forum/showthread.php?t=23265)

MoonLaf 07-13-2017 12:26 AM

How to Decrypt .ts Files (Key is available)


 
Hi,

I have a Sat Box on which there is a service to download movies/series from the internet into the hard disk inside the Sat Box.

I managed to obtain the downloading link for one of the movies/series and downloaded it to my hard disk.

There was a decryption file key along with the downloaded movie file.

I would like to ask now if there is a way to De-crypt this video file based on the available key file.

I can watch the video file on VLC or MPC, but it is scrambled.

Below is the details of this video file from Media Info:

Code:

General
ID                                      : 0 (0x0)
Complete name                            : D:\!Temp\Temp_DL.nds
Format                                  : MPEG-TS
File size                                : 977 MiB
Duration                                : 20 min 41 s
Overall bit rate mode                    : Variable
Overall bit rate                        : 6 598 kb/s
FileExtension_Invalid                    : ts m2t m2s m4t m4s tmf ts tp trp ty

Video
ID                                      : 2064 (0x810)
Menu ID                                  : 1 (0x1)
Format                                  : AVC
Format/Info                              : Advanced Video Codec
Format profile                          : High@L4.1
Format settings, CABAC                  : Yes
Format settings, RefFrames              : 2 frames
Codec ID                                : 27
Duration                                : 29 s 40 ms
Bit rate mode                            : Constant
Bit rate                                : 6 000 kb/s
Width                                    : 1 920 pixels
Height                                  : 1 080 pixels
Display aspect ratio                    : 16:9
Frame rate                              : 25.000 FPS
Standard                                : PAL
Color space                              : YUV
Chroma subsampling                      : 4:2:0
Bit depth                                : 8 bits
Scan type, store method                  : Separated fields
Scan order                              : Top Field First
Bits/(Pixel*Frame)                      : 0.116
Stream size                              : 20.8 MiB (2%)
Encryption                              : Encrypted
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                : BT.709
Matrix coefficients                      : BT.709

Audio #1
ID                                      : 2068 (0x814)
Menu ID                                  : 1 (0x1)
Format                                  : MPEG Audio
Format version                          : Version 1
Format profile                          : Layer 2
Codec ID                                : 4
Duration                                : 20 min 39 s
Bit rate mode                            : Constant
Bit rate                                : 128 kb/s
Channel(s)                              : 2 channels
Sampling rate                            : 48.0 kHz
Compression mode                        : Lossy
Stream size                              : 18.9 MiB (2%)
Language                                : English
Encryption                              : Encrypted

Audio #2
ID                                      : 2069 (0x815)
Menu ID                                  : 1 (0x1)
Format                                  : MPEG Audio
Format version                          : Version 1
Format profile                          : Layer 2
Codec ID                                : 4
Duration                                : 20 min 39 s
Bit rate mode                            : Constant
Bit rate                                : 128 kb/s
Channel(s)                              : 2 channels
Sampling rate                            : 48.0 kHz
Compression mode                        : Lossy
Stream size                              : 18.9 MiB (2%)
Language                                : Chinese
Encryption                              : Encrypted

Text
ID                                      : 2073 (0x819)
Menu ID                                  : 1 (0x1)
Format                                  : DVB Subtitle
Codec ID                                : 6
Duration                                : 20 min 30 s
Delay relative to video                  : 1 s 70 ms
Language                                : Chinese

Kind Regards,
Mouna.

PayNow 07-13-2017 06:58 AM

Re: How to Decrypt .ts Files (Key is available)


 
You can use livestreamer, or streamlink or even ffmpeg does support key decryption.

MoonLaf 07-13-2017 10:11 AM

Re: How to Decrypt .ts Files (Key is available)


 
Quote:

Originally Posted by PayNow (Post 92713)
You can use livestreamer, or streamlink or even ffmpeg does support key decryption.

Thanks for your reply.

Is there any guides on how to use streamlink or ffmpeg to decrypt the video file?

Yelloworanges 07-13-2017 11:47 AM

Re: How to Decrypt .ts Files (Key is available)


 
Quote:

Originally Posted by MoonLaf (Post 92718)
Thanks for your reply.

Is there any guides on how to use streamlink or ffmpeg to decrypt the video file?

It looks like you downloaded a single video file that was never in hls format (m3u8 playlist with ts segments).

If this is correct, then the "drm" is likely something other than hls-aes.

Look at the beginning of the file that you download with a hex editor for clues about the type of drm.

MoonLaf 07-13-2017 12:55 PM

Re: How to Decrypt .ts Files (Key is available)


 
Quote:

Originally Posted by Yelloworanges (Post 92721)
It looks like you downloaded a single video file that was never in hls format (m3u8 playlist with ts segments).

If this is correct, then the "drm" is likely something other than hls-aes.

Look at the beginning of the file that you download with a hex editor for clues about the type of drm.

Can't we figure the Encryption type from the Decryption File:

Code:

<?xml version="1.0" encoding="UTF-8" ?>
<Client_ECMs version="1.0"><Total_Session_ECMs>2</Total_Session_ECMs>
<CryptoPeriod Sequence_Number="1"><CryptoStart>5</CryptoStart><ECMStructure>AQAXCOQRW9IL6AAAXl8Q84FwYwAAARaiAjYDAAAA/3Uh4AEAAfwBDAIAgwD5SH4QdRwaK4Q66KD+aJXHi8SesZA0wIHsnbmDZjdy8lC4ImETT/7xnlGEviATpjRS/58XcHEYw5dH8jY87JcFIvz6hRnqWWHtSA==</ECMStructure><Parity>129</Parity></CryptoPeriod><CryptoPeriod Sequence_Number="2"><CryptoStart>720565</CryptoStart><ECMStructure>AQAXCOQRW9IL6AAAXl8VwYBwYwAAARaiAjYDAAAA/3Uh4AEAAfwBDAIAgwD5SH4QKf0TQfW0qdhdEVfLlfRjWpA0wIHsnbmDZjdy8lC4ImETT/7xnlGEviATpjRS/58XcHEYw5dH8jY87JcFIvz6hRnqWWHtSA==</ECMStructure><Parity>128</Parity></CryptoPeriod></Client_ECMs>


MoonLaf 07-14-2017 01:48 AM

Re: How to Decrypt .ts Files (Key is available)


 
I digged into the issue and found the below information:

Encryption Type: PlayReady

and found also the below line:

Code:

"drmToken":"AAAEADaQNMCBaRWsfKxlUmvys4GISYjx4FT+rw4kY6YBIndnKYKBu/ykjQVTmsKOTkA/pnrfs0DU0uk=","drmFree":false

Yelloworanges 07-14-2017 03:15 AM

Re: How to Decrypt .ts Files (Key is available)


 
I don't know of any solution for PlayReady. Is the service offered on the web or on any other platform besides "Sat Box".
If it is offered on some other platform, there might be weaker forms of drm used.

Reversing PlayReady would likely take a lot of work and skill.

MoonLaf 07-14-2017 04:05 AM

Re: How to Decrypt .ts Files (Key is available)


 
Quote:

Originally Posted by Yelloworanges (Post 92747)
I don't know of any solution for PlayReady. Is the service offered on the web or on any other platform besides "Sat Box".
If it is offered on some other platform, there might be weaker forms of drm used.

Reversing PlayReady would likely take a lot of work and skill.

I don't think we need to do encryption reversing.

The key is already available.

I downloaded (2) main files:

1. video_file.nds
2. key_file.xml

there was another file that has some information like this:

Code:

"physicalContentId":"video_file.nds"
"keyfileUrl":"http://Sat_Provider_Website/key_file.xml"
"fileSize":1024080871
"drmToken":"AAAEADaQNMCBaRWsfKxlUmvys4GISYjx4FT+rw4kY6YBIndnKYKBu/ykjQVTmsKOTkA/pnrfs0DU0uk="
"drmFree":false

and what about the key_file.xml content itself:

Code:

<?xml version="1.0" encoding="UTF-8" ?>
<Client_ECMs version="1.0"><Total_Session_ECMs>2</Total_Session_ECMs>
<CryptoPeriod Sequence_Number="1"><CryptoStart>5</CryptoStart><ECMStructure>AQAXCOQRW9IL6AAAXl8Q84FwYwAAARaiAjYDAAAA/3Uh4AEAAfwBDAIAgwD5SH4QdRwaK4Q66KD+aJXHi8SesZA0wIHsnbmDZjdy8lC4ImETT/7xnlGEviATpjRS/58XcHEYw5dH8jY87JcFIvz6hRnqWWHtSA==</ECMStructure><Parity>129</Parity></CryptoPeriod><CryptoPeriod Sequence_Number="2"><CryptoStart>720565</CryptoStart><ECMStructure>AQAXCOQRW9IL6AAAXl8VwYBwYwAAARaiAjYDAAAA/3Uh4AEAAfwBDAIAgwD5SH4QKf0TQfW0qdhdEVfLlfRjWpA0wIHsnbmDZjdy8lC4ImETT/7xnlGEviATpjRS/58XcHEYw5dH8jY87JcFIvz6hRnqWWHtSA==</ECMStructure><Parity>128</Parity></CryptoPeriod></Client_ECMs>

Is there any way to use the available information to decrypt the video file?

Yelloworanges 07-14-2017 05:24 AM

Re: How to Decrypt .ts Files (Key is available)


 
Quote:

Originally Posted by MoonLaf (Post 92749)
I don't think we need to do encryption reversing.

I said "Reversing PlayReady", meaning the PlayReady system - including file structure, methodology and implementation.
Some custom tools or scripts would likely be required.

Quote:

Originally Posted by MoonLaf (Post 92749)
The key is already available.

I downloaded (2) main files:

1. video_file.nds
2. key_file.xml

You make it sound so easy. Please do go on and explain more.

MoonLaf 07-15-2017 03:08 AM

Re: How to Decrypt .ts Files (Key is available)


 
Quote:

Originally Posted by Yelloworanges (Post 92750)
I said "Reversing PlayReady", meaning the PlayReady system - including file structure, methodology and implementation.
Some custom tools or scripts would likely be required.


You make it sound so easy. Please do go on and explain more.

Sorry if I misunderstood what you've said.

I didn't say it is easy. I just want to know the approach that I should follow to decrypt the file based on the available information.


All times are GMT -6. The time now is 07:20 AM.