how to detect AIP labelling in javascript?

William 25 Reputation points
2025-01-24T08:46:52.84+00:00

hi, I need to, in Outlook web addin, tell whether a docx attachment is AIP labelled with encryption.

A few people on this website has asked this or similar question but got no reply, such as:

https://learn.microsoft.com/en-us/answers/questions/1663123/how-to-know-if-document-or-mail-configured-with-se (in the comment section)

https://learn.microsoft.com/en-us/answers/questions/2103825/how-to-check-if-an-outlook-email-is-confidential-e

In my limited test of a few files, they differ in the 44th bytes:

  • for password protected only docx file, the 44th bytes is always "03"
  • for AIP label with encryption, then the 44th bytes is always "04"

For example:

certutil -dump passwordYES_RMSNO.docx |more
  0000  ...
  5000
    0000  d0 cf 11 e0 a1 b1 1a e1  00 00 00 00 00 00 00 00   ................
    0010  00 00 00 00 00 00 00 00  3e 00 03 00 fe ff 09 00   ........>.......
    0020  06 00 00 00 00 00 00 00  00 00 00 00 03 00 00 00   ................

certutil -dump passwordNO_RMSYES.docx |more
  000000  ...
  014e00
    000000  d0 cf 11 e0 a1 b1 1a e1  00 00 00 00 00 00 00 00   ................
    000010  00 00 00 00 00 00 00 00  3e 00 03 00 fe ff 09 00   ........>.......
    000020  06 00 00 00 00 00 00 00  00 00 00 00 04 00 00 00   ................

BUT, the above is based on my test of only a few files of different contents, not sure if they are always true. Unless it has some reason?

Outlook
Outlook
A family of Microsoft email and calendar products.
4,373 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
4,182 questions
Outlook Management
Outlook Management
Outlook: A family of Microsoft email and calendar products.Management: The act or process of organizing, handling, directing or controlling something.
5,426 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.