English 中文(简体)
存放在现场的密码和加密
原标题:Issue with encrypt and decrypt a word docx file in php

我试图使用php mcode TriDES进行加密,用于docx格式文档。

当有人试图对档案进行加密时,就会发现错误如下。

The Office Open XML file file_name cannot be opened because there are problems with the contents.

下面是法典

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);
  return $result;
}

任何帮助都将受到赞赏。

最佳回答

I have been waiting for the solution more than 4 months. Finally i found some valuable answer in google. Now i have fixed it by using below link.

http://www.howwhywhat.in/how-to-implement-common-file-encodeion-and-decodeion-between-c-and-php/

最好的部分是,它也有活的例子:

问题回答

暂无回答




相关问题
Extend Contacts application on Android to provide encryption

I want to encrypt individual contacts stored by the Contacts application on Android based on user s preference. So, I am thinking I ll have to hook/extend the Contacts application before the it stores ...

Make md5 strong

Im making a website that will intergrate with game that only support md5 hashing metod (atm). Which ofc is not especially safe anymore. But how could i make it stronger? Should I just generate long ...

How to Pack/Encrypt/Unpack/Decrypt a bunch of files in Java?

I m essentially trying to do the following on a Java/JSP-driven web site: User supplies a password Password is used to build a strongly-encrypted archive file (zip, or anything else) containing a ...

Thread & Queue vs Serial performance

I though it ll be interesting to look at threads and queues, so I ve written 2 scripts, one will break a file up and encrypt each chunk in a thread, the other will do it serially. I m still very new ...

Convert PHP encryption code to C#

I m trying to convert this piece of code from PHP to C#. It s part of a Captive Portal. Could somebody explain what it does? $hexchal = pack ("H32", $challenge); if ($uamsecret) { $newchal = ...

Encryption: how to have 1 iv despite multiple fields

I ve been stuck trying to arrive at a best solution for this for a while. I know that an initialization vector has to be unique for each item being encrypted. So if I m encrypting an address and I ...

热门标签