Skip to main content

High-performance Rust-powered tool to inspect, strip metadata, and hide messages in PNG files.

Reason this release was yanked:

Accidental version bump — use 0.3.0 instead

Project description

PNG Parser (WASM & Python)

License: MIT Rust WASM Python

A high-performance PNG steganography and parsing engine written in Rust. Securely hide, read, and manage encrypted messages within PNG files using a unified core available for both JavaScript (WebAssembly) and Python.

📦 Available Packages

Platform Installation Status
JS / WASM npm i @pranjalpanging/png-parser ✅ Published
Python pip install png-parser ✅ Published

✨ Features

  • Zero-Overwrite Steganography: Uses custom stEg ancillary chunks that don't affect image pixels or quality.
  • Optional AES-256-GCM Encryption: Secure your messages with industrial-grade encryption (PBKDF2 key derivation).
  • Automatic Detection: Smart logic automatically detects if a message is plain text or encrypted during reading.
  • Blazing Fast: Core logic implemented in Rust for maximum speed and memory safety.
  • Valid PNG Structure: Files remain 100% compliant with PNG standards and open in any standard viewer.

🐍 Python Usage

1. Hiding a Message

You can hide a message as plain text or encrypt it by simply providing a password.

import png_parser

# Option A: Simple hiding (Plain Text)
png_parser.hide("input.png", "Hello World")

# Option B: Secure hiding (AES-256-GCM Encryption)
png_parser.hide("input.png", "Top Secret Data", password="my_secure_password")

2. Reading a Message

Extract the hidden data from the image.The parser detects the encryption flag. If you try to read an encrypted message without a password, it will return an error.

import png_parser

# Decrypting an encrypted message
secret = png_parser.read("input.png", password="my_secure_password")
print(f"Decoded: {secret}")

# Reading a plain text message
plain = png_parser.read("input.png")
print(f"Decoded: {plain}")

3. Deleting the Secret

Remove the hidden chunks and restore the PNG to its original state.

import png_parser

status = png_parser.delete("my_image.png")
print(status)

🛠 Technical Details

The tool manipulates the PNG Chunk Layer. Every PNG starts with an 8-byte signature, followed by chunks like IHDR, IDAT, and IEND.

Security Protocol:

  1. Ancillary Chunk: We insert a non-critical chunk (stEg). Per PNG spec, viewers skip chunks they don't recognize.
  2. Security Flag: The first byte of the chunk payload is a flag:
  • 0x00: Plain-text UTF-8 data.
  • 0x01: AES-GCM Payload (16-byte Salt + 12-byte Nonce + Ciphertext).
  1. Key Derivation: We use PBKDF2-HMAC-SHA256 with 100,000 iterations to derive keys from passwords, providing strong resistance against brute-force attacks.

🏗 Development

To build this project from source:

  • Rust (Cargo)
  • Maturin (for Python: pip install maturin)
  • wasm-pack (for JS: npm install -g wasm-pack)

Build Python:

maturin develop

Build WASM:

wasm-pack build --target web

Pranjal Panging

GitHub

License

This project is licensed under the MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

png_parser-0.1.70-cp311-cp311-win_amd64.whl (117.7 kB view details)

Uploaded CPython 3.11Windows x86-64

File details

Details for the file png_parser-0.1.70-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for png_parser-0.1.70-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 557d6ff9f4739eae689b80e3d824f351014493001ae775bf8df7e03718c331ab
MD5 fe250736fed5dfc2093769138ae7e04b
BLAKE2b-256 d6bc0481a7edf6062708a0ca3bcc2dde272f91e182059c79ac018a5404b1fa9b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page