예제 #1
0
        private void Encode(string text)
        {
            LSB.Encode(bitmap, text);
            LSB.SetWatermark(bitmap);

            MainImage.Source     = Convert(bitmap);
            SaveButton.IsEnabled = true;
        }
예제 #2
0
        public void Encode_and_decode_text_to_bitmap()
        {
            var text   = "Some text that i want to pass through";
            var bitmap = new Bitmap(50, 50);

            LSB.Encode(bitmap, text);
            var decoded = LSB.Decode(bitmap);

            Assert.AreEqual(text, decoded);
        }
예제 #3
0
        public void All_together_now()
        {
            var text   = "Some text that i want to pass through";
            var key    = Guid.NewGuid();
            var bitmap = new Bitmap(50, 50);

            var encrypted = Crypter.Encrypt(text, key);

            LSB.Encode(bitmap, encrypted);
            var decoded   = LSB.Decode(bitmap);
            var decrypted = Crypter.Decrypt(decoded, key);

            Assert.AreEqual(text, decrypted);
        }
예제 #4
0
    public virtual void Encode()
    {
        var pixels = this.picture.GetPixels32();

        var message = this.message + "]|[";

        LSB.Encode(pixels, System.Text.Encoding.UTF8.GetBytes(message),
                   (code) => {
            if (code == LSB.Code.Success)
            {
                var result = new Texture2D(this.picture.width, this.picture.height);

                result.SetPixels32(pixels);

                this.onEncodeEvent.Invoke(result);
            }
        });
    }