Stegosaurus 1.0.4-beta
dotnet add package Stegosaurus --version 1.0.4-beta
NuGet\Install-Package Stegosaurus -Version 1.0.4-beta
<PackageReference Include="Stegosaurus" Version="1.0.4-beta" />
<PackageVersion Include="Stegosaurus" Version="1.0.4-beta" />
<PackageReference Include="Stegosaurus" />
paket add Stegosaurus --version 1.0.4-beta
#r "nuget: Stegosaurus, 1.0.4-beta"
#addin nuget:?package=Stegosaurus&version=1.0.4-beta&prerelease
#tool nuget:?package=Stegosaurus&version=1.0.4-beta&prerelease
Stegosaurus
Stegosaurus is a lightweight command-line tool written in C# for securely hiding encrypted messages inside PNG images using LSB (Least Significant Bit) steganography.
It combines strong AES encryption (via PBKDF2-derived keys) with image steganography, making it suitable for sending secret messages disguised inside innocuous-looking image files.
π Features
- AES-256 encryption with a password-derived key (PBKDF2 + SHA256)
- LSB steganography using R, G, B channels (alpha is untouched)
- PRNG-controlled encoding Pseudo-random number generator (PRNG) for added entropy based on password hash
- Graceful error handling for corrupt, small, or invalid image files
- PNG-only for now β JPG support would require DCT-based encoding
π¦ Installation
Stegosaurus is currently in beta because it depends on the beta version of the System.CommandLine
package.
dotnet add package Stegosaurus --version 1.0.4-beta
Or manually add it to your .csproj file:
<PackageReference Include="Stegosaurus" Version="1.0.4-beta" />
π Usage
Build
dotnet build
Encrypt & Encode
dotnet run -- encrypt -f image.png -m "Secret message here" -o hidden_output.png
Or enter your password at the command line (not recommended, but convenient for scripting/testing):
dotnet run -- encrypt -f image.png -p yourpassword -m "Secret message" -o hidden_output.png
Decode & Decrypt
dotnet run -- decrypt -f hidden_output.png -o secret.txt
π CLI Flags
Flag | Description | Required |
---|---|---|
-f , --file |
Path to input PNG file | β |
-m , --message |
Message to hide (encrypt only) | β for encrypt |
-p , --password |
Password for encryption/decryption | β |
-o , --outfile |
Optional output path for result | β |
β οΈ Notes
- Only
.png
files are supported. JPEGs use lossy compression, which discards subtle data like LSBs. To hide data in.jpg
files, you'd need to use DCT-based steganography (Discrete Cosine Transform), which this tool does not support. - During encoding, the alpha (transparency) channel is ignored to avoid visual artifacts. Only the RGB channels are modified, as changes to alpha values are more likely to cause noticeable distortions.
- Image must be large enough to store both prefix and encrypted payload, or an error will be thrown and the program will exit gracefully.
- Corrupt PNGs or tampered files will throw appropriate errors and exit gracefully.
- If you donβt provide a password via the command line, the program will prompt you securely. This is recommended to avoid exposing the password in terminal history or logs.
- If you donβt specify an --outfile, one will be auto-generated based on the input fileβs name with a timestamp. For decryption/decoding, the output will default to a .txt file.
π§ͺ Testing
Unit tests live in Stegosaurus.Tests/
. To run them:
dotnet test
π¦ Packaging (Coming Soon)
Plans to publish this as a .NET tool (dotnet tool install
) are in progress, including CI/CD via GitHub Actions.
π Tech Stack
- C# (.NET 8)
- ImageSharp for pixel-level image access
System.Security.Cryptography
for AES + PBKDF2
βοΈ Author
Made by Michael Pearce
π michaelpearce.tech β’ π GitHub
π License
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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. |
-
net8.0
- Microsoft.Extensions.Logging (>= 9.0.2)
- Serilog (>= 4.2.0)
- Serilog.Extensions.Logging (>= 9.0.0)
- Serilog.Sinks.Console (>= 6.0.0)
- SixLabors.ImageSharp (>= 3.1.7)
- System.CommandLine (>= 2.0.0-beta4.22272.1)
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.4-beta | 444 | 3/24/2025 |
1.0.3-beta | 435 | 3/24/2025 |
1.0.2-beta | 434 | 3/24/2025 |
1.0.1-beta | 436 | 3/24/2025 |
1.0.0-beta | 438 | 3/24/2025 |