public bool SignIn(string userName) { try { UserName = userName; using (StreamReader reader = new StreamReader(userName + ".pswds")) { string xml = reader.ReadToEnd(); userData = UserData.LoadFromXMLString(fileEncryptor.Decrypt(xml)); if (HashingSHA.Hash(userName) == userData.UserNameHashed) { return(true); } reader.Close(); } } catch (Exception ioexc) { Console.Write("Error reading the file"); } return(false); }
public string ViewPassword(TDES tdes) { return(tdes.Decrypt(password)); }
public string ViewUserName(TDES tdes) { return(tdes.Decrypt(userName)); }