I want to create a function which will alert a user if there is a multiple brute force attempt on an account. The function will alert the user if there is more than 75% string match. I have performed this:
function Password_Match ($String, $Stored_Password){
$New_String = str_split($String);
$New_Stored_Password = str_split($Stored_Password);
$Match = 0;
foreach ($New_String AS $Value){
if (in_array($Value,$New_Stored_Password)){
$Match++;
}
}
return $Match;
}
$String = "Test";
$Pass = "Tesst";
echo Password_Match($String,$Pass);
This returns 4, but there is obviously a flaw within my code that I can't figure out a solution. Assitance would be brilliant.