Beta Offline decryption utility

nowhereman

New Member
There has been some work on using the sound switch as a means of adetection and cropping, see
Thanks for the link. I reverse engineered it into a python script that chops the front and back off the recording to keep avidemux happy plus gives a list of where the ads are. Not quite accurate enough to trust it to remove the ads itself unfortuntely. It's as good as I'm going to get though.
 

nowhereman

New Member
This is a python3 script to decrypt .ts files. Works on linux, may work on other OSs, minimal testing done. Put YOUR key in the key string instead of 0000... obviously.
Decoded a 4GB .ts file in 3 minutes on my laptop. Thought someone might find it useful...

Python:
from Crypto.Cipher import DES3
import sys

key = bytearray.fromhex("00000000000000000000000000000000")

des = DES3.new(key,DES3.MODE_ECB)

if len(sys.argv) != 2:
    print("Name of file to fix required")
    exit(1)

with open( sys.argv[1]+"fixed.ts", "wb", buffering=1024*1024) as outfile:
    with open( sys.argv[1], "rb", buffering=1024*1024) as infile:
        rec = infile.read(192)

        while rec:
            if (rec[7] & 0x30 ) == 0x10 :
                decoded = des.decrypt(rec[8:])
                outrec = rec[:8]+decoded
            else:
                start = 9+rec[8]
                stop = 8*int((len(rec)-start)/8)+start
                decoded = des.decrypt(rec[start:stop])
                outrec = rec[:start]+decoded+rec[stop:]

            outfile.write(outrec)
            rec = infile.read(192)

exit(0)
 

aekostas

Member
Hello,

I had set my Hummy to decrypt recursively at the top, then changed my mind and cancelled it. It now creates two files: the intended recording and one called -dec (e.g. Mission_ Impossible - Fallout_20210220_2100.ts and Mission_ Impossible - Fallout_20210220_2100-dec.ts respectively).

How do I overcome this?

Many thanks in advance,
AEKostas
 

Black Hole

May contain traces of nut
I assume you are using an HD-FOX, as a HDR-FOX does not need to use the beta stripts to achieve decryption.

Recursive decryption from the Video folder is enabled by clicking the OPT+ button icon in WebIF >> Browse Media Files, alongside the heading where it shows the current folder. The option is called "Recursive Auto-Decrypt". Unfortunately, there is nothing to indicate whether it is enabled or not until you click it - a message will briefly say whether it has just been enabled or disabled (this seems like an oversight).

It seems likely that you have not actually disabled it, therefore each auto-cycle (every 10 minutes) new recordings are scanned for and queued for decryption.

There should then follow a clean-up, unless the result of decryption is obviously not the right size.
 

aekostas

Member
Thanks for the very prompt response. I am on the wrong thread. :-( Is there a way to move my q etc to the correct thread?

It is an HDR-Fox T2 that I have.

I clicked on the option and it set it; on the second click it then un-set it (the latest message is "Unflagged directory as autodecryptR").

The files look to be the same size (6.02 GiB).
 

Black Hole

May contain traces of nut
All you need to do is delete the one you don't want. Something went wrong with the clean-up, but it sounds like it was a one-off.
 

aekostas

Member
Alas it’s a frequent occurrence. I think it happens when the target is the top level; and it doesn’t when in folders (series).
 
Top