Issue with encrypt and decrypt a word docx file in php

anteplyPoenty

New Member
I tried to use php mcrypt TripleDES for encryption for docx format files.When i tried to decrypt the file, i am getting the error as follows.\[quote\] The Office Open XML file file_name cannot be opened because there are problems with the contents.\[/quote\]Here is the below code\[code\]function Encrypt($source,$key,$iv) { $cipher = mcrypt_module_open(MCRYPT_3DES, '', 'cbc', ''); mcrypt_generic_init($cipher, $key, $iv); $result = mcrypt_generic($cipher, $source); mcrypt_generic_deinit($cipher); return $result;}function Decrypt($source,$key,$iv) { $cipher = mcrypt_module_open(MCRYPT_3DES, '', 'cbc', ''); mcrypt_generic_init($cipher, $key, $iv); $result = mdecrypt_generic($cipher, $source); mcrypt_generic_deinit($cipher);}\[/code\]Any help will be appreciated.
 
Back
Top