第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

如何使用 php 搜索加密的 txt 文件

如何使用 php 搜索加密的 txt 文件

PHP
九州編程 2022-07-09 09:58:28
對(duì)于一個(gè)簡(jiǎn)單的郵件列表,我將數(shù)據(jù)存儲(chǔ)在.txt文件中。在 txt 文件中有 5 行。其中 2 個(gè)(包含姓名和電子郵件)已加密。出于安全原因,我存儲(chǔ)了加密的姓名和電子郵件。這就是我搜索文件的方式:/* EMAIL SEARCH */$email_search = $_GET['email_search']; // get string from url for searchif (isset($email_search)) {    $searchthis = strtolower($email_search);        $email_matches = array();    $files = glob("subscribers/*.txt"); // Specify the file directory by extension (.txt)    foreach($files as $file) { // Loop the files in the directory   {        $handle = @fopen($file, "r");        if ($handle) {            $lines = file($file);                       $grab_email = strtolower($lines[3]); // for sorting only            while (!feof($handle)) {                $buffer = fgets($handle);                if(strpos(strtolower($buffer), $searchthis) !== FALSE) // strtolower; search word not case sensitive                        $email_matches[$file] = $grab_email; // put all lines in array  indexed by email            }            fclose($handle);        }    }}asort($email_matches);<!-- search form --><form class="search-form form-inline" action="admin.php" method="GET">      <div class="input-group mb-3">        <input class="form-control" type="text" name="email_search" placeholder="Search for..." />        <div class="input-group-append">                            <button class="btn btn-primary" type="submit">Search</button>        </div>    </div>                          </form>這是一個(gè)txt文件的樣子:id-5e0786c07c802 // idFriends //categoryygkKcL/jz9U= // name (encrypted)6gkKcL/jz9XuVRNayyIVcFbLw3ord0nc7IJj // email (encrypted)902d95a9bf1c3f59a3996e4e7b4dec79 // token以前,當(dāng)數(shù)據(jù)未加密時(shí),此搜索確實(shí)可以正常工作!但是,當(dāng)每個(gè)文件中的名稱和電子郵件行被加密時(shí),我現(xiàn)在如何搜索?
查看完整描述

1 回答

?
FFIVE

TA貢獻(xiàn)1797條經(jīng)驗(yàn) 獲得超6個(gè)贊

使用加密值搜索呢?

在您的代碼中,$_GET['email_search']包含您要搜索的單詞或值。我不知道您的加密方式如何,但您可以加密您正在搜索的單詞,例如:

$email_search = openssl_encrypt($_GET['email_search'], $ciphering, $encryption_key, $options, $encryption_iv); // get string from url for search


查看完整回答
反對(duì) 回復(fù) 2022-07-09
  • 1 回答
  • 0 關(guān)注
  • 127 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)