Skip to content

foxhackerzdevs/pinlock-img

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

🖼️ pinlock-img v9

Authenticated PNG Image Vault

Secure • Deterministic • Authenticated Image Protection


📌 Overview

pinlock-img is a password-based image protection tool for PNG files.

It ensures:

  • No silent corruption
  • Safe failure on wrong password
  • Tamper detection via authentication

🔐 Core Design

🔑 Key Derivation

  • PBKDF2-HMAC-SHA256
  • 200,000 iterations
  • Salt: pinlock-img-v9

🧠 Dual-Key Architecture

  • XOR Seed (16 bytes) → deterministic noise stream
  • Authentication Key (16 bytes) → HMAC-SHA256

🛡️ Authenticated Encryption

Encrypt-then-MAC design:

  • Encrypt data
  • Generate HMAC
  • Store tag in PNG metadata (pinlock_auth)

Decryption only proceeds after successful verification.


⚙️ How It Works

Encryption

  1. XOR transform applied
  2. HMAC generated
  3. Tag embedded in PNG
  4. .lock suffix added

Decryption

  1. Extract HMAC
  2. Verify integrity
  3. If valid → decrypt
  4. If invalid → abort safely

🚀 Features

  • 🔐 Password-based protection
  • 🛡️ HMAC-SHA256 authentication
  • 📂 Batch processing
  • 🧪 Dry-run mode
  • 💾 Atomic file writes

📦 Installation

Requires Python 3.8+

pip install numpy Pillow

📖 Usage

python pinlock-img.py /path/to/file_or_directory

Dry Run

python pinlock-img.py /path/to/files

Then:

Dry Run? (y/n): y

⚠️ Security Notes

  • Strong authentication (HMAC-SHA256)
  • PBKDF2 protects against brute-force

However:

  • Uses deterministic XOR transformation
  • Not equivalent to AES-GCM or modern AEAD

📜 License

MIT License © 2026 Fox Hackerz


🦊 About Fox Hackerz

We build tools focused on:

  • Cybersecurity
  • Automation
  • Developer tools

📌 GitHub: https://github.com/foxhackerzdevs


🦊 Join the pack. Build. Break. Secure.