Ejemplo n.º 1
0
        private void HIDEBUTTON_Click_1(object sender, EventArgs e)
        {
            image = (Bitmap)imagePictureBox.Image;

            string text = dataTextBox.Text;

            if (text.Equals(""))
            {
                MessageBox.Show("The text you want to hide can't be empty", "Warning");

                return;
            }

            if (encryptCheckBox.Checked)
            {
                if (passwordTextBox.Text.Length < 4)
                {
                    MessageBox.Show("Please enter a password with at least 4 characters", "Warning");

                    return;
                }
                else
                {
                    text = AESencrypt_ASTHRA.EncryptStrAES(text, passwordTextBox.Text);
                }
            }

            image = lsb_ASTHRA.HideText(text, image);

            MessageBox.Show("Your text was hidden in the image successfully!", "Done");

            notesLabel.Text      = "Notes: don't forget to save your new image.";
            notesLabel.ForeColor = Color.OrangeRed;
        }
Ejemplo n.º 2
0
        private void button4_Click(object sender, EventArgs e)
        {
            image = (Bitmap)imagePictureBox.Image;

            string extractedText = lsb_ASTHRA.extractText(image);

            if (encryptCheckBox.Checked)
            {
                try
                {
                    extractedText = AESencrypt_ASTHRA.DecryptStringAES(extractedText, passwordTextBox.Text);
                }
                catch
                {
                    MessageBox.Show("Wrong password", "Error");

                    return;
                }
            }

            dataTextBox.Text = extractedText;
        }