Bug 76873 - FILEOPEN: Encrypted docx round trip fails between Libre Office and Word
Summary: FILEOPEN: Encrypted docx round trip fails between Libre Office and Word
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.2.2.1 release
Hardware: Other Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-01 00:37 UTC by rlusian1
Modified: 2015-01-24 14:33 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
demo files for bug 76873 (131.91 KB, application/x-7z-compressed)
2014-06-11 01:08 UTC, rlusian1
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rlusian1 2014-04-01 00:37:12 UTC
Problem description: If you create an encrypted Word docx file in either Libre Office 4.2.2.1 or Word 2010, then edit it in Word, Libre Office will thereafter fail to read the document properly.  Word will read the document properly.

Steps to reproduce:
1a. Create the document in LO, save as .docx, save with password
-or
1b. Create the document in Word, save as .docx, save with password

2. Open the document in LO - works
3. Open the document in Word - you are asked for password - works
4. Edit the document in Word - you are asked for password - works
5. LO can no longer display the file contents - no password prompt - garbage
6. You can continue to work with the document in Word, LO can no longer read it however.

Example 1 (actual text in file)
-----
Encrypted document 1

Creation in LibreOffice.
Edited in Word 2010.
-----
File can no longer be viewed in LO, but it can in Office.

Example 2 (actual text in file)
----
Test document 2
Creation in Word
Edit in LO
Edit in Word
----
File can no longer be viewed in LO, but it can in Office.

Current behavior:

Thus, LO can read a .docx created in either LO or Word, but once it has been edited by Word after being edited in LO, LO can no longer read it.

Expected behavior:

Round trip between LO and Word should work. This bug makes LO<->Word interoperability useless for password-protected documents.

              
Operating System: Windows 7
Version: 4.2.2.1 release
Comment 1 Yousuf Philips (jay) (retired) 2014-05-31 08:45:50 UTC
I cant reproduce this on the latest release of 4.2.4. I had attempted to save the password protected file from within LibreOffice, but word 2010 couldnt open it (bug 79476). Please send us a sample of the file you edited in Word 2010 but cant reopen in LibreOffice, so we can test it.
Comment 2 rlusian1 2014-06-11 01:08:42 UTC
Created attachment 100852 [details]
demo files for bug 76873
Comment 3 rlusian1 2014-06-11 01:09:21 UTC
Comment on attachment 100852 [details]
demo files for bug 76873

I can reproduce this in 4.2.2.1, but not in 4.2.4.2.
It looks like the problem has been fixed.

Writer 4.2.2.1 fails to open the files in both cases after the document has been edited by LO and then subsequently 

by Word. Writer 4.2.4.2 works properly. Thus it looks like the file opening problem has definitely been fixed.

This time I saved the files in case anyone wants to see them. I'm sure the Office XML format is pretty tricky.

There is an interesting change in metadata when an Office-created file is edited in LO, that may be of interest. 

Look at the differences between OfficeCreatedPasswordProtectedFile1.docx and 

OfficeCreatedPasswordProtectedFile2.docx

----

The password for all files is: password

Windows 7 Enterprise Service Pack 1

Microsoft Office 2010
Version 14.0.7116.6000 (32-bit)

LibreOffice Writer
Version 4.2.4.2

With 4.2.4.2:

Created the OfficeCreatedPasswordProtectedFile1.docx in Word and saved with password protection (open only).
Opened the file successfully in Libre Office, but did not change it.

Copied file to OfficeCreatedPasswordProtectedFile2.docx.
Opened file in Libre office, added a second entry, saved file in Microsoft Word 2007/2010/2013 XML format.
Opened file successfully in Word.
Opened file successfully in Libre Office.
**NOTE, HOWEVER, THE DIFFERENCE IN FILE METADATA - LOOK IN A TEXT EDITOR**

Copied file to OfficeCreatedPasswordProtectedFile3.docx
Opened file successfully in Word, added a third entry, saved file.
Opened file successfully in Libre Office.

Copied file to OfficeCreatedPasswordProtectedFile4.docx
Opened file in Libre office, added a fourth entry, saved file in Microsoft Word 2007/2010/2013 XML format.
Opened file successfully in Word.
Opened file successfully in Libre Office.

