Author jdom1824@inaoe.mx
This script is designed to calculate hashes of files in a directory and verify their integrity, ensuring that files have not been tampered with. It also provides a summary of the process, including the total number of files processed and any encountered errors.
Recommend you have Python 3.11.7 installed on your system. You can download it from the official Python website: python.org.
Clone the repository and navigate to the project directory:
git clone https://github.com/jdom1824/checkHash.git
cd checkHash
- Install Dependencies: You can install the required dependencies using the following command:
pip install -r requirements.txt
- How to Use printerHash.py
This script calculates hashes of files in a directory and saves the results to a JSON file. Follow the steps below to use the script effectively:
Execute the printerHash.py script by running the following command:
python3 printerHash.py
-
Enter the Directory Path:
When prompted, enter the full path to the directory containing the files you want to calculate hashes for and press Enter.
-
Monitor Progress:
The script will start calculating hashes for the files in the specified directory. You'll see a progress bar indicating the status of each file's hash calculation.
-
View Results:
Once the script completes the hash calculation process, it will save the results to a JSON file named <directory_name>_hashes.json in the same directory.
- How to Use checkHash.py
This script is used to verify the integrity of files by comparing their hashes against those stored in a JSON file generated by printerHash.py
. Follow the steps below to use the script effectively:
Execute the Script script by running the following command:
Run the checkHash.py
script by executing the following command:
python3 checkHash.py
-
Provide Directory Path and Hash File: When prompted, enter the full path to the directory containing the files you want to verify and the path to the JSON file containing the stored hashes. Press Enter after providing each path.
-
Review Results: After processing, the script will display a summary of the verification process, indicating the total number of files processed, the number of files with matching hashes, and any errors encountered during verification.