This project demonstrates how keystroke logging works in a controlled, ethical environment for cybersecurity learning and defensive research purposes.
The application captures user keystrokes in real time, tracks the active window title, formats input cleanly, and securely stores logs using symmetric encryption.
This project is designed strictly for educational use on systems you own or have explicit permission to test.
- Real-time keystroke capture
- Active window title tracking (Windows)
- Clean, readable log formatting
- Encrypted log storage using Fernet (AES-based symmetric encryption)
- Visible execution mode (no stealth functionality)
- ESC key termination control
- Python 3
- pynput (keyboard event listener)
- pywin32 (Windows API interaction)
- cryptography (Fernet encryption)
- The program listens for keyboard events using
pynput. - When the active window changes, the window title is logged with a timestamp.
- Keystrokes are formatted for readability.
- Before being written to disk, log data is encrypted using Fernet symmetric encryption.
- Pressing
ESCstops logging and saves encrypted data.
-
Clone the repository: git clone: https://github.com/BridgetIvy/PRODIGY_CS_04.git
-
Navigate into the folder: cd PRODIGY_CS_04
-
Install dependencies: pip install -r requirement.txt
-
Run the program: python keylogger.py
-
Press 'ESC' to terminate logging.
-
Encrypted loogs will be saved inside the 'logs/' directory.
PRODIGY_CS_04/ │ ├── keylogger.py ├── logs/ ├── requirements.txt ├── README.md └── .gitignore
This project is developed strictly for educational and defensive cybersecurity research purposes.
It must only be executed on systems you own or have explicit authorization to test.
Unauthorized use of keylogging software is illegal and unethical.
- Event-driven programming in Python
- Keyboard listener implementation
- Windows API interaction
- Secure log handling
- Symmetric encryption fundamentals
- Ethical awareness in cybersecurity development
Bridget Yisa aspiring cyberseurity Analyst