Ben bu kodu hakkında birkaç soru var:
<?php
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
$key = "This is a very secret key";
$text = file_get_contents('path/to/your/file');
echo strlen($text) . "\n";
$crypttext = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $text, MCRYPT_MODE_ECB, $iv);
file_put_contents('path/to/your/file', $crypttext);
?>
Ben şifrelemek eğer öyleyse ancak, sonunda ek boşlara ekler, sadece iyi dosyayı şifreler:
a test string is this one
and here is a new line
bir kez deşifre olur:
a test string is this one
and here is a new line 000000000000000
Ne oluyor?
İkinci olarak, AES-128
ile MCRYPT_RIJNDAEL_256
uyumlu?
Son olarak, nasıl başka bir parti ben şifreli ettik bir dosyanın şifresini izin istiyorsunuz? Onlar şifreleme kullanılan hangi bilmek gerekir ve ben onlara ne emin değilim.