Copied file to OfficeCreatedPasswordProtectedFile5.docx
Opened file successfully in Word, added a third entry, saved file.
Opened file successfully in Libre Office.


Created the LibreOfficeCreatedPasswordProtectedFile1.docx in Libre Office and file in Microsoft Word 2007/2010/2013 

XML format with password protection.
Opened the file successfully Word, but did not change it.

Copied file to LibreOfficeCreatedPasswordProtectedFile2.docx.
Opened file successfully in Word, added a second entry, saved file.
Opened file successfully in Libre Office.

Copied file to LibreOfficeCreatedPasswordProtectedFile3.docx
Opened file successfully in Libre Office, added a third entry, saved file.
Opened file successfully in Word.

Copied file to OfficeCreatedPasswordProtectedFile4.docx
Opened file in Word, added a fourth entry.
Opened file successfully in Word.
Opened file successfully in Libre Office.


With 4.2.2.1, I followed the same basic approach, but when the document is edited by Word after LO has edited it, LO 

can't read the doc properly. I 

stopped that test after it was clear the 4.2.2.1 code was showing the bug.
Comment 4 rlusian1 2014-06-11 01:10:06 UTC
I can reproduce this in 4.2.2.1, but not in 4.2.4.2.
It looks like the problem has been fixed.

Writer 4.2.2.1 fails to open the files in both cases after the document has been edited by LO and then subsequently 

by Word. Writer 4.2.4.2 works properly. Thus it looks like the file opening problem has definitely been fixed.

This time I saved the files in case anyone wants to see them. I'm sure the Office XML format is pretty tricky.

There is an interesting change in metadata when an Office-created file is edited in LO, that may be of interest. 

Look at the differences between OfficeCreatedPasswordProtectedFile1.docx and 

OfficeCreatedPasswordProtectedFile2.docx

----

The password for all files is: password

Windows 7 Enterprise Service Pack 1

Microsoft Office 2010
Version 14.0.7116.6000 (32-bit)

LibreOffice Writer
Version 4.2.4.2

With 4.2.4.2:

Created the OfficeCreatedPasswordProtectedFile1.docx in Word and saved with password protection (open only).
Opened the file successfully in Libre Office, but did not change it.

Copied file to OfficeCreatedPasswordProtectedFile2.docx.
Opened file in Libre office, added a second entry, saved file in Microsoft Word 2007/2010/2013 XML format.
Opened file successfully in Word.
Opened file successfully in Libre Office.
**NOTE, HOWEVER, THE DIFFERENCE IN FILE METADATA - LOOK IN A TEXT EDITOR**

Copied file to OfficeCreatedPasswordProtectedFile3.docx
Opened file successfully in Word, added a third entry, saved file.
Opened file successfully in Libre Office.

Copied file to OfficeCreatedPasswordProtectedFile4.docx
Opened file in Libre office, added a fourth entry, saved file in Microsoft Word 2007/2010/2013 XML format.
Opened file successfully in Word.
Opened file successfully in Libre Office.

Copied file to OfficeCreatedPasswordProtectedFile5.docx
Opened file successfully in Word, added a third entry, saved file.
Opened file successfully in Libre Office.


Created the LibreOfficeCreatedPasswordProtectedFile1.docx in Libre Office and file in Microsoft Word 2007/2010/2013 

XML format with password protection.
Opened the file successfully Word, but did not change it.

Copied file to LibreOfficeCreatedPasswordProtectedFile2.docx.
Opened file successfully in Word, added a second entry, saved file.
Opened file successfully in Libre Office.

Copied file to LibreOfficeCreatedPasswordProtectedFile3.docx
Opened file successfully in Libre Office, added a third entry, saved file.
Opened file successfully in Word.

Copied file to OfficeCreatedPasswordProtectedFile4.docx
Opened file in Word, added a fourth entry.
Opened file successfully in Word.
Opened file successfully in Libre Office.


With 4.2.2.1, I followed the same basic approach, but when the document is edited by Word after LO has edited it, LO 

can't read the doc properly. I 

stopped that test after it was clear the 4.2.2.1 code was showing the bug.