StegoHelper 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package StegoHelper --version 1.0.1                
NuGet\Install-Package StegoHelper -Version 1.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="StegoHelper" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add StegoHelper --version 1.0.1                
#r "nuget: StegoHelper, 1.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install StegoHelper as a Cake Addin
#addin nuget:?package=StegoHelper&version=1.0.1

// Install StegoHelper as a Cake Tool
#tool nuget:?package=StegoHelper&version=1.0.1                

Summary

Simple helper to hide text into an image using LSB steganography. It also supports AES-256 encryption to enforce security of hidden text.

Example

using Cocona;
using StegoHelper;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;

namespace PoCSteganography
{
    class Program
    {
        static void Main(string[] args)
        {
            CoconaLiteApp.Run<Program>(args);
        }

        public void Hide([Option('f')] string imageFile, [Option('t')] string textFile, [Option('p')] string password = "")
        {
            if (File.Exists(imageFile) && File.Exists(textFile))
            {
                using (Image<Rgba32> inputImage = Image.Load<Rgba32>(imageFile))
                {
                    using (StreamReader sr = File.OpenText(textFile))
                    {
                        string text = sr.ReadToEnd();

                        if (!string.IsNullOrEmpty(password))
                            text = AESEncryptionHelper.Encrypt(text, password);

                        if (inputImage.Height * inputImage.Width * 3 / 8 >= text.Length)
                        {
                            Image outImage = SteganographyHelper.EmbedText(text, inputImage);
                            outImage.SaveAsPng("hidden.png");
                        }
                        else
                            Console.WriteLine("Espacio insuficente para almacenar el texto. Se requiere una imagen de mayores dimensiones");
                    }
                }
            }
            else
                Console.WriteLine("Archivo no encontrado");
        }

        public void Unhide([Option('f')] string file, [Option('p')] string password = "")
        {
            if (File.Exists(file))
            {
                using (Image<Rgba32> inputImage = Image.Load<Rgba32>(file))
                {
                    string text = SteganographyHelper.ExtractText(inputImage);

                    if (!string.IsNullOrEmpty(password))
                        text = AESEncryptionHelper.Decrypt(text, password);

                    File.WriteAllText("secret.txt", text);
                }
            }
            else
                Console.WriteLine("Archivo no encontrado");
        }
    }
}

Videotutorial - C# Steganography Step by Step (Spanish)

alternate text is missing from this package README image

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.2 951 6/28/2022
1.0.1 439 6/27/2022
1.0.0 465 6/26/2022