Encrypt .docx file in C++
This topic contains 0 replies, has 1 voice, and was last updated by user52337 8 years, 1 month ago.
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
You must be logged in to reply to this topic.
Home › Forums › WordprocessingML › Encrypt .docx file in C++
Tagged: AES, c#, Encryption, MSWord
This topic contains 0 replies, has 1 voice, and was last updated by user52337 8 years, 1 month ago.
I need to encrypt .docx file using C/C++.
Right now I know a few points about .docx structure, as mentioned below:
– It consists of XML files, zipped together.
– All the content is stored in XML files.
– There is a .rels (not confirm) extension file, that tells MS word about where the content is stored in file, i.e. where to look for content.
Keeping in mind the structure of .docx I need to retrieve that data from the XML file. One way I could go around that is
1) Unzip .docx and take document.xml from the folder
2) Put the document.xml through a parser to extract the contents of the .docx file (I need complete contents i.e. text, table, header, footer, notes, images etc)
3) Then encrypt that data I extracted from document.xml (As per my application need)
The problem that now lies here is that how can I possibly reconstruct my original .docx file, when I decrypt the data that I had encrypted? I have no idea how the XML would be recreated with all proper formatting and everything. And how would I have my original .docx file after decryption?
Please help by providing any useful option or any other possible way of achieving it? Is there any library I could use or any other function or anything?
You must be logged in to reply to this topic.