public bool ValidatePassword(SecureString password) { var content = File.ReadAllText(_dataStore.MasterPasswordFile, Encoding.UTF8); content = FileSecurity.Decrypt(content, password); if (content == null) { return(false); } var hash = FileSecurity.GetHashString(FileSecurity.ConvertToUnSecureString(password)); if (!content.Equals(hash)) { return(false); } return(true); }
public string Decrypt(string text, SecureString pass = null) { var password = pass ?? GetPassword(); return(FileSecurity.Decrypt(text, password)); }