Skip to main content

A tool to inspect, strip metadata, and hide messages in PNG files.

Reason this release was yanked:

Early unstable release — use 0.3.0 instead

Project description

PNG Parser (WASM & Python)

License: MIT

A high-performance PNG steganography and parsing tool written in Rust. This project provides a unified core that is available for both JavaScript (WebAssembly) and Python.

📦 Available Packages

Platform Installation Documentation
JavaScript / WASM npm install @pranjalpanging/png-parser JS Guide
Python pip install png-parser Python Guide

✨ Features

  • Blazing Fast: Core logic implemented in Rust for maximum speed.
  • Stealthy: Uses custom PNG chunks (stEg) that are ignored by standard image viewers.
  • Cross-Platform: Run the same logic in a web browser, Node.js, or a Python script.
  • Safe: Includes functions to strip hidden data and restore original file integrity.

🚀 JavaScript Usage (Web/Node)

This package is compiled to WebAssembly. When using it in the browser, you must initialize the WASM module first.

import init, { hide_message, read_message } from "@pranjalpanging/png-parser";

async function run() {
    // Initialize the WASM engine
    await init();

    // Example: Reading a message from a Uint8Array (file buffer)
    const secret = read_message(imageBuffer);
    console.log("Hidden message:", secret);
}

run();

Note: For more detailed JS examples, check the pkg/README.md.

🐍 Python Usage

Installation Once the package is uploaded to PyPI, install it via pip:

pip install png-parser

1. Hiding a Message

Embed a secret string into any PNG file. This adds the data safely without corrupting the image.

import png_parser

# Appends a hidden 'stEg' chunk to the image
status = png_parser.hide("my_image.png", "hello world")
print(status) # Output: Success: Message hidden!

2. Reading a Message

Extract the hidden data from the image.

import png_parser

secret = png_parser.read("my_image.png")
print(f"Secret message: {secret}") # Output: Secret message: hello world

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) # Output: Success: Secret message deleted!

🛠 Technical Details

This tool manipulates the PNG Chunk Structure. Every PNG consists of a series of chunks. This library inserts an Ancillary Chunk (optional data) named stEg. Standard image viewers skip chunks they don't recognize. By placing our data before the IEND marker, the file remains a valid image while carrying your hidden payload.

🏗 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 Distribution

png_parser-0.1.67.tar.gz (30.0 kB view details)

Uploaded Source

Built Distribution

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

png_parser-0.1.67-cp311-cp311-win_amd64.whl (105.7 kB view details)

Uploaded CPython 3.11Windows x86-64

File details

Details for the file png_parser-0.1.67.tar.gz.

File metadata

  • Download URL: png_parser-0.1.67.tar.gz
  • Upload date:
  • Size: 30.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.10.2

File hashes

Hashes for png_parser-0.1.67.tar.gz
Algorithm Hash digest
SHA256 b18d2a6564a795e24ce4b461cd1b693c12682f18522ea2f53cee9f7a993d0a46
MD5 2aaae585287083eb699fb504e92a7364
BLAKE2b-256 5123b34e3861179964fc75c3da48c1ad11ed3be25a7a2e0dd7eac30f11213cb5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for png_parser-0.1.67-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 8719fc9075c61dc7a0cbebce4d8bae0abecfba380c905be77d36d64739f67c95
MD5 36aefc434a163b1d982933c2e612d75e
BLAKE2b-256 b9d43ee624eac77a76374eb023cb5a9d6600e50d718f24d75e7e00c3ed3efcdb

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