Skip to content

R0mb0/Local_p7m_extractor

📦 Local p7m extractor 🔓

A privacy-first .p7m (PKCS#7) extractor built with vanilla JavaScript. It bypasses cryptographic checks to instantly extract the underlying files completely offline using Web Workers. No server uploads, no file size limits.

Codacy Badge pages-build-deployment Maintenance Open Source Love svg3 MIT Donate

00.png


🚀 Features

  • 100% Privacy-First: Everything happens locally in your browser. Sensitive legal documents, invoices, or contracts are never uploaded to a server.
  • Bypasses cryptographic checks completely: It doesn't care if the digital signature is expired, revoked, or malformed—it just grabs the hidden file.
  • Smart Format Detection: Automatically recognizes and accurately extracts standard PDFs (%PDF-), Electronic Invoices (<?xml), and PEC Receipts (.eml).
  • Universal ASN.1 Fallback: If the file is not a standard format (e.g., a Word Document or Excel sheet), the app parses the ASN.1 structure to extract the largest data block, recovering virtually any file type.
  • Batch Processing & ZIP Export: Drag and drop dozens of .p7m files at once. Extract them all simultaneously and download them in a single, neat .zip archive.
  • Modern UI/UX: Built with Tailwind CSS, featuring smooth animations, drag-and-drop support, and an adaptive Light/Dark mode.

🛠️ How it works

  1. Drag and drop your .p7m files into the designated dropzone.
  2. The app spins up a Web Worker to prevent the UI from freezing while processing large files.
  3. Instead of using heavy, error-prone cryptographic libraries, the worker reads the raw bytes (Uint8Array) of the file.
  4. It scans the binary data looking for "Magic Bytes" (specific hex sequences) to identify the start and end of known file formats (PDF, XML, EML).
  5. If the magic bytes are missing, it uses a lightweight ASN.1 parser to locate the largest OCTET STRING, effectively stripping away the digital certificate wrapper.
  6. The app generates local Blob objects and renders a clean results table for individual or bulk downloads.

🏆 What makes it special?

  • No Crypto-Library Dependencies: Most .p7m extractors rely on OpenSSL or Forge.js, which often fail and throw errors if the certificate is technically invalid. By doing a byte-level scan, this tool achieves a near 100% success rate.
  • Zero Server Bottlenecks: By running entirely client-side, there are no file size limits (like Vercel's 4.5MB limit) and zero hosting costs for file processing.

💡 Why use this tool?

  • Accountants & Lawyers: Effortlessly open digitally signed electronic invoices (FatturaPA) or legal acts without needing clunky smart-card software.
  • Public Administration Users: Quickly read digitally signed documents for public tenders, competitions, and PEC (Certified Email) receipts.
  • Everyday Users: Stop searching for suspicious "online p7m openers" that might steal your sensitive documents. Do it safely, instantly, and locally.

⚡ Getting Started

Online

Simply visit the Live Demo hosted on GitHub Pages.

Local Installation (Fully Offline)

Running this tool locally without the internet is extremely easy:

  1. Clone this repository or download the source code ZIP.
  2. Ensure the three core libraries are in the same folder as the HTML file (tailwindcss.js, jszip.min.js, lucide.min.js).
  3. Double-click index.html to open it in your favorite browser.
  4. Start extracting!

🙏 Credits & Inspiration

  • Tailwind CSS: For making the UI beautiful, responsive, and adaptive with minimal effort.
  • JSZip: For enabling seamless, client-side ZIP archive generation.
  • Lucide Icons: For the clean, modern, and lightweight icon set.
Not made by AI

About

A privacy-first .p7m (PKCS#7) extractor built with vanilla JavaScript. It bypasses cryptographic checks to instantly extract the underlying files completely offline using Web Workers. No server uploads, no file size limits.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors

Languages