Search code examples
drm

How to read WMDRM 10 KEYID from file


I wanted to if it is possible to read a KeyID from an encrypted file using WMDRM 10? Of course it is a clear text somehow, but is it possible? how?

Thanks!


Solution

  • One easy answer is that you can binary-parse the file and look for the <WMRMHEADER> tag and the <KID> tag within it (both Unicode-encoded). The key ID is within the <KID> tag.

    The correct (but much harder) way is to use Windows Media Format 11 SDK and the IWMDRMReader::GetDRMProperty() method with the g_wszWMDRM_DRMHeader_KeyID constant. However, you are gonna need WMDRM "stub libs" from Microsoft in order to do that (i.e. be a DRM licensee).