欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

加密 解密

程序员文章站 2024-03-14 17:14:10
...
<?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;





?>