Example #1
0
        private void implantClick() //error checking needed here
        {
            SetPrimaryStatusLabelText("Implantation Running");
            Stopwatch s = new Stopwatch();

            s.Start();
            string imgPath  = pictureInBox.Text;
            string msgPath  = messageInBox.Text;
            string outPath  = picOutBox.Text;
            string password = pass1Box.Text;
            Bitmap b        = new Bitmap(imgPath);

            byte[] msg = File.ReadAllBytes(msgPath);
            //Console.WriteLine("msg Length--" + msg.Length);
            byte[] messageBytes = StegoHandler.addEOF(msg);
            //Console.WriteLine("message Length--" + messageBytes.Length);
            byte[] encryptedMsg = AES.encryptionMain(password, messageBytes);
            Console.WriteLine("Time to encryption: " + s.ElapsedMilliseconds);
            //Console.WriteLine("encrypted Length--" + encryptedMsg.Length);
            b = StegoHandler.implantMain(password, b, encryptedMsg);
            Console.WriteLine("Time to implant: " + s.ElapsedMilliseconds);
            b.Save(outPath, ImageFormat.Png);
            s.Stop();
            SetPrimaryStatusLabelText("Implantation Complete. Time: " + s.ElapsedMilliseconds + "ms.");
        }
Example #2
0
        private void extractClick() //error checking needed here
        {
            SetPrimaryStatusLabelText("Extraction Running");
            Stopwatch s = new Stopwatch();

            s.Start();
            string imgPath  = pictureInBox.Text;
            string msgPath  = messageOutBox.Text;
            string password = passBox.Text;
            Bitmap b        = new Bitmap(imgPath);

            if (!StegoHandler.checkHash(password, b))
            {
                SetPrimaryStatusLabelText("Error: Wrong password or not a Stego File");
            }
            else
            {
                byte[] msg       = StegoHandler.extractMain(password, b);
                byte[] decrypted = AES.decryptionMain(password, msg);
                decrypted = StegoHandler.chopEOF(decrypted);
                File.WriteAllBytes(msgPath, decrypted);
                s.Stop();
                SetPrimaryStatusLabelText("Extraction Complete. Time: " + s.ElapsedMilliseconds + "ms.");
            }
        }
Example #3
0
 private void calculatePossibleSize(int imgSize)
 {
     this.possibleSize = StegoHandler.availableBytes(imgSize);
 }