I have a validation function that receives two strings and makes a count compare, if the strings are the same size then it checks if the visible characters in the first string are the same as the second string.
private bool ValidateEncryptedText(string encrypted, string plain)
{
if (plain.Count() != encrypted.Count())
return false;
else
{
for (int index = 0; index < plain.Count(); index++)
{
if (plain[index] != '*' && plain[index] != encrypted[index])
return false;
}
return true;
}
}