加密 解密

  • Post author:
  • Post category:其他


<?php
header('Content-type:text/html;charset=utf8');

echo "<br/>---------------61PKQ2KW1F6BIOW3加密----------------------------------<br/>";
$cmsName = "61PKQ2KW1F6BIOW3";
$key = "123456";
$cmsLen = strlen($cmsName);
$keyLen = strlen($key);
if ( $keyLen < $cmsLen ){
    $key = str_repeat( $key, ceil( $cmsLen / $keyLen ));
}
echo base64_encode($cmsName ^ $key );




echo "<br/>---------------BwNjf2QEemUCcgN0eH1kBw==解密----------------------------------<br/>";
$cmsName = "BwNjf2QEemUCcgN0eH1kBw==";
$key = "123456";
$cmsLen = strlen( $cmsName );
$keyLen = strlen( $key );
if ( $keyLen < $cmsLen ){
    $key = str_repeat( $key, ceil( $cmsLen / $keyLen ));
}
$CMSName = base64_decode( $cmsName ) ^ $key;
echo $cmsName."<br/>";
echo $CMSName;





?>

转载于:https://www.cnblogs.com/pansidong/p/7747045.html