public void TestEncodeImage() { algo = stegaFactory.GetImplementationByFormat(ESupportedAlgorithms.ClasicAlgo); Image hidden = Image.FromFile(@"c:\Users\Alina\Desktop\Temp\hidden.png"); Image image = Image.FromFile(@"c:\Users\Alina\Desktop\Temp\innocuous.png"); Image imageNotModified = Image.FromFile(@"c:\Users\Alina\Desktop\Temp\innocuous.png"); byte[] hiddenArrayBytes = Utils.BitmapToByteArray(hidden); algo.Encode(ref image, hiddenArrayBytes); Assert.AreNotEqual(imageNotModified, image); image.Save(@"c:\Users\Alina\Desktop\Temp\encoded.png", ImageFormat.Png); }
public void TestEncodeText() { string hiddenText = "ali"; algo = stegaFactory.GetImplementationByFormat(ESupportedAlgorithms.ClasicAlgo); byte[] hiddenArrayBytes = Encoding.ASCII.GetBytes(hiddenText); Image image = Image.FromFile(@"c:\Users\Alina\Desktop\Temp\innocuous.png"); Image imageNotModified = Image.FromFile(@"c:\Users\Alina\Desktop\Temp\innocuous.png"); algo.Encode(ref image, hiddenArrayBytes); Assert.AreNotEqual(imageNotModified, image); image.Save(@"c:\Users\Alina\Desktop\Temp\encoded.png", ImageFormat.Png); }