Open XML Application Security (3) Hide data

Source: Internet
Author: User

The hidden data here refers to some of the basic attribute information that is stored by default in Office documents, and is likely to contain sensitive information such as companies, creators, signatures, comments, and so on.

For hidden information, Office provides us with a document inspector. You can open the Document Inspector in the Trust Center → personal Information options → document checker. As shown in Figure 14-26.

Figure 14-26 Document Inspector

The Document inspector is used to check for hidden information and provides a delete function. Now let's look at the personal information defined by office, includes the following: name and abbreviation, company and organization name, computer name, network server and hard drive, other file properties and summary information, OLE object, author information for different versions of the document, document revision information, document version information, template information, hidden text , revisions, and annotations.

When the check is performed, the item that contains the hidden information is listed and the deletion is given, as shown in Figure 14-27.

Figure 14-27 Document review Results

If you want to achieve more flexible functionality, you can call the Document Inspector in your code. In C #, you can invoke the functionality of the Document Inspector by calling the Microsoft.Office.Core.IdocumentInspector interface. If you have a VSTO programming base, you can write an office plug-in to implement some custom functionality. Of course, using the APIs provided by the open XML SDK makes it easier to implement the ability to manipulate hidden information. Code Listing 14-22 is an example of retrieving the properties of a Word document.

Code Listing 14-22 retrieving Word document properties

public static void Getpropertyfromdocument (string document)
    
{
    
   XmlDocument xmlproperties = new XmlDocument ();
    
     
    
   using (wordprocessingdocument WordDoc = Wordprocessingdocument.open (document, False))
    
   {
    
      Extendedfilepropertiespart Apppart = Worddoc.extendedfilepropertiespart;
    
     
    
      Xmlproperties.load (Apppart.getstream ());
    
   }
    
   XmlNodeList chars = Xmlproperties.getelementsbytagname ("Characters");
    
     
    
   MessageBox.Show (chars. Item (0). innertext);
    
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.