简单的密码混淆(糊弄鬼)

main
yanzai 1 year ago
parent 36951ed36d
commit 6c8ad2c5c8

@ -13,9 +13,39 @@ class LoginController extends Controller
public function Login(){ public function Login(){
$username =request('username'); $username =request('username');
$password= request('password'); $password= request('password');
$password=$this->de_hunxiao($password);
$login=app()->make(LoginService::class); $login=app()->make(LoginService::class);
//$login= new LoginService(); //$login= new LoginService();
return Yz::echo($login->Login(['username'=>$username,'password'=>$password])); return Yz::echo($login->Login(['username'=>$username,'password'=>$password]));
} }
function de_hunxiao($str)
{
$decodedString = base64_decode($str);
// 第二步:移除固定的前缀和后缀
$strippedString = str_replace('a5331_', '', $decodedString);
$strippedString = str_replace('_a454d', '', $strippedString);
// 第三步:反转字符串以恢复原始顺序
$reversedString = strrev($strippedString);
// 第四步:字符替换(包括字母和数字)
$charMap = [
'z' => 'a', 'y' => 'b', 'x' => 'c', 'w' => 'd', 'v' => 'e',
'u' => 'f', 't' => 'g', 's' => 'h', 'r' => 'i', 'q' => 'j',
'p' => 'k', 'j' => 'q', 'i' => 'r', 'h' => 's', 'g' => 't',
'f' => 'u', 'e' => 'v', 'd' => 'w', 'c' => 'x', 'b' => 'y',
'a' => 'z',
'@' => '0', '!' => '1', '#' => '2', '$' => '3', '%' => '4',
'^' => '5', '&' => '6', '*' => '7', '(' => '8', ')' => '9'
];
$originalString = '';
for ($i = 0; $i < strlen($reversedString); $i++) {
$char = $reversedString[$i];
$originalString .= isset($charMap[$char]) ? $charMap[$char] : $char;
}
// 输出解码后的字符串
return $originalString;
}
} }

@ -81,7 +81,7 @@
if (username.value == '' || pwd.value == '') return ElMessage.error('用户名和密码不能为空') if (username.value == '' || pwd.value == '') return ElMessage.error('用户名和密码不能为空')
let data = { // let data = { //
username: username.value, username: username.value,
password: pwd.value, password: hunxiao(pwd.value) ,
} }
loading.value = true loading.value = true
// //
@ -113,6 +113,30 @@
usernameRef.value.focus() usernameRef.value.focus()
}) })
}) })
const hunxiao=(str)=>{
let originalString =str
var charMap = {
'a': 'z', 'b': 'y', 'c': 'x', 'd': 'w', 'e': 'v',
'f': 'u', 'g': 't', 'h': 's', 'i': 'r', 'j': 'q',
'k': 'p', 'l': 'o', 'm': 'n', 'n': 'm', 'o': 'l',
'p': 'k', 'q': 'j', 'r': 'i', 's': 'h', 't': 'g',
'u': 'f', 'v': 'e', 'w': 'd', 'x': 'c', 'y': 'b',
'z': 'a',
'0': '@', '1': '!', '2': '#', '3': '$', '4': '%',
'5': '^', '6': '&', '7': '*', '8': '(', '9': ')'
};
var mappedString = originalString.split('').map(char => charMap[char] || char).join('');
//
var reversedString = mappedString.split('').reverse().join('');
//
var prefixedSuffixString = 'a5331_' + reversedString + '_a454d';
// 使 btoa Base64
var encodedString = btoa(prefixedSuffixString);
return encodedString;
}
</script> </script>
<style scoped> <style scoped>

Loading…
Cancel
Save