Exemplo n.º 1
0
        private static void Output()
        {
            // The password used to hide the information on the previous step
            var _PASSWORD = "******";

            // The path to the image that contains the hidden information
            ///Users/surajfehintola/RiderProjects/Steganography/Steganography.ConsoleApplication/img/screen.png
            var pathImageWithHiddenInformation =
                @"/Users/surajfehintola/RiderProjects/Steganography/Steganography.ConsoleApplication/img/image_example_with_hidden_information.png";

            // Create an instance of the SteganographyHelper
            var helper = new SteganographyHelper();

            // Retrieve the encrypted data from the image
            var encryptedData = SteganographyHelper.ExtractText(
                new Bitmap(
                    Image.FromFile(pathImageWithHiddenInformation)
                    )
                );

            // Decrypt the retrieven data on the image
            var decryptedData = StringCipher.Decrypt(encryptedData, _PASSWORD);

            // Display the secret text in the console or in a messagebox
            // In our case is "Hello, no one should know that my password is 12345"
            Console.WriteLine(decryptedData);
            //MessageBox.Show(decryptedData);
        }
Exemplo n.º 2
0
        public static string Extract2(Image file, string _PASSWORD,
                                      string filePathResult)
        {
            // Retrieve the encrypted data from the image
            var encryptedData = SteganographyHelper.ExtractText(
                new Bitmap(
                    file
                    )
                );

            // Decrypt the retrieven data on the image
            var decryptedData = StringCipher.Decrypt(encryptedData, _PASSWORD);

            //data.Info = decryptedData;
            return(decryptedData);//data.Info; //(Bitmap) Image.FromFile(filePath);
        }
Exemplo n.º 3
0
        public static Bitmap Extract(DataModel data, HttpPostedFileBase file, string filePath, string _PASSWORD,
                                     string filePathResult)
        {
            // Retrieve the encrypted data from the image
            var encryptedData = SteganographyHelper.ExtractText(
                new Bitmap(
                    Image.FromFile(filePathResult)
                    )
                );

            // Decrypt the retrieven data on the image
            var decryptedData = StringCipher.Decrypt(encryptedData, _PASSWORD);

            data.Info = decryptedData;
            return((Bitmap)Image.FromFile(filePath));
        }