Ejemplo n.º 1
0
        public void TestProcess()
        {
            const string text  = "Pretty long text just to test if everything is working properly!";
            var          image = ColoredBitmap.CreateBitmap(100, 100);
            var          usage = new ChannelUsage(2);

            var pic     = Interface.Encrypt(image, usage, 0, text);
            var resText = Interface.Decrypt(pic, usage, 0);

            Assert.AreEqual(text, resText);
        }
Ejemplo n.º 2
0
        public void TestProcessHuge()
        {
            var text  = "Pretty long text just to test if everything is working properly! I'll therefore add some more text so the whole process takes some more time which makes it more suitable to compare the performance as well as changes to it. This is a 4k picture. This could theoretically take some time but we'll manage to process this extremely fast";
            var image = ColoredBitmap.CreateBitmap(3840, 2160);
            var usage = new ChannelUsage(2);

            var pic     = Interface.Encrypt(image, usage, 0, text);
            var resText = Interface.Decrypt(pic, usage, 0);

            Assert.AreEqual(text, resText);
        }
Ejemplo n.º 3
0
        public void TestProcessLarge()
        {
            const string text  = "Pretty long text just to test if everything is working properly! I'll therefore add some more text so the whole process takes some more time which makes it more suitable to compare the performance as well as changes to it.";
            var          image = ColoredBitmap.CreateBitmap(1920, 1080);
            var          usage = new ChannelUsage(2);

            var pic     = Interface.Encrypt(image, usage, 0, text);
            var resText = Interface.Decrypt(pic, usage, 0);

            Assert.AreEqual(text, resText);
        }
Ejemplo n.º 4
0
        public void TestEncrypt()
        {
            const string text    = "Sample text to hide";
            var          image   = ColoredBitmap.CreateBitmap(100, 100);
            var          usage   = new ChannelUsage(2);
            var          picture = Interface.Encrypt(image, usage, 0, text);

            var decrypter = new Decrypter(new Picture(picture));
            var resText   = decrypter.ReadText(usage);

            Assert.AreEqual(text, resText);
        }
Ejemplo n.º 5
0
        public void TestLong()
        {
            const string text      = "Pretty long text just to test if everything is working properly!";
            var          usage     = new ChannelUsage(2);
            var          encrypter = new Encrypter(new Picture(ColoredBitmap.CreateBitmap(20, 20, Color.Aqua), 0));

            encrypter.InsertText(text, usage);
            var picture = encrypter.GetPictureData();

            var decrypter = new Decrypter(picture);
            var res       = decrypter.ReadText(usage);

            Assert.AreEqual(text, res);
        }
Ejemplo n.º 6
0
        public void TestShort()
        {
            const string text      = "Sample Text to hide";
            var          usage     = new ChannelUsage(2);
            var          encrypter = new Encrypter(new Picture(ColoredBitmap.CreateBitmap(10, 10, Color.Aqua), 0));

            encrypter.InsertText(text, usage);
            var picture = encrypter.GetPictureData();

            var decrypter = new Decrypter(picture);
            var res       = decrypter.ReadText(usage);

            Assert.AreEqual(text, res);
        }
Ejemplo n.º 7
0
        public void TestDecrypt()
        {
            const string text    = "Sample text to hide";
            var          image   = ColoredBitmap.CreateBitmap(100, 100);
            var          usage   = new ChannelUsage(2);
            var          picture = new Encrypter(new Picture(image));

            picture.InsertText(text, usage);

            var endImage = picture.GetPictureData().GetImage();

            endImage.Save("image.png", ImageFormat.Png);

            var resText = Interface.Decrypt(endImage, usage, 0);

            Assert.AreEqual(text, resText);
        }
Ejemplo n.º 8
0
        public void TestSingleCharTagless()
        {
            const string text  = "s";
            var          image = ColoredBitmap.CreateBitmap(1, 1);
            var          usage = new ChannelUsage(2);

            var encrypter = new Encrypter(new Picture(image));

            encrypter.InsertText(text, usage, false);

            var resImage = encrypter.GetPictureData().GetImage();

            encrypter.Dispose();

            var decrypter = new Decrypter(new Picture(resImage));
            var resText   = decrypter.ReadText(usage, false);

            Assert.AreEqual(text, resText);
        }