Skip to content

2alf/Stegodon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Stegodon

Quick and easy C# steganography library for encrypting and decrypting strings into image files when building .NET Framework apps.

ko-fi NuGet Downloads

Made from scratch for the purpose of building the Leonardo Desktop App.

Contents:

Download

Usage

Further info

Download

DLL Binary

Github

NuGet

.NET Cli

dotnet add package Stegodon

Visual studio:

Right click on your project solution and go to your NuGet package manager.

Usage

Encrypt

Decrypt

Text to binary

Binary to text

Encrypt

Encrypt() takes 2 arguments. First is Bitmap and the seocond one is a string.

// Example
string imagePath = "path/to/your/img.jpg"
string secretMsg = "p@55w0rd"

Bitmap encryptedImage = Stegodon.Encrypt(new Bitmap(imagePath), secretMsg);

Output is a prompt to save your image as a .png file.

Decrypt

Decrypt() takes a Bitmap argument. In the below example we assume that the user wants to decrypt a string from an image.

// Example
string imagePath = openFileDialog.FileName;
Bitmap chosenImg = new Bitmap(imagePath);

Stegodon.Decrypt(chosenImg);

Output is the decrypted string.

Text2binary

Txt2Bin(string text) Converts a string into a binary format suitable for embedding into an image.

Binary2text

Bin2Txt(string binaryMessage) Converts a binary string back into readable text.

Further info

The solution I made isn’t anything new and broad, but it is concentrated in allowing users to use steganography easily to encrypt and decrypt strings into and from image files. The encryption process first normalizes the image making sure all pixel data is even to minimize error whilst injecting new bits into the file and to avoid breaking pixels. Then we just embed string binary data into the least significant bits of each RGB color channel. The decryption is simply extracting back information from the LSB of each channel.