DTS AUE Encryption

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Michael Zarits
    Film Handler
    • Jan 2020
    • 89
    • Austria

    #1

    DTS AUE Encryption

    More than seven years ago we had a discussion about DTS AUE encryption and those distances between the serial number blocks in the timecode.


    While working on DTS preservation, I spent quite some time looking through a disassembly of the original DTS XD10 software and eventually came across the code that handles the AUE key embedded in the timecode.

    Since we already had a thread about this several years ago but never really figured out how it works, I thought I'd share what I've found:


    I'm using zero-based counting everywhere below: first bit = 0, first item = 0, etc.

    As an example for calculations I use Serial 9754, Reel 1.


    1. What is actually printed on the film?

    DTS optical timecode has 30 BLOCKs per second. This is independent of the 24 film frames per second - a DTS BLOCK is not a film frame.

    Each physical BLOCK consists of 48 optical bits, read along the direction of film travel:

    Start bits Optical data bits Stop bits
    4 bits 40 bits 4 bits

    The 40 optical data bits represent 20 decoded data bits, because every two optical bits encode one data bit. In film travel direction the two decoded fields are bit-reversed:

    Decoded data field Bit positions Width
    Counting value OR film serial number 0-15 16 bits
    Reel number 16-19 4 bits

    The reel number decides what kind of BLOCK it is:
    • Reel = 0 -> SERIAL BLOCK (SN-Block). The 16-bit field contains the film serial number.
    • Reel = 1-15 -> COUNTING BLOCK (TC-Block). The 16-bit field contains the timecode count.
    So a SERIAL BLOCK is not just an extra mark. It is a complete physical timecode BLOCK where the reel number is zero.


    2. Why are there extra SERIAL BLOCKs?

    A regular SERIAL BLOCK appears once every 16 BLOCKs. On AUE-protected prints there are additional SERIAL BLOCKs between the regular ones.

    These extra SERIAL BLOCKs carry the AUE security information. More exactly, their positions represent binary bits. A SERIAL BLOCK at a certain position means 1, and no SERIAL BLOCK at that position means 0.

    The regular 16-BLOCK SERIAL pattern and the additional security SERIAL BLOCKs are processed differently. That explains why some SN-Blocks are just part of the regular serial transmission, while others affect the calculated AUE key.


    3. Some names to make the explanation easier

    Instead of trying to explain the internal XD10 lookup table, I think it is easier to describe the actual structure with a few simple definitions. These are not official DTS names, just some names I came up with to make the following explanation easier to understand:

    Name Meaning
    BLOCK One physical 48-optical-bit unit on the film
    BlockID The counting/timecode BLOCK number used for the security calculation
    BLOCKGROUP Four consecutive BLOCKs
    GROUPITEM Position 0, 1, 2 or 3 inside a BLOCKGROUP
    INDEX Number 0-63 assigned to a BLOCKGROUP
    INDEXGROUP One complete cycle of 64 BLOCKGROUPs = 256 BLOCKs
    SafetyGroup One part of an INDEXGROUP producing a 16-bit SecuritySequence
    IsSN 1 if a SERIAL BLOCK occurs in GROUPITEM 0 or 1; otherwise 0
    SKIP A BLOCKGROUP which does not contribute a security bit
    SecuritySequence The 16 bits recovered from one SafetyGroup
    TimecodeCRC CRC16 calculated from the BLOCK number, reel number and serial number
    AueKey_Item One AUE key result calculated from one SecuritySequence

    All three SafetyGroups together form one INDEXGROUP.

    So in total:
    • 256 BLOCKS = 64 BLOCKGROUPS = 3 SAFETYGROUPS = 1 INDEXGROUP
    • 1 BLOCKGROUP consists of 4 BLOCKS numbered GROUPITEM 0 to 3
    Once we know the BlockID of an incoming timecode BLOCK, we can determine which INDEXGROUP and SafetyGroup it belongs to:


    4. One INDEXGROUP = 256 BLOCKs

    The INDEXGROUP structure and its SKIP positions repeat every 256 BLOCKs. Each cycle contains 64 BLOCKGROUPs of four BLOCKs, divided into three SafetyGroups. The actual pattern of additional SERIAL BLOCKs can change from one INDEXGROUP to the next, because the CRC16 also depends on the BlockID.

    For a given BlockID, the INDEX of its BLOCKGROUP is:

    INDEX = ((BlockID - 64) AND 255) / 4


    INDEX calculation (SecureIrqProcess):
    0804D410 LEA EAX,[EBX-0x40] ; BlockID - 64
    0804D413 AND EAX,0xFF ; keep 8 bits
    0804D41D SHR EAX,0x2 ; divide by 4

    This is integer division. AND 255 keeps the lower eight bits, so the INDEX repeats from 0 to 63 every 256 BLOCKs.


    Timecode generally starts at BlockID 59, so the first cycle, starting at BlockID 64, looks like this:

    SafetyGroup INDEX values BLOCKGROUPs BLOCKs SKIP Security bits
    SafetyGroup0 0-21 22 88 6 16
    SafetyGroup1 22-42 21 84 5 16
    SafetyGroup2 43-63 21 84 5 16
    TOTAL 0-63 64 256 16 48

    The three SafetyGroups within an IndexGroup cover these BLOCK ranges in the first cycle:
    • SafetyGroup0: BLOCKs 64-151
    • SafetyGroup1: BLOCKs 152-235
    • SafetyGroup2: BLOCKs 236-319

    For another 256-BLOCK cycle just add 256 * n to the BLOCK numbers (n = 0, 1, 2, ...).

    The starting BLOCKs of the SafetyGroups are therefore:

    SafetyGroup0 = 64 + 256*n

    SafetyGroup1 = 152 + 256*n

    SafetyGroup2 = 236 + 256*n


    5. SKIP BLOCKGROUPs

    Here is the important rule:

    Every fourth BLOCKGROUP is SKIP, starting at INDEX 0.

    SKIP = (INDEX MOD 4 = 0)

    So the SKIP INDEX values are:

    0, 4, 8, 12, 16, 20, 24, 28, ... 60

    For the first INDEXGROUP, the SKIP BLOCKGROUPs start at these BlockIDs:
    64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240, 256, 272, 288, 304

    And that automatically explains why the three SafetyGroups have different numbers of BLOCKGROUPs:
    • SafetyGroup0 contains INDEX 0-21. Its SKIP indices are 0, 4, 8, 12, 16 and 20. Result: 22 - 6 = 16 security bits.
    • SafetyGroup1 contains INDEX 22-42. Its first SKIP INDEX is 24, the third BLOCKGROUP inside SafetyGroup1. Result: 21 - 5 = 16 security bits.
    • SafetyGroup2 contains INDEX 43-63. Its first SKIP INDEX is 44, the second BLOCKGROUP inside SafetyGroup2. Result: 21 - 5 = 16 security bits.
    I found these rules in the XD10's internal lookup table, but there's no need to reproduce the whole table here, since the SKIP formula above, together with the SafetyGroup definitions, already explains how it works.

    BlockID INDEX SKIP? Meaning for security
    64 0 Yes No security bit
    68 1 No Bit 0 of SecuritySequence0
    72 2 No Bit 1 of SecuritySequence0
    76 3 No Bit 2 of SecuritySequence0
    80 4 Yes No security bit
    84 5 No Bit 3 of SecuritySequence0
    96 8 Yes No security bit

    Note that this list only shows the first BLOCK (GROUPITEM 0) of each BLOCKGROUP.


    6. How one BLOCKGROUP gives a security bit

    Each BLOCKGROUP consists of four BLOCKs. As mentioned, I call their positions GROUPITEM 0, 1, 2 and 3.

    For a non-SKIP BLOCKGROUP, only GROUPITEM 0 and GROUPITEM 1 are checked to get the next security bit:

    IsSN = (GROUPITEM 0 is SERIAL) OR (GROUPITEM 1 is SERIAL)

    If either is a SERIAL BLOCK, IsSN is 1. If both are COUNTING BLOCKs, IsSN is 0.

    GROUPITEM 0 GROUPITEM 1 IsSN
    COUNTING COUNTING 0
    SERIAL COUNTING 1
    COUNTING SERIAL 1
    SERIAL SERIAL 1

    That one bit is added to the SecuritySequence for the current SafetyGroup. After 16 non-SKIP BLOCKGROUPs, the sequence is complete.


    SERIAL detection and security bit insertion (SecureIrqProcess):
    0804D360 TEST ESI,ESI ; reel number = 0 ?
    0804D362 JZ LAB_0804D431 ; SERIAL BLOCK
    0804D433 MOV [...],0x1 ; IsSN = 1
    0804D3AA SHR EAX,0x1 ; shift security register
    0804D445 OR AH,0x80 ; set bit 15
    (Selected instructions, not one continuous block of code.)


    The first received bit is bit 0 (the rightmost bit of the finished 16-bit number). The final received bit is bit 15 (the leftmost bit).

    GROUPITEM 2 and GROUPITEM 3 don't add security bits. They are also used by the decoder to keep the latest reel number for the CRC calculation (more on that later), and to reset IsSN for the next BLOCKGROUP.

    Let's take BLOCKs 68-71 as an example:

    BlockID GROUPITEM What happens
    68 0 SERIAL found, so IsSN becomes 1
    69 1 COUNTING found; IsSN stays 1. Store security bit 1
    70 2 Keep reel information and reset IsSN
    71 3 Update reel information and leave IsSN at 0

    The next useful BLOCKGROUP is 72-75, which produces the next bit. BLOCKGROUP 80-83 is SKIP and contributes nothing to the SecuritySequence.

    In the real sample I captured, all the SN-Blocks are on GROUPITEM 0. So there are always at least three COUNTING BLOCKs between two SN-Blocks. The processor still accepts SN-Blocks on GROUPITEM 1 too - more on that below.




    Continued in the next post due to the 10,000-character limit...
  • Michael Zarits
    Film Handler
    • Jan 2020
    • 89
    • Austria

    #2
    7. Reconstructing a SecuritySequence from a real print

    For SafetyGroup0, the 16 non-SKIP BLOCKGROUPs give these bits in receiving order:

    1 0 1 0 0 1 1 1 0 0 1 0 0 0 1 1

    Because the first bit is bit 0, the final 16-bit binary number is shown the other way around:

    1100 0100 1110 0101 = 0xC4E5

    Here is the full mapping for this first SafetyGroup:

    Security bit INDEX BLOCKGROUP starts at BlockID IsSN
    0 1 68 1
    1 2 72 0
    2 3 76 1
    3 5 84 0
    4 6 88 0
    5 7 92 1
    6 9 100 1
    7 10 104 1
    8 11 108 0
    9 13 116 0
    10 14 120 1
    11 15 124 0
    12 17 132 0
    13 18 136 0
    14 19 140 1
    15 21 148 1

    The other SafetyGroups contain their own different 16-bit SecuritySequences. They don't have to match each other. In fact, normally they don't.


    8. Calculating the AUE key

    Now comes the part we were missing in 2019:

    For every SecuritySequence, the processor also calculates a TimecodeCRC from five bytes. The information is saved at the beginning of the particular SecuritySequence: At the first non-SKIP BlockID within the SecuritySequence, which for our SafetyGroup0 is 68 (Note that the actual first BlockID 64 at Index 0 is a SKIPPED BLOCKGROUP), SafetyGroup1 = BlockID 152 and SafetyGroup2 = BlockID 236.

    Byte Content
    1 First non-skip Block within Security Sequence
    BlockID, LOW byte
    2 First non-skip Block within Security Sequence
    BlockID, HIGH byte
    3 Reel number, one byte
    4 Current film serial number, LOW byte
    5 Current film serial number, HIGH byte

    The reel number here is the one saved from GROUPITEM 2/3 of the preceding BLOCKGROUP. This is a small detail that is easy to miss if you only look at the block pattern.

    CRC parameters:
    • Initial value: 0xFFFF
    • Reflected polynomial: 0x8408
    • Final XOR: none
    • Byte order: exactly as in the table above


    After the CRC16 has been calculated, the processor performs one XOR operation:

    AueKey_Item = SecuritySequence XOR TimecodeCRC

    XOR compares two bits. Equal bits give 0, different bits give 1. It works on all 16 bits of the two numbers.

    Note that all three SafetyGroups have different security bits and different CRCs, but still produce the same AUE key.


    9. Example - Reel 1, Serial 9754

    The incoming binary stream and data extraction from timecode (does not represent a full INDEXGROUP):
    02_streamdata_page-0001.jpg

    Extracting SecuritySequence:
    03_securitybit_page-0001.jpg
    *If SafetyBit# = “10” that means it is a SKIP BLOCKGROUP.
    • Reel number: 1 = 01 hex
    • Film serial number: 9754 decimal = 261A hex
    • Serial LOW / HIGH: 1A 26
    The three SafetyGroups give these results:

    Value SafetyGroup0 SafetyGroup1 SafetyGroup2
    First security BlockID 68 (0044) 152 (0098) 236 (00EC)
    CRC input, 5 bytes 44 00 01 1A 26 98 00 01 1A 26 EC 00 01 1A 26
    TimecodeCRC AAB3 22B4 1A57
    SecuritySequence 1100010011100101 (C4E5) 0100110011100010 (4CE2) 0111010000000001 (7401)
    AueKey_Item `6E56` `6E56` `6E56`



    CRC16 and final XOR (SecureTcProcess):
    0804DF7D CALL CrcReset
    0804DF89 CALL CrcProcessByte
    0804DF95 CALL CrcProcessByte
    0804DFA1 CALL CrcProcessByte
    0804DFAD CALL CrcProcessByte
    0804DFB9 CALL CrcProcessByte
    0804DFBE CALL CrcGet
    0804DFDC XOR ESI,[DAT_0812EB98]
    There are five CrcProcessByte calls because the input is five bytes. The XOR combines this CRC with the recovered 16-bit security information.

    For SafetyGroup0, the calculation is:

    CRC16(44 00 01 1A 26) = AAB3

    C4E5 XOR AAB3 = 6E56

    The other two SafetyGroups give:

    4CE2 XOR 22B4 = 6E56

    7401 XOR 1A57 = 6E56

    So the result of all three independent calculations is the same 16-bit AUE key: `0x6E56`.


    10. What happens to the calculated AueKey_Items?

    One calculated AUE key is not enough for the XD10's validation routine.

    The SecureHistoryCheck routine in the XD10 binary stores the calculated results in a history of 10 entries and looks for at least three matching key results, also checking associated information such as the film serial number. There are further conditions in the code as well.

    This helps reject wrong keys caused by occasional timecode reading errors.

    The ten-entry history is what I could confirm in the XD10 software. I haven't checked whether older DTS processor firmware uses exactly the same buffering or validation checks.


    11. The AUE header does NOT contain the key directly

    There is also something I need to correct from what I wrote back in 2019:

    I said that AUE header bytes 93 and 94 contain the 16-bit key. That's not correct for header mode 01.

    Instead, these bytes contain a CRC16 calculated from the key. The CRC input is just three bytes:

    54 + AueKey HIGH + AueKey LOW

    For the key 6E56, the input is:

    54 6E 56

    Using the same CRC16 as before (FFFF start, 8408 reflected polynomial, no final XOR):

    CRC16(54 6E 56) = 1147


    Header check (SecurityGetCrc / SecureValidate):
    0804DA4B MOV byte ptr [...],0x54
    0804DA50 CALL CrcProcessByte
    0804DA61 CALL CrcProcessByte
    0804DA6F CALL CrcProcessByte
    0804DBB9 CALL SecurityGetCrc
    This is the separate three-byte CRC used for the AUE header security check.

    Stored LOW byte first, the expected header bytes are:

    AUE header offset (zero-based) Expected value Meaning
    92 01 Header security mode
    93 47 Key CRC LOW byte
    94 11 Key CRC HIGH byte

    The calculated CRC16 must match bytes 93 and 94 of the AUE file (low byte first). If they don't match, the reconstructed AUE key is rejected. And in our example, yes they do

    9754R1hdr.png


    12. The other way around

    Now that we know how the decoder reconstructs the AUE key, we can also work out how the additional SERIAL BLOCK pattern can be generated by doing the calculation in reverse.

    I haven't examined the original DTS timecode encoder, but mathematically the process is quite simple. For each SafetyGroup:
    1. Calculate TimecodeCRC from the five bytes belonging to that SecuritySequence.
    2. Calculate SecuritySequence = AUE Key XOR TimecodeCRC.
    3. Take its bits from bit 0 through bit 15, in that order.
    4. For each non-SKIP BLOCKGROUP where the required bit is 1, an encoder could place an additional SERIAL BLOCK in GROUPITEM 0 or 1. The decoder accepts either position.
    5. If the required bit is 0, both checked GROUPITEMs must be COUNTING BLOCKs.
    6. Keep the regular SERIAL transmission in the SKIP positions.

    At playback, the processor does the reverse operation:

    AUE Key = SecuritySequence XOR TimecodeCRC


    13. So you’re asking: Why is GROUPITEM 1 also checked?

    The answer is: I have no idea.
    The original decoder logic checks both GROUPITEM 0 and GROUPITEM 1. Either can set IsSN to 1.

    In all my timecode captures, the SERIAL BLOCKs are only on GROUPITEM 0.

    One possible reason is that the encoder may have been allowed to move an additional SERIAL BLOCK one position forward to GROUPITEM 1, without changing its security bit. Maybe that was useful to avoid creating another regular-looking 16-BLOCK SN pattern by accident.

    The decoder definitely supports both positions, but I haven't found the original timecode encoder logic to explain why it was designed that way.

    Also, when the BlockID is known, the decoder doesn't need to guess which 16-BLOCK pattern is regular: the INDEX and SKIP rules already say which groups contribute security bits and which ones don't.


    14. How can the foobar2000 plugin play encrypted AUE files without the AUE key?

    The AUE key is only 16 bits long, which means there are just 65,536 possible combinations. Since bytes 93 and 94 of the AUE header contain a CRC16 of the key, the plugin can simply try all possible keys until the calculated CRC16 matches the one stored in the file. Once it finds a match, it has the correct AUE key and can decrypt the audio. So there's no need for the original film print, timecode, reel number or serial number. Everything needed to recover the key is already in the AUE file itself.


    15. Back in 2019

    Marcus Lemm posted this sequence:

    4,16,8,8,16,12,4,16,4,12,12,4,4,12,8,4,4,16,12,4,4 ,12,4,8,4,4,8,4,8,4,4,4,4,8,8,8,12,4,4,12,8,8,8,4, 4,12

    Unfortunately, the published distances alone don't tell us the absolute BlockIDs, so we cannot unambiguously assign the bits to the three SecuritySequences. We are also missing the film serial number and reel number, which are needed to calculate the actual AUE key.

    Mystery solved

    -Michael


    P.S. For future preservation of the DTS systems, I recovered the license strings for all 29 DTS feature licenses, along with the Blowfish encryption constants and salt values used by the licensing system. This is purely for preservation purposes, not to bypass the current licensing system.
    If these machines are ever released for open-source use, or at some point the original licensing restrictions are no longer relevant, this information will make sure that all features can still be enabled and the systems can be preserved with their full functionality. Since replacing the motherboard usually means a different MAC address, the existing licenses would no longer be valid.
    ​
    Last edited by Michael Zarits; 10-14-2026, 01:09 AM.

    Comment

    • Markus Lemm
      Film Handler
      • Jan 2020
      • 31
      • Ottawa, Ontario, Canada

      #3
      That is an awesome post. Looks like you figured it out.

      I like how it takes into account the serial number of the feature so that you can't just copy the DTS timecode from one AUE print to another AUE encoded print.

      If I get some free time I'm going to see if I can write a program that will generate a DTS timecode that will fool an XD10 into playing an AUE encoded without the print.

      Thanks for doing all that work and writing it up!

      Comment

      • Michael Zarits
        Film Handler
        • Jan 2020
        • 89
        • Austria

        #4
        Thanks Markus! (And sorry for misspelling your name in my previous post!)

        Here's a script that generates a raw 48-bit AUE-encoded DTS timecode stream for any given film serial number, reel number, and 16-bit encryption key, just like the original timecode generator at the lab would. You can specify the desired timecode duration, the script outputs everything to a TXT file.

        AueKeyedDTSTC_Settings.png

        AueKeyedDTSTC_v0.0.10.zip - Python and AutoIT version

        Comment

        • Josh Jones
          Pro Film Handler
          • Feb 2024
          • 154
          • McKinney, TX

          #5
          Agreed, excellent work on this!

          Comment

          • Kyle Mikolajczyk
            Film Handler
            • Jan 2020
            • 79
            • Worcester, MA

            #6
            Yeah their biggest flaw here was making the key so small, very easy to brute force it even back then. I’ve still never understood why the first 2 mins or so is still “in the clear”/not “encrypted”, I’ve always found that funny.

            Comment

            • Michael Zarits
              Film Handler
              • Jan 2020
              • 89
              • Austria

              #7
              I'm not sure either why DTS chose exactly two minutes.

              When a new reel starts, the XD10 needs at least 3 matching AUE key candidates, reconstructed from the SecuritySequences before it can validate the encryption key. It requires at least 256 timecode blocks to receive 3 SecuritySequences. At 30 blocks per second, that's ~8.53 seconds to collect the minimum of 3 candidates under ideal conditions.

              But the unencrypted portion is defined by a fixed byte offset, NOT by playback time. The following instruction is hardcoded in the SecureDecryptBlock() routine:

              MOV ESI,0xC9DFB0

              0xC9DFB0 = 13,230,000 bytes - which corresponds to exactly 120 seconds of audio in a 5-track APT-X100 file (excluding the 92-byte header).

              Since APT-X100 uses 22,050 bytes/s per track, applying the same encryption scheme to different track configurations would result in:

              • 5 tracks: 110,250 bytes/s → 120 seconds unencrypted
              • 6 tracks: 132,300 bytes/s → 100 seconds unencrypted
              • 8 tracks: 176,400 bytes/s → 75 seconds unencrypted

              So the more tracks, the shorter the unencrypted opening section would be. Even with 8 tracks, 75 seconds would still provide a very generous margin for acquiring and validating the AUE key.

              I've personally never come across an encrypted T6 or T8 file, but perhaps DTS took the higher bitrates of multi-track formats into account when choosing that cutoff, ensuring there would still be sufficient time for key acquisition and validation.

              Something else that comes to mind is that the older DTS-6 and DTS-6D processors have an SN counter that goes up to 25. I haven't dug deeply into their security routines yet, but I wonder whether they require a longer history of valid security information before allowing encrypted playback. That's purely speculation, though.

              Comment

              Working...