Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛡️ PrivacyShield - AI Desktop Security

A sophisticated, biometric desktop security application built with a Hybrid Architecture (Python + React). Designed to prevent "shoulder surfing" in public spaces by using real-time computer vision to continuously verify the user's identity and obscure the screen when unauthorized faces are detected.


✨ Features

  • 👤 Biometric Recognition - Learns and identifies the user's face in real-time
  • 👀 Anti-Shoulder Surfing - Instantly locks the screen if a stranger is detected in the frame
  • 🏃 Auto-Away Lock - Automatically secures the computer when the user steps away
  • 🌫️ Native Acrylic Blur - Uses low-level Windows API to create a high-performance glass/blur effect
  • ⌨️ Input Blocking - Disables keyboard input while in "Intruder" or "Away" mode
  • 🖥️ Hybrid UI - Modern dashboard built with React, running inside a PyQt6 wrapper
  • Performance Optimized - Efficient frame processing to minimize CPU usage
  • 🔒 Privacy First - All processing happens locally on the device; no images are sent to the cloud

🛠️ Tech Stack

🧠 Core & AI

  • Python 3.10+ - Core logic
  • OpenCV - Image processing and camera handling
  • Face_Recognition - Dlib-based state-of-the-art face detection
  • MediaPipe - Optimized face detection models
  • NumPy - High-performance mathematical operations

🖥️ Desktop & OS Integration

  • PyQt6 - GUI wrapper and window management
  • Ctypes - Direct Windows API calls for Acrylic effects
  • Keyboard - System-level hooks for input blocking
  • PyInstaller - Executable packaging

🎨 Frontend (Dashboard)

  • React - Component-based UI
  • Vite - Next-generation frontend tooling
  • CSS Modules - Scoped styling for the dashboard

📸 Screenshots


📥 Download & Run (No Code Required) - Windows user Only

You can download the latest version from the Releases Page.

Note on Windows SmartScreen: Since this is an indie project and not signed with a corporate certificate, Windows might show a warning ("Windows protected your PC").

  1. Click "More info"
  2. Click "Run anyway"

The app is portable - just unzip and run PrivacyShield.exe.


⚙️ Installation & Development

Prerequisites

  • Python 3.9 or higher
  • Node.js (for building the GUI)
  • C++ Build Tools (required for Dlib/Face_Recognition)

Setup

  1. Clone the repository:
git clone [https://github.com/Matan1Ohayon/PrivacyShield.git](https://github.com/Matan1Ohayon/PrivacyShield.git)
cd PrivacyShield
  1. Setup Python Environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt
  1. Build the React Frontend:
cd gui
npm install
npm run build
cd ..
  1. Run the Application:
python main.py

Build for Production (.exe)

To create a standalone executable (Folder mode recommended for speed):

pyinstaller --noconfirm --onedir --windowed --icon "shield.ico" --add-data "gui/dist;gui/dist" --add-data "shield.ico;." --collect-all face_recognition_models --name "PrivacyShield" main.py

🚀 Architecture Explained

This project demonstrates a unique Hybrid Desktop Architecture:

  • The "Brain" (Python): Handles the heavy lifting—accessing the webcam, running AI models, controlling Windows APIs (blur/keyboard hooks), and managing the system tray.
  • The "Face" (React): Runs inside a QWebEngineView (a Chromium-based browser widget within Qt). It provides a modern, responsive HTML/CSS interface that desktop frameworks like Tkinter or Qt cannot easily match.
  • The Bridge: A two-way communication channel allows Python to send status updates ("SAFE", "DANGER") to the React UI, and allows React to send commands ("START", "STOP") back to Python.

📂 App Structure

PrivacyShield/
├── gui/                  # React Frontend
│   ├── src/              # React source code
│   ├── public/           # Static assets
│   └── dist/             # Compiled HTML/JS (generated)
├── main.py               # Application Entry Point & Logic
├── requirements.txt      # Python dependencies
├── shield.ico            # App Icon
└── README.md             # Documentation

🎯 Key Capabilities

Real-Time Intruder Detection

Using face_recognition, the system compares current faces in the frame against the authorized user's encoding. If the distance metric exceeds the tolerance threshold, the system triggers a "DANGER" state.

Native Windows Integration

Unlike standard overlays, PrivacyShield interacts with user32.dll to apply the undocumented SetWindowCompositionAttribute, achieving the native Windows 11 "Acrylic" blur effect that sits on top of all other windows.


📝 License

This project is private. All Rights Reserved | Matan Ohayon © 2025


📬 Contact

About

AI-powered anti-shoulder surfing tool for Windows. Automatically locks and blurs the screen when unauthorized faces are detected. Built with Python & React.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages