private void saveKeysButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                // Fetch ingredients for private key
                long p = Convert.ToInt64(pTextBox.Text);
                long g = Convert.ToInt64(gTextBox.Text);
                long x = Convert.ToInt64(xTextBox.Text);

                // Generate key
                Key k = new Key(p, g, x);
                ElGamalApplication.Key.PrivateKey pri = k.GeneratePrivateKey();
                ElGamalApplication.Key.PublicKey pub = k.GeneratePublicKey();

                SaveFileDialog fileBrowser = new SaveFileDialog();

                Nullable<bool> result = fileBrowser.ShowDialog();

                if (result == true)
                {
                    string fileName = fileBrowser.FileName;
                    k.saveToFile(fileName);
                }
            }
            catch (Exception ex)
            {
                ShowMessageBox("Key generation failed.");
            }
        }
        private void generatePrivateKeyButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                // Fetch ingredients for private key
                long p = Convert.ToInt64(pTextBox.Text);
                long g = Convert.ToInt64(gTextBox.Text);
                long x = Convert.ToInt64(xTextBox.Text);

                // Generate key
                Key k = new Key(p, g, x);
                ElGamalApplication.Key.PrivateKey pri = k.GeneratePrivateKey();
                ElGamalApplication.Key.PublicKey pub = k.GeneratePublicKey();

                xTextBox.Text = pri.X.ToString();
                yTextBox.Text = pub.Y.ToString();
            }
            catch (Exception ex)
            {
                ShowMessageBox("Key generation failed.");
            }
        }