This is a simple Python program that allows the simulation of various data corruption techniques and checks file integrity using the SHA-256 hash algorithm.
Features:
- Flip random bits of a file
- Modify specific bytes of a file
- Introduce noise into a file
- Swap contents of two files
Usage
- Run the 'File Authentication.py' program and choose a desired option from the menu.
- Follow the prompts to provide the necessary inputs, such as file name, positions to modify, or noise intensity.
- The program will perform the selected data corruption technique on the file and calculate the SHA-256 hash before and after the modification.
- It will then compare the hashes to determine if the file integrity is maintained or compromised.
- For the "Swap contents of a file" option, it demonstrates that SHA-256 does not detect file swapping.
- You may repeat the process for different files or corruption techniques as needed.
- Choose the "Exit the system" option when you are finished.
Requirements
- Python version 3
- 'hashlib' module
Note
This program is for educational purposes only and serves as a playground to explore data corruption techniques and understand the concept of file integrity. It is not intended for real-world file manipulation or security applications.
Sample files have been added for the same purpose.
Disclaimer
I am not liable for any loss or damage resulting from the use of this code. Use it at your own risk.