Exemplo n.º 1
0
        private void loadFile_Click(object sender, EventArgs e)
        {
            string file = audioManipulation.getFille("(*.wav)|*.wav");

            if (Path.GetExtension(file) == ".wav")
            {
                audioBeforeSteganography = audioManipulation.getWavFile(file);
                isSteganograph.Text      = audioSteganography.CheckWav(audioBeforeSteganography);
                AudioPlayOrginal         = new AudioPlay(file);
                var bitsToEncode = new BindingList <KeyValuePair <int, int> >();
                for (int i = 1; i <= audioBeforeSteganography.bitsPerSample; i++)
                {
                    bitsToEncode.Add(new KeyValuePair <int, int>(i, i));
                }
                comboBox1.Visible       = true;
                comboBox1.DataSource    = bitsToEncode;
                comboBox1.ValueMember   = "Key";
                comboBox1.DisplayMember = "Value";
                comboBox1.SelectedIndex = 0;
                label1.Visible          = true;;
                encodeLabel.Text        = string.Format("Wykożystujesz plik wave: {0}", Path.GetFileName(file));
                encodeLabel.Visible     = true;
                calculateFreeMemorySize();
            }
        }
        private void loadSteganographWav_Click(object sender, EventArgs e)
        {
            string file = audioManipulation.getFille("(*.wav)|*.wav");

            if (Path.GetExtension(file) == ".wav")
            {
                audioSteganohraph     = audioManipulation.getWavFile(file);
                AudioPlaySteganohraph = new AudioPlay(file);
                fille2Label.ForeColor = Color.Black;
                fille2Label.Text      = string.Format("Wykożystujesz plik wave: {0}", Path.GetFileName(file));
                fille2Label.Visible   = true;
            }
            else
            {
                AudioPlaySteganohraph = null;
                audioSteganohraph     = null;
                fille2Label.Text      = "Nie wybrałeś pliku wav";
                fille2Label.ForeColor = Color.Red;
                if (audioSteganohraphIsPalyed)
                {
                    AudioPlaySteganohraph.Pause();
                    audioSteganohraphIsPalyed = false;
                    playSteganograph.Text     = "Play";
                }
            }
        }
Exemplo n.º 3
0
        private void encode_Click(object sender, EventArgs e)
        {
            int bity;

            if (audioBeforeSteganography != null && textBytes != null && int.TryParse(comboBox1.Text, out bity) && taken <= maxsize)
            {
                audioAfterSteganography = audioSteganography.EncryptBinaryInWave(audioBeforeSteganography.data, textBytes, bity, "txt");
                string file = audioManipulation.saveWav(audioBeforeSteganography, message);
                if (Path.GetExtension(file) == ".wav")
                {
                    AudioPlaySteganography = new AudioPlay(file);
                }
            }
            else
            {
                message.Text      = "Coś jest nietak z podanymi danymi";
                message.ForeColor = Color.Red;
            }
        }
Exemplo n.º 4
0
        private void loadFile_Click(object sender, EventArgs e)
        {
            string file = audioManipulation.getFille("(*.wav)|*.wav");

            if (file != "none" && Path.GetExtension(file) == ".wav")
            {
                audioStrganograph   = audioManipulation.getWavFile(file);
                isSteganograph.Text = audioSteganography.CheckWav(audioStrganograph);
                label1.Text         = string.Format("Używasz pliku wave: {0}", Path.GetFileName(file));
                var bitsToEncode = new BindingList <KeyValuePair <int, int> >();
                for (int i = 1; i <= audioStrganograph.bitsPerSample; i++)
                {
                    bitsToEncode.Add(new KeyValuePair <int, int>(i, i));
                }
                comboBox1.Visible       = true;
                comboBox1.DataSource    = bitsToEncode;
                comboBox1.ValueMember   = "Key";
                comboBox1.DisplayMember = "Value";
                comboBox1.SelectedIndex = 0;
                AudioPlay = new AudioPlay(file);
            }
        }
        private void encode_Click(object sender, EventArgs e)
        {
            int bity;

            if (audioBeforeSteganography == null)
            {
                encodeLabel.Text      = "Nie wybrałeś pliku wav";
                encodeLabel.ForeColor = Color.Red;
                return;
            }
            if (textBytes == null)
            {
                decodeLabel.Text      = "Nie wybrałeś pliku do zakodowania";
                decodeLabel.ForeColor = Color.Red;
                return;
            }

            if (audioBeforeSteganography != null && textBytes != null && int.TryParse(comboBox1.Text, out bity) && taken <= maxsize)
            {
                audioAfterSteganography = audioSteganography.EncryptBinaryInWave(audioBeforeSteganography.data, textBytes, bity, encodedeExtensionAnyFille);
                string file = audioManipulation.saveWav(audioBeforeSteganography, message);
                if (Path.GetExtension(file) == ".wav")
                {
                    AudioPlaySteganography = new AudioPlay(file);
                }
                playSteganograph.Visible = true;
                label5.Visible           = true;
            }
            else
            {
                message.Text             = "Coś jest nietak z podanymi danymi być może plik który chcesz zakodować jest za duży";
                message.ForeColor        = Color.Red;
                playSteganograph.Visible = false;
                label5.Visible           = false;
            }
        }