private void LoginButton(object sender, EventArgs e) { string hash = RegistryHelper.GetKey("Password"); var tmp = Crypto.Verify(MasterPassword.Text, hash); switch (tmp) { case true: DialogResult = DialogResult.OK; break; default: this.Close(); break; } }
/// <summary> /// Checks if the account database is valid based upon the md5 stored in the registry /// </summary> /// <param name="fileName">Location of the account database</param> /// <returns>True</returns> public static bool IsDatabaseValid(string fileName) { return((RegistryHelper.GetKey("MD5") == CalculateMD5(RegistryHelper.Zipfile)) ? true : false); }