public MainForm()//we completly finished login/encryption/decryption/validation/etc etc i forgot, before i work on the main stuff im going to see what features other password vaults have { InitializeComponent(); Internals.initialize(); MessageBox.Show($"Welcome back, {Internals.grabusername()}!");//display username if (File.Exists(@"Vault\accounts\accounts.csv")) { readcsv(); id = listView1.Items.Count; } else { Directory.CreateDirectory(@"Vault\accounts");; } lbltitleitems.Text = $"Logins Saved: {listView1.Items.Count}"; MessageBox.Show(Properties.Settings.Default.Key + "\n\n" + Properties.Settings.Default.InitializationVector + "\n\n" + Properties.Settings.Default.Pepper); }
private void login() { if (Internals.validate(txtuser.Text) && Internals.validate(txtpass.Text))//make sure usertext and passtext is valid // i shouldve validated in internals but its too late now { if (txtuser.Text == Internals.grabusername() && Internals.hash(txtpass.Text, Internals.grabsalt()) == Internals.grabpassword()) { MessageBox.Show("Logged in!"); this.Hide(); //hide form MainForm frm = new MainForm(); //create new form main frm.Show(); //show it } else { MessageBox.Show("Please check your username/password!", "Invalid login credentials"); } } else { MessageBox.Show("Please check your username/password!", "Invalid login credentials"); } }
private void register() { if (Internals.validate(txtuser.Text) && Internals.validate(txtpass.Text)) //make sure usertext and passtext is valid // i shouldve validated in internals but its too late now { if (Internals.start(txtuser.Text, txtpass.Text) == true) //register user/pass { MessageBox.Show("Registered!"); this.Hide(); //hide form MainForm frm = new MainForm(); //create new form main frm.Show(); //show it } else { MessageBox.Show($"Welcome back, {Internals.grabusername()}!", "Welcome!"); this.Hide(); MainForm frm = new MainForm();//just in case if there is an erro frm.Show(); } } else { MessageBox.Show("Username & password must be at least 5 charcters"); }//im just gonna mess up on porpose }
private void InformationToolStripMenuItem_Click(object sender, EventArgs e) { MessageBox.Show($"Username:{Internals.grabusername()} \nVersion:0.0.0.1\nTotal Saved passwords:{listView1.Items.Count} ", "The vault", MessageBoxButtons.OK, MessageBoxIcon.Information); }