Пример #1
0
        private void encryptButton_Click(object sender, EventArgs e)
        {
            GetKeyForm keyForm = new GetKeyForm(key);

            keyForm.ShowDialog();

            this.key = keyForm.getKey();

            if (this.key == null)
            {
                textReady = false;
            }
            else
            {
                textReady = true;
                if (textReady && imgready)
                {
                    EmbedButton.Enabled = true;
                }
                else
                {
                    EmbedButton.Enabled = false;
                }
            }
            keyForm = null;
        }
Пример #2
0
        private void extract_Click(object sender, EventArgs e)
        {
            inputTextBox.Text = null;
            if (!StegoApp.DeStego.isEmbedded(pixels, width, height))
            {
                MessageBox.Show("This image has no embedded data.",
                                "Something went wrong.",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Exclamation);
                return;
            }

            key = null;

            GetKeyForm keyForm = new GetKeyForm(key);

            keyForm.ShowDialog();

            this.key = keyForm.getKey();

            Cursor = Cursors.WaitCursor;
            if (key != null)
            {
                string text;
                try
                {
                    text = StegoApp.DeStego.extractData(pixels, width, height, key);
                    inputTextBox.Text = text;
                    Cursor            = Cursors.Default;
                }
                catch (Exception ex)
                {
                    Cursor = Cursors.Default;
                    MessageBox.Show(ex.Message + "\nIncorrect de-crypryion key or corrupted image.",
                                    "Something went wrong.",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                    return;
                }
            }
            else
            {
                Cursor = Cursors.Default;
                return;
            }
        }
Пример #3
0
        private void encryptButton_Click(object sender, EventArgs e)
        {
            GetKeyForm keyForm = new GetKeyForm(key);
            keyForm.ShowDialog();

            this.key = keyForm.getKey();

            if (this.key == null) {
                textReady = false;
            }
            else {
                textReady = true;
                if (textReady && imgready)
                    EmbedButton.Enabled = true;
                else
                    EmbedButton.Enabled = false;
            }
            keyForm = null;
        }
Пример #4
0
        private void extract_Click(object sender, EventArgs e)
        {
            inputTextBox.Text = null;
            if (!StegoApp.DeStego.isEmbedded(pixels, width, height))
            {
                MessageBox.Show("This image has no embedded data.",
                    "Something went wrong.",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Exclamation);
                return;
            }

            key = null;

            GetKeyForm keyForm = new GetKeyForm(key);
            keyForm.ShowDialog();

            this.key = keyForm.getKey();

            Cursor = Cursors.WaitCursor;
            if (key != null)
            {
                string text;
                try
                {
                    text = StegoApp.DeStego.extractData(pixels, width, height, key);
                    inputTextBox.Text = text;
                    Cursor = Cursors.Default;
                }
                catch (Exception ex)
                {
                    Cursor = Cursors.Default;
                    MessageBox.Show(ex.Message + "\nIncorrect de-crypryion key or corrupted image.",
                    "Something went wrong.",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
                return;
                }
            }
            else {
                Cursor = Cursors.Default;
                return;
            }
        }