国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

? ??? ?? PHP ???? PHP?? AES ??? ?? ?? ??(?? ??)

PHP?? AES ??? ?? ?? ??(?? ??)

Aug 04, 2018 pm 01:56 PM
???

? ??? ??? PHP(?? ??)? AES ??? ?? ??? ?? ????. ?? ?? ?? ??? ???? ??? ??? ???? ??? ??? ????.

AES ??

?? ??? ??(AES, Advanced Encryption Standard)? ?? ???? ?? ??? ???????(WeChat ??? ??? ????? ? ??? ????? ?????). ?? ??? ????? ???? ???? ??? ?? ?????.

?? ???
???? ???? ???? ?? ?????. ? ??? ??? ?? ??? ???? ?? ???? ??? ?????. ??? ? ??? ? ????? ????. ???? ?? ?????.

??? ???
???? ???? ???? ?? ????. ? ??? ??? ????? ??? ??? ???? ?????. ????? ???? ???? ??? ??? ???? ??? ??? ?????. ??? ? ??? ????? ????. ???? ??? ??? ????? RSA, ECC ? EIGamal???.

??:
PHP7.2? Mcrypt ??? ????? ???? OpenSSL ??? ?????.

<?php /*
* AES 算法    
*/class Aes {

    private $hex_iv = &#39;00000000000000000000000000000000&#39;; 

    private $key = &#39;397e2eb61307109f6e68006ebcb62f98&#39;;    
    function __construct($key) {
        $this->key = $key;        
        $this->key = hash(&#39;sha256&#39;, $this->key, true);
    }    /*
    * 字符串加密 不寫入文件 
    */
    public function encrypt($input)
    {
        $data = openssl_encrypt($input, &#39;AES-256-CBC&#39;, $this->key, OPENSSL_RAW_DATA, $this->hexToStr($this->hex_iv));        
        $data = base64_encode($data);        
        return $data;
    }    /*
    * aes 給PHP文件加密
    * 寫入設(shè)置文件
    */
    public function filecrypt($filename)
    {
        $type=strtolower(substr(strrchr($filename,&#39;.&#39;),1));            
        if (&#39;php&#39; == $type && is_file($filename) && is_writable($filename)) {  
                 $contents = file_get_contents($filename);                 
                 // echo $contents;exit;  
                 $contents = php_strip_whitespace($filename);                 
                 // echo $contents;exit;
                 // $headerPos = strpos($contents,&#39;<?php&#39;);
                 // echo $headerPos;exit;


                 // $contents = substr($contents, $headerPos + 5, $footerPos - $headerPos);
                 // echo $contents;
                 exit;
                 $data = openssl_encrypt($contents, &#39;AES-256-CBC&#39;, $this->key, OPENSSL_RAW_DATA, $this->hexToStr($this->hex_iv));                 
                 // echo $data;exit;
                 $data = base64_encode($data);                
                  // echo $data;exit;
                 return file_put_contents($filename, $data);  
            }  
                 return false;  
    }    /*
    * 字符串解密
    */
    public function decrypt($input)
    {
        $decrypted = openssl_decrypt(base64_decode($input), &#39;AES-256-CBC&#39;, $this->key, OPENSSL_RAW_DATA, $this->hexToStr($this->hex_iv));        
        return $decrypted;
    }    /*
      For PKCS7 padding
     */

    private function addpadding($string, $blocksize = 16) {

        $len = strlen($string);        
        $pad = $blocksize - ($len % $blocksize);        
        $string .= str_repeat(chr($pad), $pad);        
        return $string;

    }    private function strippadding($string) {

        $slast = ord(substr($string, -1));        
        $slastc = chr($slast);        
        $pcheck = substr($string, -$slast);        
        if (preg_match("/$slastc{" . $slast . "}/", $string)) {            
        $string = substr($string, 0, strlen($string) - $slast);            
        return $string;

        } else {            
        return false;

        }

    }    
    function hexToStr($hex)
    {

        $string=&#39;&#39;;        
        for ($i=0; $i < strlen($hex)-1; $i+=2)

        {            
        $string .= chr(hexdec($hex[$i].$hex[$i+1]));

        }        
        return $string;
    }

}
$key = &#39;397e2eb61307109f6e68006ebcb62f98&#39;;
$aes = new Aes($key);
$filename = __DIR__.&#39;\exchange.php&#39;;
// $filename = &#39;Y6RCuF6ETPC5J57hfhxovg==&#39;;
// 加密
$string = $aes->filecrypt($filename);
// echo $string;
echo "OK,加密完成!" ;

2. PHP ??? ????? ??? ??

<?php  

 function encode_file_contents($filename) {  
     $type=strtolower(substr(strrchr($filename,&#39;.&#39;),1));  
     if (&#39;php&#39; == $type && is_file($filename) && is_writable($filename)) { // 如果是PHP文件 并且可寫 則進(jìn)行壓縮編碼  
         $contents = file_get_contents($filename); // 判斷文件是否已經(jīng)被編碼處理  
         $contents = php_strip_whitespace($filename);   

         // 去除PHP頭部和尾部標(biāo)識  
         $headerPos = strpos($contents,&#39;<?php&#39;);  
         $footerPos = strrpos($contents,&#39;?>&#39;);  
         $contents = substr($contents, $headerPos + 5, $footerPos - $headerPos);  
         $encode = base64_encode(gzdeflate($contents)); // 開始編碼  
         $encode = &#39;<?php&#39;."\n eval(gzinflate(base64_decode("."&#39;".$encode."&#39;".")));\n\n?>";   

         return file_put_contents($filename, $encode);  
     }  
     return false;  
 }   

 //調(diào)用函數(shù)
 // echo __DIR__.&#39;\server.php&#39;;   
 $filename = __DIR__.&#39;\server.php&#39;;  
 encode_file_contents($filename);  
 echo "OK,加密完成!" ;

?? ?? ?:

php?? ?? post ??? ?? ??? get ???

thinkphp5?? json ??? ??(??)? ???? ??

? ??? PHP?? AES ??? ?? ?? ??(?? ??)? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? admin@php.cn?? ?????.

? AI ??

Undresser.AI Undress

Undresser.AI Undress

???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover

AI Clothes Remover

???? ?? ???? ??? AI ?????.

Video Face Swap

Video Face Swap

??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

???

??? ??

???++7.3.1

???++7.3.1

???? ?? ?? ?? ???

SublimeText3 ??? ??

SublimeText3 ??? ??

??? ??, ???? ?? ????.

???? 13.0.1 ???

???? 13.0.1 ???

??? PHP ?? ?? ??

???? CS6

???? CS6

??? ? ?? ??

SublimeText3 Mac ??

SublimeText3 Mac ??

? ??? ?? ?? ?????(SublimeText3)

???

??? ??

??? ????
1601
29
PHP ????
1502
276
???
Win10 Home Edition? ?? ???? ?????? Win10 Home Edition? ?? ???? ?????? Jan 09, 2024 am 08:58 AM

?? ???? ??? ??? ?? ????? ???? ?? ??? ??? ??? ???? ???? ?? ??? ???! ??? ??? ?? ?????? ?? ??? ??? ? ?? ?? ??? ??? ?????. ??? Win10 Home Edition? ?? ??? ???? ?? ? ??? ????. Win10 Home Edition? ??? ???? ? ????? ??: Win10 Home Edition? ??? ???? ? ????. Windows ????? ?? ??? ???? 1. ?????? ?? ?? ??? ??? ??? ???? ??? ?(?? ?? ??? ??) "??" ??? ?????. 2. ??? ?? ??????? '??' ??? ?? ???? ? ??? ?? '???? ???? ?? ??? ???' ??? ?????. 3. ??? ???? "??"? ????

Win11 ???? DNS ?? ???? Win11 ???? DNS ?? ???? Dec 25, 2023 am 10:13 AM

Microsoft? ??? win11? ?? DNS ??? ???? ????? ?? ???? win11 ???? DNS? ???? ??? ????. ??? ???? ???? DNS ??? ?? ???. win11 ???? DNS? ?? ??? ????: 1. ?? ???? ???? ?????? ??? ?????. 2. ?? ?? ???? "???"? ???. 3. ?? ?? ??? DNS ?? ??? ?? "??"? ?????. 4. "??(DHCP)"? "??"?? ??? ? ??? "IPv4"? ???. 5. ? ? , ?? DNS? "8.8.8.8"? ?????. 6. ?? ?? ?? DNS ???? "????(DNS over HTTPS)"? ?????. 7. ??? ??? ? "??"? ???? ??? ?? ? ????.

winrar-winrar ??? ?? ??? ???? ?? ???? ????? ?? winrar-winrar ??? ?? ??? ???? ?? ???? ????? ?? Mar 23, 2024 pm 12:10 PM

?????? ? ?? ??? ? ?? ??? ?????. ?? 1: ??? ?? ??? ??? ??? ??? ???? ? ????? ????? ???? ??? ? ??? ?????. ?? 2: ?? ??? ?? ??? ????? ? ??? ???? ? ????? ???? ???. ?? ?? ?? ???? ?????? ?? ????? ???? WinRAR?? ?? ???? ??? ? ????. ??? ????? ???? WinRAR? ??? ? ???? ????? ?????. ??? ??? ????: WinRAR? ?? ?? ??????? ??-??? ??? ? [??]?? ???? ?? ?? ??-???? ??? ?????. ??? ????? ????? ???? ??? ???? ??? ?????. ????

???? ?? ?? ???? ?? ????? ???? ?? ???? ?? ?? ???? ?? ????? ???? ?? Feb 20, 2024 pm 03:27 PM

?? ???? ??? ????? ?? ??? ??? ???? ? ??? ??? ??? ????? ???? ??? ?? ?????. ??? ???? ? ??? ???? ?? ????? ???? ? ?? ???? ??? ????. ??, ?? ??? ?? ???? ??? ??? ???? ?? ????? ??? ? ????. Windows ???? ?? ?? ??? ?? ??? ? ????. ???? ??? ???? ?? ??? ??? ??? ???? ??? ? "??"? ?????.

win11 ?? ???? ?? ?? ??? win11 ?? ???? ?? ?? ??? Jan 09, 2024 pm 02:50 PM

?? ??? ??? ???? ??? win11 ??? ????? ??? ????. ??? ?? ???? ????? ?? ?????? ???? ??? ???? ? ????. win11 ?? ???? ?? ??? ????: 1. ?? ?????? ??? ?? ??? ??? ???? ???? ??? ?? "??"? ???. 2. ?? ?? ?? ??? "??"? ?????. 3. "???? ???? ?? ??? ???"? ?????. "? ???? "??"? ?????. 4. ?? ?? "??"? ???? ?????. 5. ????? ??? ??? ??? ???? "??"? ?? ??? ????? ?????.

Apple ????? ?? ?? ???? ???? ?? Apple ????? ?? ?? ???? ???? ?? Mar 02, 2024 pm 05:31 PM

Apple ????? ???? ??? ?? ?? ??? ???? ? ????. ?? ???? ?? ??? ????. ????? ? ??? ??? ??? ? ??? ?? ? ????. ???? ?? ?? ????? ?? ???? ??? ?? ?? ??? ?? ??? ?????. Apple ??? ???? iPhone ?? ?? ??? ?? ?? A: ????? ? ??? ??? ??? ? ??? ??? ?? ?? ???? ?????. 1. ?? ??? ???? ????? ? ??? ?????. ???? ? ??? [??]? ?????. 2. [??? ??]? ?????. 3. ??? ????, ?? ??? ??? ?? ??? ? ??? ??? [???] ???? ?????. 4. ?? [?? ??]? ?????.

CentOS?? Vim ???? ??? ? ??? ??? ?? ??? ?? CentOS?? Vim ???? ??? ? ??? ??? ?? ??? ?? Dec 31, 2023 pm 02:49 PM

CentOS? vim/vi? ???? ??? ????? ?????. 1. vim/vi? ???? ??????. ??: ??? ? ????? ??? ?? ???? ???? ?? ???? ? ? ????. ?? ???? ???? ?? ???? ?? ???? ??? ?? ? ??? ???? ???? ??? ???? ?? ????. vi?? ??? ????? ??? ????. root master /root/: [root@www~]#vim/vitext.txt2 ???? ??? ??? ?? text.txt? ?????. ?? ??? ???? ??? ??? ? ESC? ??? ??? ?????. X(??? ??) X), ?? 3)

???? ???? ??? ????? Analog: 1,600? ?? ??, ???? ?? ???? ???? ??? ????? Analog: 1,600? ?? ??, ???? ?? Feb 22, 2024 pm 04:50 PM

???: Meteor, ChainCatcher ????: Marco, ChainCatcher ?? ?? ?? ?? ??? ????? Analog? 1,600? ??? ?? ??? ????? ??? ??? ?????. ?? ????? TribeCapital, NGCVentures, Wintermute, GSR, NEAR, OrangeDAO? ????. , Mike Novogratz? ?? ?? ?? ?? Samara Asset Group, Balaji Srinivasan ? 2023? ?, Analog? X ???? ?? ???? ?? ???? ?? ??? ???? ??? ??? ??????.

See all articles