private static bool ConfirmationPassword(PasswordEntry passwordEntry)
        {
            using (var passwordEntry2 = new PasswordEntry())
            {
                passwordEntry2.LabelText = "Please confirm your session password(s).";

                if (passwordEntry2.ShowDialog() != DialogResult.OK)
                {
                    return(false);
                }

                bool password1Match = ByteHelpers.ByteArrayCompare(passwordEntry.Password.Password1, passwordEntry2.Password.Password1);
                bool password2Match = ByteHelpers.ByteArrayCompare(passwordEntry.Password.Password2, passwordEntry2.Password.Password2);

                if ((password1Match == false) || (password2Match == false))
                {
                    MessageBox.Show(Resources.TextShredderMainForm_ConfirmationPassword_The_passwords_do_not_match_, Resources.TextShredderMainForm_ConfirmationPassword_The_passwords_do_not_match_, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

                    return(false);
                }

                return(true);
            }
        }
        private bool SetPassword(bool confirmPassword)
        {
            _passwordSet = false;

            while (!_passwordSet)
            {
                try
                {
                    using (_passwordEntry = new PasswordEntry())
                    {
                        _passwordEntry.LabelText = "Please enter your session password(s).";

                        if (_passwordEntry.ShowDialog() != DialogResult.OK)
                        {
                            return(false);
                        }

                        if (confirmPassword)
                        {
                            if (ConfirmationPassword(_passwordEntry) == false)
                            {
                                return(false);
                            }
                        }

                        _passwordSet = true;
                    }
                }
                catch (ArgumentNullException)
                {
                    Debug.WriteLine("Argument Null Exception Caught.");
                }
            }

            return(true);
        }