docx形式のファイルの暗号化に php mcrypt TripleDES を使用しようとしました。
ファイルを復号化しようとすると、次のようなエラーが発生します。
コンテンツに問題があるため、Office Open XML ファイル file_name を開くことができません。
ここに以下のコードがあります
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;
}
どんな助けでも大歓迎です。