Beispiel #1
0
        // sets a new password to encrypt account information with
        private string SetKey()
        {
            UnlockDialog ud = new UnlockDialog();

            ud.prompt.Text = "Enter a new password to use rlel";
            ud.Pass.Focus();
            ud.ShowDialog();
            return(ud.Pass.Password);
        }
Beispiel #2
0
        //prompts user for password to decrypt account info, handles password resetting as well
        private string GetKey(HashAlgorithm hashAlgorithm)
        {
            UnlockDialog ud = new UnlockDialog();

            ud.Pass.Focus();
            ud.ShowDialog();
            //If the password reset button is clicked, reset our encrypted test string to match the new password
            if (ud.reset)
            {
                this.rjm.Key = hashAlgorithm.ComputeHash(Encoding.UTF8.GetBytes(ud.Pass.Password));
                Properties.Settings.Default.IV  = this.GetIV();
                Properties.Settings.Default.Key = this.EncryptPass("this is a string");
                Properties.Settings.Default.Save();
            }
            return(ud.Pass.Password);
        }