Blu-ray Content Hash Verifier


Content hash verifier is used to verify the integrity of Blu-ray M2TS files. It has two versions:

Feature

What is content hash?

AACS_Spec_BD_Prerecorded.921.pdf
The Content Hash Table shall contain an 8-bytes hash value for each hash unit of the Clip AV stream files under "\BDMV\STREAM" directory in the corresponding layer. Detail of the hash calculations are defined in Section 2.3.2 of this specification. Each Clip AV stream file is sequentially divided into hash units from head to tail, and the size of each hash unit is 96 Logical Sectors. Note that the tail portion of each Clip AV stream file, which size is less than 96 Logical Sectors, is omitted from storing of its hash value. If the file size of Clip AV stream file is exactly the multiple of 96 Logical Sectors, there is no tail portion to be omitted from storing. If a Clip AV stream is divided in two and recorded on the both layer, the extents size of each Clip AV stream file on the Layer 0 shall be exactly the multiple of 96 Logical Sectors, and the extents of each Clip AV stream file on the Layer 1 shall be logically recorded after the extents of the corresponding Clip AV stream on the Layer 0. Note that the size of CHT is zero byte if there is no Clip AV stream that have a file equal to or more than 96 Logical Sectors on the corresponding layer.

Every 192KB in an M2TS file has a Content Hash. By verifying the Content Hash, you can determine whether the M2TS contains bad data.

The content hash is a an 8-byte hash value of a 192 KB M2TS data block. For regular BD, the content hash is the lower 8 bytes of SHA1(M2TS_BLOCK); for 4K UHD is the lower 8 bytes of SHA256(M2TS_BLOCK).

The content hash in a Blu-ray is stored separately for each layer in /AACS/ContentHash000.tbl, /AACS/ContentHash001.tbl, /AACS/ContentHash002.tbl...

  1. Content hashes are generated only for .m2ts files that are greater than or equal to 1344 KB.
  2. If the last data block is not exactly 192 KB, it will be omitted to create a content hash.
  3. The M2TS data involved in the calculation is the actual data stored on the disc.
    Because bus encryption is a software encryption set by the optical drive firmware, if bus encryption exists, it needs to be removed before calculating the hash value.