private void btnShowPassword_Click(object sender, EventArgs e) { string hashPass = listView1.SelectedItems[0].SubItems[2].Text; Cryptography c = new Cryptography(); string decodePassword = c.AESDecryption(hashPass); listView1.SelectedItems[0].SubItems[2].Text = decodePassword; String password = listView1.SelectedItems[0].SubItems[3].Text; }
private void button3_Click_1(object sender, EventArgs e) { Cryptography cryptography = new Cryptography(); String value = "Ala ma kota i psa"; /* byte[] encrypt = cryptography.AESEncryption(value);*/ string encrypt = cryptography.AESEncryption(value); /* Console.WriteLine("Encrypt : " + Encoding.UTF8.GetString(encrypt, 0, encrypt.Length));*/ String result = cryptography.AESDecryption(encrypt); Console.WriteLine("Result decrypt text : " + result); cryptography.EncryptSHA512(value); }
private void ButtonInsert_Click(object sender, EventArgs e) { Cryptography c = new Cryptography(); DataBase dataBase = new DataBase(); HashPassword = c.AESEncryption(textPassword.Text); /* Console.WriteLine("HAshcode 1" + Encoding.ASCII.GetString(HashPassword));*/ dataBase.AddPassword(textTitle.Text, textlogin.Text, HashPassword, textWebAddress.Text, textDesc.Text, Files.filePath); listView1.Items.Add(new ListViewItem(new string[] { textTitle.Text, textlogin.Text, HashPassword, textWebAddress.Text, textDesc.Text })); string decodePassword = c.AESDecryption(HashPassword); Console.WriteLine("Odszyfrowane hasło: " + decodePassword); }