Konu Başlığı: PHP de cryptolama
View Single Post
Sponsorlu Bağlantılar
Zoque.Forum
Advertisement
Old 26.03.2007   #1 (permalink)
magos
 
Üyelik Tarihi: 09.11.2006
Yer: izmir
Mesaj: 200
PHP de cryptolama

merhaba arkadaslar. PHP de bildiginiz gibi md5() ile veya password() ile tek yönlü cryptolama yapabiliyoruz. Ben iki yönlü crypto arıyordum. Böyle birşey denedim ama çalışmadı.

HTML Code:
<? function encryptData($value){
   $key = "top secret key";
   $text = $value;
   $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
   $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
   $crypttext = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $text, MCRYPT_MODE_ECB, $iv);
   return $crypttext;
}
function decryptData($value){
   $key = "top secret key";
   $crypttext = $value;
   $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
   $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
   $decrypttext = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $crypttext, MCRYPT_MODE_ECB, $iv);
   return trim($decrypttext);
}
echo encryptData("magos");
?>
bilgisi olan var mı acaba?
magos şu an çevrimdışı   Mesajdan alıntı yaparak yeni bir cevap ekleyin