Example #1
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            string hashname, hashpass, hash;

            hashname = Crypt.encrypt(accountname.Text, Environment.GetEnvironmentVariable(AppData.MastePassVariableName));
            hashpass = Crypt.encrypt(Password.Text, Environment.GetEnvironmentVariable(AppData.MastePassVariableName));
            hash     = Crypt.encrypt(hashname + hashpass, Environment.GetEnvironmentVariable(AppData.MastePassVariableName));
            Json.dump(typeof(AccountDataContract), AppData.Appdir + "\\" + account.id, new AccountDataContract(hashname, hashpass, hash));
            win.Update();

            this.Close();
        }
Example #2
0
        private void SavePass_Click(object sender, RoutedEventArgs e)
        {
            string pass, hashname, hashpass, hash;

            if (CheckHidden.IsChecked.Value)
            {
                pass = PasswordHide.Text;
            }
            else
            {
                pass = PasswordField.Password;
            }
            Guid id = Guid.NewGuid();

            hashname = Crypt.encrypt(accountName.Text, Environment.GetEnvironmentVariable(AppData.MastePassVariableName));
            hashpass = Crypt.encrypt(pass, Environment.GetEnvironmentVariable(AppData.MastePassVariableName));
            hash     = Crypt.encrypt(hashname + hashpass, Environment.GetEnvironmentVariable(AppData.MastePassVariableName));

            Json.dump(typeof(AccountDataContract), AppData.Appdir + "\\" + id, new AccountDataContract(hashname, hashpass, hash));
            win.Update();
        }