Forum


Replies: 2   Views: 197
Setting a lock on trackchanges affecting the whole document protection
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by tarekas  · 26-07-2024 - 08:48

I am using cryptoPHPDOCX to lock the tracking changes in a word document using :
 

$docx->protectDocx($file_path . '.docx', $file_path . '.docx', array('password' => $tracking_lock_pass, 'type' => 'trackedChanges'));



I faced an issue when using third party word editor in my application, it's not allowing me to open the document (read-only) . I contacted the third party and they said the following : 

document_with_unlock_changes_working.docx having track changes locked by Microsoft Word uses the cryptProviderType rsaAES, while the file document_with_unlock_changes_not_working.docx having the track changes locked using PHPDOCX uses the cryptProviderType rsaFull.
At present, DocumentEditor only supports the "rsaAES" cryptProviderType for both protecting and unprotecting documents.

can we change the encryption type?

Thanks.

Posted by tarekas  · 26-07-2024 - 08:54

It's also asking me for a password to unprotect (using the third party word editor)
I am putting the password i used in cryptoPHPDOCX, it's giving me wrong pass. due to different encryption type.

Posted by admin  · 26-07-2024 - 09:47

Hello,

The current stable version of phpdocx only supports rsaFull as cryptProviderType.

Please note that the cryptProviderType (rsaAES or rsaFull) depends on the DOCX editor. Some versions of MS Word (such as MS Word 2010) use rsaFull and others use rsaAES when saving a protected DOCX. phpdocx uses rsaFull as cryptProviderType to protect documents. Many other DOCX editors and OOXML libraries use rsaFull as well.

The removeProtection method (https://www.phpdocx.com/api-documentation/cryptophpdocx/remove-password-protection-Word-document-with-PHP) handles both types (rsaAES or rsaFull) because the documentProtection tag is removed when creating the new DOCX output.

Regards.