Skip to content

ethanlabs101/integrity-shield

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Banner

Python


Integrity Shield is a lightweight file integrity monitoring tool built in Python.

It scans directories, generates SHA-256 hashes for files/folders, and compares snapshots to detect changes such as modifications, new files, or missing files.

Designed as a simple but practical introduction to filesystem security concepts, hashing, and CLI tool design.


integrity-shield1


🔒 Why Use Integrity Shield/SHA-256?

  • Integrity Shield uses SHA-256 cryptographic hashing to verify file integrity.

  • SHA-256 produces a unique fingerprint for every file scanned.

  • Even a single byte change - whether from modification, corruption, or tampering - generates a completely different hash value.

  • This allows Integrity Shield to reliably detect:

    • Modified Files
    • Injected Content
    • Corruption
    • Missing Files
    • Newly added files

Due to the avalanche effect of cryptographic hashing, even the smallest file change results in a dramatically different output hash, making SHA-256 a trusted standard for integrity verification and cybersecurity tooling.


🚀 Features

  • 📁 Recursive folder scanning
  • 🔒 SHA-256 file hashing
  • 📷 Snapshot creation and storage
  • 🔍 Integrity verification against saved snapshots
  • ⚠️ Detection of:
    • Modified Files
    • New Files
    • Missing Files
  • 🖥️ Clean TUI
  • 🧹 Auto-clear interface for smooth interaction
  • 👤 User-safe storage using home directory config path

🧠 What I Learned Building This

This project was built to strengthen my understanding of:

  • Python file handling
  • Directory Transversal
  • Hashing Algorithms
  • CLI/TUI Structure and user flow design
  • Clean Architecture for small tools

⚙️ How It Works

  1. The tool scans a target directory recursively
  2. Each file is hashed using SHA-256
  3. A snapshot is saved locally
  4. Future scans compare current hashes against the saved snapshot to determine file(s) integrity
  5. Differences are reported as:
    • New File
    • Modified
    • Missing

📦 Installation

  1. Clone This Repo
git clone https://github.com/ethanlabs101/integrity-shield.git
  1. Run Script
cd integrity-shield
python3 main.py

Only Python and Git required to run. No extra external dependencies needed


▶️ Usage

  1. Run the tool:
python3 main.py
  1. Then Choose Menu Option:
[1] Save Snapshot
[2] Check Snapshot
[3] Exit

📸 Save Snapshot

  • Enter target folder path
  • Tool generates SHA-256 hashes
  • Snapshot stored locally

🔍 Check Snapshot

  • Enter the same folder path
  • Tool compares current state vs saved snapshot
  • Outputs any changes detected

📂 Snapshot Storage

Snapshots are stored locally in:

~/.integrity_shield_snapshot.json

This ensures:

  • No permission issues
  • Works across different systems/users
  • Keeps project directory clean

📚 Tech Stack

  • Python 3
  • hashlib (SHA-256)
  • os /pathlib
  • json
  • CLI-based UI (custom TUI)

⚠️ Notes

  • Designed for user-space directory scanning (Non-system/protected files).
  • Not intended as a full system-wide/large scale audit tool.
  • Uses a single snapshot database.
  • Saving a new snapshot overwrites the previous stored baseline (1 at a time).

📜 License

This project is open source and released under the MIT License. See LICENSE for details.


🌐 Contact

GitHub Email


About

A simple python tool that utilizes SHA256 hashing to detect changes for basic system integrity checking.

Topics

Resources

License

Stars

3 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages