SteganographyOnlineCodec 1.0.1

dotnet add package SteganographyOnlineCodec --version 1.0.1
                    
NuGet\Install-Package SteganographyOnlineCodec -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="SteganographyOnlineCodec" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SteganographyOnlineCodec" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="SteganographyOnlineCodec" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SteganographyOnlineCodec --version 1.0.1
                    
#r "nuget: SteganographyOnlineCodec, 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.
#:package SteganographyOnlineCodec@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SteganographyOnlineCodec&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=SteganographyOnlineCodec&version=1.0.1
                    
Install as a Cake Tool

Steganography Online Codec SDK for C# & NuGet

Steganographic Online Codec allows you to hide a password encrypted message within the images & photos using AES encryption algorithm with a 256-bit PBKDF2 derived key.

You can use it for free at:

https://www.pelock.com/products/steganography-online-codec

This SDK provides programming access to the codec and its encoding and decoding functions through a WebAPI interface.

What is steganography & how it works?

Steganography is a term describing the art and science of hiding information by embedding messages within other, seemingly harmless image files.

In this case, the individual bits of the encrypted hidden message are saved as the least significant (LSB) bits in the RGB color components in the pixels of the selected image.

Steganography Online Codec - Hide Message in Image

With our steganographic encoder you will be able to conceal any text message in the image in a secure way and send it without raising any suspicion. It will only be possible to read the message after providing valid, decryption password.

Installation

The preferred way of Web API SDK installation is via NuGet (recommended: Visual Studio NuGet Package Manager, dotnet CLI).

Run:

dotnet add package SteganographyOnlineCodec

Or add this entry:

<ItemGroup>
  <PackageReference Include="SteganographyOnlineCodec" Version="1.0.1" />
</ItemGroup>

directly inside your .csproj file (normally next to <PropertyGroup> / top-level <ItemGroup> for your executable or library).

The installation package is available at https://www.nuget.org/packages/SteganographyOnlineCodec

Packages for other programming languages

The installation packages have been uploaded to repositories for several popular programming languages and their source codes have been published on GitHub:

Repository Language Installation Package GitHub
PyPI repository for Python Python Run pip install steganography-online-codec PyPI Sources
NPM repository for JavaScript and TypeScript JavaScript, TypeScript Run npm i steganography-online-codec or add "steganography-online-codec": "latest" under dependencies in package.json NPM Sources
Rust crates.io Rust Run cargo add steganography-online-codec or add steganography-online-codec = "1" to Cargo.toml (optional: git / path for unreleased or vendored builds) crates.io Sources
NuGet repository for .NET C#, .NET Run dotnet add package SteganographyOnlineCodec or add <PackageReference Include="SteganographyOnlineCodec" Version="1.0.1" /> inside your .csproj (1.0.1 aligns with published SDK semver; substitute newer semver when adopting updates) NuGet Sources
Alternative usage

If you don't want to use the NuGet feed, bind the SDK .csproj directly:

dotnet add reference path\to\SteganographyOnlineCodec.csproj

(or add <ProjectReference Include="..\..\src\SteganographyOnlineCodec\SteganographyOnlineCodec.csproj" /> inside your owning .csproj, adjusting Include accordingly.)

How to hide a secret message within an image file

/******************************************************************************
 *
 * Steganography Online Codec WebApi interface usage example.
 *
 * In this example shows how to hide an encrypted secret message in an image file.
 *
 * Version      : v1.00
 * Language     : C#
 * Author       : Bartosz Wójcik (original example)
 * Project      : https://www.pelock.com/products/steganography-online-codec
 * Homepage     : https://www.pelock.com
 *
 * @copyright Copyright (c) 2020-2026 PELock LLC
 * @license Apache-2.0
 *
 ******************************************************************************/

using PELock;
// NuGet PackageReference Include="SteganographyOnlineCodec"
// or locally: dotnet add reference ..\src\SteganographyOnlineCodec\SteganographyOnlineCodec.csproj

// create Steganography Online Codec class instance (activation key placeholder)
using var codec = new SteganographyOnlineCodec("YOUR-WEB-API-KEY");

// encode a hidden message (encrypted with your password) within an image file
const string InputFile = "input_file.jpg";
const string SecretMessage = "Secret message";
const string Password = "Pa$$word";
const string OutputFile = "output_file_with_hidden_secret_message.png";

try
{
	await codec.EncodeAsync(InputFile, SecretMessage, Password, OutputFile).ConfigureAwait(false);

	// EncodeResult exposes license telemetry when available.
	Console.WriteLine("Secret messaged encoded and saved to the output PNG file.");
}
catch (SteganographyApiException err)
{
	Console.Error.WriteLine("Encoding failed: " + (!string.IsNullOrEmpty(err.Message)
		? err.Message
		: $"Error code {err.Error}"));
}

More complex example with better explanation and proper error codes checking

/******************************************************************************
 *
 * Steganography Online Codec WebApi interface usage example.
 *
 * In this example, we will see how to hide an encrypted message in an
 * image file using our codec.
 *
 * Version      : v1.00
 * Language     : C#
 * Author       : Bartosz Wójcik
 * Project      : https://www.pelock.com/products/steganography-online-codec
 * Homepage     : https://www.pelock.com
 *
 * @copyright Copyright (c) 2020-2026 PELock LLC
 * @license Apache-2.0
 *
 ******************************************************************************/

using System.Text.Json;
using PELock;

// NuGet PackageReference Include="SteganographyOnlineCodec"
// or locally: dotnet add reference ..\src\SteganographyOnlineCodec\SteganographyOnlineCodec.csproj


// create Steganography Online Codec class instance (activation key placeholder)
using var codec = new SteganographyOnlineCodec("YOUR-WEB-API-KEY");

// encode a hidden message within the source image file
// full version image size limit is set to 10 MB (demo 50 kB max)
// supported image formats are PNG, JPG, GIF, BMP, WBMP, GD2, AVIF, WEBP (mail me for more)
string inputFilePath = "input_file.webp";

// full version message size is unlimited (demo 16 chars max)
const string SecretMessage = "Secret message";

// full version password length is 128 characters max (demo 8 chars max)
const string Password = "Pa$$word";

// where to save encoded image with the secret message
string outputFilePath = "output_file_with_hidden_secret_message.png";

try
{
	// encode a hidden message (encrypted with your password) within an image file
	EncodeResult result =
		await codec.EncodeAsync(inputFilePath, SecretMessage, Password, outputFilePath).ConfigureAwait(false);

	string versionType = result.License?.ActivationStatus == true ? "full" : "demo";
	Console.WriteLine($"You are running in {versionType} version");

	Console.WriteLine($"Secret messaged encoded and saved to {outputFilePath}");

	if (result.License?.UsagesCount.HasValue ?? false)
		Console.WriteLine($"Remaining number of usage credits - {result.License!.UsagesCount}");
}
catch (SteganographyApiException err)
{
	int errorCode = err.Error;

	switch (errorCode)
	{
	case Errors.InvalidInput:
		Console.WriteLine($"Invalid input file {inputFilePath} or file doesn't exist");
		break;
	case Errors.MessageTooLong:
		Console.WriteLine("Message is too long for the provided image file, use larger file");
		break;
	case Errors.ImageTooBig:
		Console.WriteLine($"Image file is too big, current limit is set to {ReadLimitLong(err.Raw, "maxFileSize")}");
		break;
	case Errors.LimitMessage:
		Console.WriteLine($"Message is too long, current limit is set to {ReadLimitLong(err.Raw, "maxMessageLen")}");
		break;
	case Errors.LimitPassword:
		Console.WriteLine($"Password is too long, current limit is set to {ReadLimitLong(err.Raw, "maxPasswordLen")}");
		break;
	case Errors.InvalidPassword:
		Console.WriteLine("Invalid password");
		break;
	default:
		Console.WriteLine($"An error occurred: {(!string.IsNullOrEmpty(err.Message) ? err.Message : $"Error code {errorCode}")}");
		break;
	}
}

static string ReadLimitLong(JsonElement? payload, string key)
{
	if (payload.HasValue &&
		payload.Value.TryGetProperty("limits", out JsonElement limits) &&
		limits.TryGetProperty(key, out JsonElement probe) &&
		probe.ValueKind == JsonValueKind.Number &&
		probe.TryGetInt64(out long value))
	{
		return value.ToString();
	}

	return "unknown";
}

How to extract encoded secret message from the image file

/******************************************************************************
 *
 * Steganography Online Codec WebApi interface usage example.
 *
 * In this example, we will see how to extract a previously encrypted & hidden
 * secret message from an image file.
 *
 * Version      : v1.00
 * Language     : C#
 * Author       : Bartosz Wójcik
 * Project      : https://www.pelock.com/products/steganography-online-codec
 * Homepage     : https://www.pelock.com
 *
 * @copyright Copyright (c) 2020-2026 PELock LLC
 * @license Apache-2.0
 *
 ******************************************************************************/

using System.Text.Json;
using PELock;

// NuGet PackageReference Include="SteganographyOnlineCodec"
// or locally: dotnet add reference ..\src\SteganographyOnlineCodec\SteganographyOnlineCodec.csproj

// create Steganography Online Codec class instance (activation key placeholder)
using var codec = new SteganographyOnlineCodec("YOUR-WEB-API-KEY");

