Exemplo n.º 1
0
        private void btnProses1_Click(object sender, EventArgs e)
        {
            string text = secretTextBox.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 < 6)
                {
                    MessageBox.Show("Please enter a password with at least 6 characters", "Warning");

                    return;
                }
                else
                {
                    //MessageBox.Show("Password Accepted");
                    text = CryptoAES.EncryptStringAES(text, passwordTextBox.Text);
                }
            }
            stego             = SteganoLSB.embedText(text, bmp);
            pictureBox1.Image = stego;

            MessageBox.Show("Message has been hidden successfully!", "Success");
            btnSimpan1.Enabled = true;
        }
Exemplo n.º 2
0
        private void btnProses2_Click(object sender, EventArgs e)
        {
            bmp = (Bitmap)imagePictureBox2.Image;

            //System.IO.StreamReader myFile = new System.IO.StreamReader

            string hiddenText = SteganoLSB.extractText(bmp);

            if (decryptCheckBox.Checked)
            {
                try
                {
                    hiddenText = CryptoAES.DecryptStringAES(hiddenText, passwordTextBox2.Text);
                }
                catch
                {
                    MessageBox.Show("Wrong password", "Error");

                    return;
                }
            }

            secretTextBox2.Text = hiddenText;
        }