<?php
function passport_decrypt($txt, $key = 'www.jb51.net')
{
$key = 'testkey';
$txt = passport_key(base64_decode(urldecode($txt)), $key);
$tmp = '';
for($i = 0;$i < strlen($txt); $i++) {
$md5 = $txt[$i];
$tmp .= $txt[++$i] ^ $md5;
}
return $tmp;
}
function passport_key($txt, $encrypt_key)
{
$encrypt_key = md5($encrypt_key);
$ctr = 0;
$tmp = '';
for($i = 0; $i < strlen($txt); $i++) {
$ctr = $ctr == strlen($encrypt_key) ? 0 : $ctr;
$tmp .= $txt[$i] ^ $encrypt_key[$ctr++];
}
return $tmp;
}
$txt = "https://global-cloud.byteamone.cn/cloud/flv/66f54f099d4fe32ea2533fe328842c6c/a13afa302264dfe219aa4c9334fdf8a5/6298bd36902d4.m3u8?auth_key=1654177078.5905-1-863546739.info-internet-2-llq-ffd7469c89e97a1c76840cc287897bec";
$key = "testkey";
$encrypt = passport_encrypt($txt,$key);
$decrypt = passport_decrypt($encrypt,$key);
echo $encrypt."n";
echo $decrypt."n";
<?php
ob_start();
header('Access-Control-Allow-Origin:*');
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization");
header('Access-Control-Allow-Methods: GET, POST, PUT,DELETE,OPTIONS,PATCH');
header('Access-Control-Allow-Credentials:true');
function lock_url($txt,$key='laowang')
{
$txt = $txt.$key;
$chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.+=";
$nh = rand(0,64);
$ch = $chars[$nh];
$mdKey = md5($key.$ch);
$mdKey = substr($mdKey,$nh%8, $nh%8+7);
$txt = base64_encode($txt);
$tmp = '';
$i=0;$j=0;$k = 0;
for ($i=0; $i<strlen($txt); $i++) {
$k = $k == strlen($mdKey) ? 0 : $k;
$j = ($nh+strpos($chars,$txt[$i])+ord($mdKey[$k++]))%64;
$tmp .= $chars[$j];
}
return urlencode(base64_encode($ch.$tmp));
}
//解密函数
function unlock_url($txt,$key='laowang')
{
$txt = base64_decode(urldecode($txt));
$chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.+=";
$ch = $txt[0];
$nh = strpos($chars,$ch);
$mdKey = md5($key.$ch);
$mdKey = substr($mdKey,$nh%8, $nh%8+7);
$txt = substr($txt,1);
$tmp = '';
$i=0;$j=0; $k = 0;
for ($i=0; $i<strlen($txt); $i++) {
$k = $k == strlen($mdKey) ? 0 : $k;
$j = strpos($chars,$txt[$i])-$nh - ord($mdKey[$k++]);
while ($j<0) $j+=64;
$tmp .= $chars[$j];
}
return trim(base64_decode($tmp),$key);
}
echo "一开始<br>"."https://global-cloud.byteamone.cn/cloud/flv/66f54f099d4fe32ea2533fe328842c6c/97afc8f562a7fcc94098643450527935/6298c0b444504.m3u8?auth_key=1654177972.2798-1-429192117.info-internet-2-llq-d2bfc3de1005d291f631814fa652f25b";
$str="https://global-cloud.byteamone.cn/cloud/flv/66f54f099d4fe32ea2533fe328842c6c/97afc8f562a7fcc94098643450527935/6298c0b444504.m3u8?auth_key=1654177972.2798-1-429192117.info-internet-2-llq-d2bfc3de1005d291f631814fa652f25b";
$pwd = lock_url($str);
echo "<br/>加密之后:<br/>".$pwd."<br/>";
echo "<br/>解密还原:<br/>nn<br>".unlock_url($pwd);
$url=trim(unlock_url($pwd));
echo "n<br>";
var_dump($url);
header('location:'.$url);
版权说明
文章采用: 《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》许可协议授权。版权声明:未标注转载均为本站原创,转载时请以链接形式注明文章出处。如有侵权、不妥之处,请联系站长删除。敬请谅解!
常见资源合集和破解 fmvvvteih...