private static string HashUserInput(string input) {
return SHA.ComputeSHA256Hash(input);
private static bool InputMatch(string userInput, string savedTextFileString) {
string hashedInput = HashUserInput(userInput);
bool doInputStringMatch = string.Equals(hashedInput, savedTextFileString);
return doInputStringMatch;
public static void Main() {
string toHashString = "silpa"+"shinto"+ "01/01/1999"+"va"+"3023 farmstead mill drive";
string hashedSavedUserInput = HashUserInput(toHashString);
Console.WriteLine("The hashed version of the users input is: {0} (this is what gets saved to the text file)", hashedSavedUserInput);
string userInputString = "silpa"+"shinto"+ "01/01/1999"+"va"+"3023 farmstead mill drive";
Console.WriteLine("The hashed version of the good entered userinput is {0} (it should match the one in the text file)", HashUserInput(userInputString));
string userInputStringFails = "not the correct user Input";
Console.WriteLine("The hashed version of the bad entered userinput is {0} (this will not match the one in the text file)", HashUserInput(userInputStringFails));
if (InputMatch(userInputString, hashedSavedUserInput))
Console.WriteLine("The good userinput is correct");
Console.WriteLine("The good userinput is not correct");
if (InputMatch(userInputStringFails, hashedSavedUserInput))
Console.WriteLine("The bad userinput is correct");
Console.WriteLine("The bad userinput is not correct");