diff --git a/Password Manager/MainForm.cs b/Password Manager/MainForm.cs index 70766c0..2cd37e6 100644 --- a/Password Manager/MainForm.cs +++ b/Password Manager/MainForm.cs @@ -1,5 +1,3 @@ -using System.Diagnostics; - namespace Password_Manager { sealed public partial class MainForm : Form @@ -47,34 +45,6 @@ namespace Password_Manager private void Decrypt(object sender, EventArgs e) { - string fileName = ResultList.Text; - try - { - Process proc = new Process() - { - StartInfo = new ProcessStartInfo - { - FileName = "gpg.exe", - Arguments = $"--quiet --decrypt {PathRequest()}\\{fileName}", - UseShellExecute = false, - RedirectStandardOutput = true, - CreateNoWindow = true - } - }; - - proc.Start(); - while (!proc.StandardOutput.EndOfStream) - { - string line = proc.StandardOutput.ReadLine(); - Clipboard.SetText(line); - Process.Start("./ToastNotification.exe", $"\"{fileName} decrypted\" \"Password copied to clipboard\""); - } - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - Close(); } } diff --git a/Password Manager/PasswordGenerator.cs b/Password Manager/PasswordGenerator.cs index 9fda065..83a2f0c 100644 --- a/Password Manager/PasswordGenerator.cs +++ b/Password Manager/PasswordGenerator.cs @@ -1,5 +1,3 @@ -using System.Text; -using System.Diagnostics; namespace Password_Generator { @@ -34,33 +32,6 @@ namespace Password_Generator public static string? New(string recipient, int length, bool no_symbols = false) { - try - { - Process proc = new Process() - { - StartInfo = new ProcessStartInfo - { - FileName = "cmd.exe", //TODO: pipe the return value of RandomStr to gpg with the --quiet --encrypt --recipient {recipient} flags - Arguments = $"echo {RandomStr(length, no_symbols)} | gpg --quiet --encrypt --recipient {recipient}", - UseShellExecute = false, - RedirectStandardOutput = true, - CreateNoWindow = true - } - }; - proc.Start(); - - StringBuilder builder = new StringBuilder(); - while (!proc.StandardOutput.EndOfStream) - { - builder.Append(proc.StandardOutput.ReadLine()); - } - return builder.ToString(); - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - return null; } } }