This Flask-based web application allows users to check the integrity of any document. It uses the SHA-256 hashing algorithm to calculate a unique hash for each uploaded document. Later, it can compare the calculated hash of the document with the stored hash to check if the document has been modified.
- User Authentication
- File Upload
- Hash Generation
- Integrity Check
- Python
- Flask
- PostgreSQL
- SQLAlchemy
- hashlib
- HTML
- CSS
- JavaScript
Before you begin, ensure you have the following installed on your system:
- Python 3.7 or higher
- pip (Python package installer)
- PostgreSQL
-
Clone the repository:
git clone https://github.com/anirudhaptiwari/Document-Integrity-Checker.git
-
Navigate to the project directory:
cd Document-Integrity-Checker
-
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
- On Windows:
venv\Scripts\activate
- On macOS and Linux:
source venv/bin/activate
- On Windows:
-
Install the required dependencies:
pip install -r requirements.txt
-
Set up PostgreSQL:
- Install PostgreSQL if you haven't already
- Create a new database named 'Test':
CREATE DATABASE Test;
- Create a new user and grant privileges:
CREATE USER user WITH PASSWORD 'user'; GRANT ALL PRIVILEGES ON DATABASE Test TO user;
-
Update the database URI: Open
app.py
and update theSQLALCHEMY_DATABASE_URI
with your PostgreSQL credentials:app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://user:user@localhost/Test'
-
Run the application:
python app.py
-
Access the application: Open a web browser and navigate to
http://localhost:5000
-
Log in to the application: Use the default credentials:
- Username: admin
- Password: admin
-
Generate a hash:
- Click on "Generate Hash"
- Upload a file and provide a unique name
- The application will generate and store the hash
-
Check document integrity:
- Click on "Check Integrity"
- Upload a file and provide either the unique name or the hash value
- The application will compare the calculated hash with the stored hash
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
If you encounter any issues during setup or usage, please check the following:
- Ensure all dependencies are correctly installed
- Verify that PostgreSQL is running and the database is accessible
- Check that the database URI in
app.py
matches your PostgreSQL configuration
If problems persist, please open an issue on the GitHub repository.