简体   繁体   English

预订表的加密数据检索

[英]encrypted data retrieval for booking form

Hi i have a booking system , which pulls data from AES encrypted database. 嗨,我有一个预订系统,可以从AES加密数据库中提取数据。 in the data base the postcode and the destination is encrypted, used to have an old script with list input, so users can select their destination on the list, since the destination list is getting big, i wanted to do a form in which users type in few letters and the destination comes up using ajax auto-fill. 在数据库中,邮政编码和目标位置已加密,曾经有一个带有列表输入的旧脚本,因此用户可以在列表中选择目标位置,因为目标位置列表越来越大,我想做一个用户输入的表格输入几个字母,然后使用ajax自动填充功能显示目的地。 the problem i have is, its pulling, data as Encrypted. 我有的问题是,它的拉动是加密的数据。

the first booking script had this line to decrypt 第一个预订脚本对此行进行解密

$areafro = mysql_query("select AREA_NO, AES_DECRYPT(POSTCODE, 'qsi') as POSTCODE, AES_DECRYPT(AREA_NM, 'qsi') as AREA_NM from area_mst where AES_DECRYPT(POSTCODE, 'qsi') LIKE '$char%' group by POSTCODE");

this is the new booking script code 这是新的预订脚本代码

if(isset($_GET['areas']) && isset($_GET['letters'])){
$letters = $_GET['letters'];
$letters = preg_replace("/[^a-z0-9 ]/si","",$letters);
$res = mysql_query("select POSTCODE,AREA_NM from area_mst where (POSTCODE like '".$letters."1' or AREA_NM like '".$letters."1') order by AREATYPE") or die(mysql_error();

while($inf = mysql_fetch_array($res)){
    if($inf["POSTCODE"]!='')
    {
    echo $inf["POSTCODE"]."-".$inf["AREA_NM"]."|";
    }
    else
    {
    echo $inf["AREA_NM"]."|";
    }
}       

could some one help me to how to get data decrypted ? 有人可以帮助我如何解密数据吗?

Your query in the latter code does not decrypt. 后一个代码中的查询不会解密。 Notice in the old code, you have 注意,在旧代码中,

$areafro = mysql_query("select AREA_NO, AES_DECRYPT(POSTCODE, 'qsi') as POSTCODE,
 AES_DECRYPT(AREA_NM, 'qsi') as AREA_NM from area_mst 
where AES_DECRYPT(POSTCODE, 'qsi') LIKE '$char%' group by POSTCODE");

But in the new code, you are simply extracting data without decrypting. 但是在新代码中,您只是在提取数据而不进行解密。

$res = mysql_query("select POSTCODE,AREA_NM from area_mst 
where (POSTCODE like '".$letters."1' or AREA_NM like '".$letters."1') 
order by AREATYPE")

Change your new code to have the query exactly as the one in the old code, 更改新代码以使查询与旧代码中的查询完全相同,

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM