Ben güvenlik için web siteme üzerine AES uygulanması olmuştur ve ben bir cevap bulmak için un-mümkün ve ben oldukça bizzar bulmak için bir aksaklık / problem rastladım.
I BELIEVE I know where it resides but I don't know how/where to do the fix. Currently I have PHP 5 and the latest MySQL running on my local server.
İşte büyük bir iş gibi görünüyor çalıştırıyorum küçük bir testtir.
<?php
$fName = "Giesbrecht";
$fNameEncrypt = common::encryptMe($fName);
echo $fNameEncrypt ."<br />";
echo common::decryptMe($fNameEncrypt);
?>
Aslında ortak kullanımı için benim işlevi: EncryptMe ()
public static function encryptMe ($value)
// USE THE AES ENCRYPTION TO ENCRYPT ANY VALUE
{
include_once('../resources/crypt/AES.php');
$aes = new Crypt_AES();
$aes->setKey(AES_KEY);
return $aes->encrypt($value);
}
Yani sorun benim MySQL sunucusu içine benim değerleri eklediğinizde çalıştırmak gibi görünüyor. Bu yüzden Latin1 için kuruldu benim Karakter Kümesi, olabileceğini düşündüm ve şimdi ben utf8 -- UTF-8 Unicode taşındı
Other factors regarding my MySQL setup: I have attempted at using field types such as: varchar, varbinary (where I currently sit), and text with a length of (256 on all). I do have many column fields in my table, and many of them will need to be encrypted, although i'm just testing with 2 until I have everything figured out.
So the glitch that i've run into is when I insert into the Database and I actually look at the value inside my Database I have the characters value, they equal ¥ÄÎó¸LOI„˜:é0 (although i'm sure the trans-coding on here will modify it) I have inserted a screenshot of the actual value in the database here:

Ben değerini şifresini çalıştığınızda Ama, ben bir şey olsun ve boş çalışır. Bir SERMAYE "G" ile başlayan herhangi bir kelime ile bir sorun yokmuş gibi görünüyor. Ben bir küçük harf "g" varsa, bu sadece iyi iş gibi görünüyor ...
Ben tamamen bu kacirdim ve artık bu sorunların nasıl hiçbir fikrim yok duyuyorum.
Any help would be greatly appreciated. PS. I am also curious to know if using PHP AES_Encryption is better or using MySQL AES_ENCRYPT is better?
Teşekkürler.
I have now added a new section of working code based off of responses using base64... Please notify me if there is anything wrong with this structure.
<?php
$connect = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
mysql_select_db(DB_NAME, $connect);
$fName = "Giesbrecht";
$encode = common::cleanUp($fName);
$encode = common::encryptMe($encode);
$encode = base64_encode($encode);
mysql_query("INSERT INTO contacts (userId, firstName, lastName) VALUES ('15', 'Justin', '".$encode."')") or die(mysql_error());
$results = mysql_query("SELECT * FROM contacts WHERE userId = '15'")
or die(mysql_error());
while ($row = mysql_fetch_array($results))
{
echo "<br />FN: ". $row['firstName'];
echo "<br />LNE: ". $row['lastName'];
echo "<br />LN: ". common::decryptMe(base64_decode($row['lastName']));
}
?>