Esempio n. 1
0
        public void TestDecodeText()
        {
            algo = stegaFactory.GetImplementationByFormat(ESupportedAlgorithms.ClasicAlgo);
            string expectedText = "ali";
            Image  image        = Image.FromFile(@"c:\Users\Alina\Desktop\Temp\encoded.png");

            byte[] byteArrayText = null;
            algo.Decode(image, ref byteArrayText);


            string actualText = Encoding.Default.GetString(byteArrayText);

            Assert.AreEqual(expectedText, actualText);
        }
Esempio n. 2
0
        public void TestDecodeImage()
        {
            algo = stegaFactory.GetImplementationByFormat(ESupportedAlgorithms.ClasicAlgo);

            Image image  = Image.FromFile(@"c:\Users\Alina\Desktop\Temp\encoded.png");
            Image hidden = Image.FromFile(@"c:\Users\Alina\Desktop\Temp\hidded.png");

            byte[] expected      = Utils.BitmapToByteArray(hidden);
            byte[] byteArrayText = null;
            algo.Decode(image, ref byteArrayText);

            Image img = Utils.ByteArrayToBitmap(byteArrayText);

            img.Save(@"c:\Users\Alina\Desktop\Temp\decoded.png", ImageFormat.Png);
        }