// extract a hidden message from the previously encoded image file
// full version image size limit is set to 10 MB (demo 50 kB max)
// supported image format is PNG and only PNG!
string inputFilePath = "output_file_with_hidden_secret_message.png";

// full version password length is 128 characters max (demo 8 chars max)
const string Password = "Pa$$word";

try
{
	// extract a hidden message from the image (PNG files only)
	DecodeResult result =
		await codec.DecodeAsync(inputFilePath, Password).ConfigureAwait(false);

	string runningVersion = result.License?.ActivationStatus == true ? "full" : "demo";

	Console.WriteLine($"You are running in {runningVersion} version");

	Console.WriteLine($"Secret message is \"{result.Message}\"");

	if (result.License?.UsagesCount.HasValue ?? false)
		Console.WriteLine($"Remaining number of usage credits - {result.License!.UsagesCount}");
}
catch (SteganographyApiException err)
{
	switch (err.Error)
	{
	case Errors.InvalidInput:
		Console.WriteLine($"Invalid input file {inputFilePath} or file doesn't exist");
		break;
	case Errors.ImageTooBig:
		Console.WriteLine($"Image file is too big, current limit is set to {ReadLimitDecode(err.Raw, "maxFileSize")}");
		break;
	case Errors.LimitMessage:
		Console.WriteLine($"Extracted message is too long, current limit is set to {ReadLimitDecode(err.Raw, "maxMessageLen")}");
		break;
	case Errors.LimitPassword:
		Console.WriteLine($"Password is too long, current limit is set to {ReadLimitDecode(err.Raw, "maxPasswordLen")}");
		break;
	case Errors.InvalidPassword:
		Console.WriteLine("Invalid password");
		break;
	default:
		Console.WriteLine($"An error occurred: {(string.IsNullOrEmpty(err.Message) ? $"API error code {err.Error}" : err.Message)}");
		break;
	}
}

static string ReadLimitDecode(JsonElement? payload, string key)
{
	if (payload.HasValue &&
		payload.Value.TryGetProperty("limits", out JsonElement limits) &&
		limits.TryGetProperty(key, out JsonElement probe) &&
		probe.ValueKind == JsonValueKind.Number &&
		probe.TryGetInt64(out long value))
	{
		return value.ToString();
	}

	return "unknown";
}

How to check the license key status & current limits

/******************************************************************************
 *
 * Steganography Online Codec WebApi interface usage example.
 *
 * In this example we will verify our activation key status.
 *
 * Version      : v1.00
 * Language     : C#
 * Author       : Bartosz Wójcik
 * Project      : https://www.pelock.com/products/steganography-online-codec
 * Homepage     : https://www.pelock.com
 *
 * @copyright Copyright (c) 2020-2026 PELock LLC
 * @license Apache-2.0
 *
 ******************************************************************************/

using PELock;

// NuGet PackageReference Include="SteganographyOnlineCodec"
// or locally: dotnet add reference ..\src\SteganographyOnlineCodec\SteganographyOnlineCodec.csproj

// create Steganography Online Codec class instance (activation key placeholder)
using var codec = new SteganographyOnlineCodec("YOUR-WEB-API-KEY");

// login to the service
try
{
	LoginResult result =
		await codec.LoginAsync().ConfigureAwait(false);

	string versionType =
		result.License?.ActivationStatus == true ? "full" : "demo";

	Console.WriteLine($"You are running in {versionType} version");

	if (result.License?.ActivationStatus == true)
	{
		Console.WriteLine($"Registered for - {result.License!.UserName}");
		string licenseType = result.License.Type == 0 ? "personal" : "company";
		Console.WriteLine($"License type - {licenseType}");
		Console.WriteLine($"Total number of purchased usage credits - {result.License.UsagesTotal}");
		Console.WriteLine($"Remaining number of usage credits - {result.License.UsagesCount}");
	}

	if (result.Limits != null)
	{
		Console.WriteLine($"Max. password length - {result.Limits.MaxPasswordLen}");
		string msgLen = result.Limits.MaxMessageLen == -1 ? "unlimited" : result.Limits.MaxMessageLen.ToString();
		Console.WriteLine($"Max. message length - {msgLen}");
		Console.WriteLine($"Max. input image file size - {codec.ConvertSize(result.Limits.MaxFileSize)}");
	}
}
catch (SteganographyApiException err)
{
	Console.Error.WriteLine("Login failed: " + (!string.IsNullOrEmpty(err.Message) ? err.Message : $"Error code {err.Error}"));
}

Got questions?

If you are interested in the Steganography Online Codec Web API or have any questions regarding SDK packages, technical or if something is not clear, please contact me. I'll be happy to answer all of your questions.

Bartosz Wójcik

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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.1 73 4/29/2026
1.0.0 85 4/28/2026