Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/2alf/stegodon

C# steganography library with encryption and decryption.
https://github.com/2alf/stegodon

csharp nuget nuget-package steganography

Last synced: 5 days ago
JSON representation

C# steganography library with encryption and decryption.

Awesome Lists containing this project

README

        

# Stegodon

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

[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/C1C3UABOS)
![NuGet Downloads](https://img.shields.io/nuget/dt/Stegodon?style=for-the-badge&logo=c%23&logoColor=%2350FF00&label=INSTALLS&color=%233e9544)

### Made from scratch for the purpose of building the [Leonardo Desktop App](https://github.com/2alf/Leonardo).

## Contents:

>[Download](#download)

>[Usage](#usage)

>[Further info](#further-info)

## Download

### DLL Binary

>[Github](https://github.com/2alf/Stegodon/releases)

>[NuGet](https://www.nuget.org/packages/Stegodon)

### .NET Cli

```bash
dotnet add package Stegodon
```

### Visual studio:

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

## Usage

>[Encrypt](#encrypt)

>[Decrypt](#decrypt)

>[Text to binary](#text2binary)

>>[Binary to text](#binary2text)

### Encrypt

Encrypt() takes 2 arguments. First is `Bitmap` and the seocond one is a `string`.
```cs
// 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.
```cs
// 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.