This project implements a robust Message Authentication Code (MAC) generator and checker system. It consists of two primary classes: MACGenerator and MACChecker. The MACGenerator class is responsible for generating HMACs for packets in a Page, while the MACChecker class verifies the integrity of those packets. The system supports filling in missing packets and calculating message latencies.
The project is organized as follows:
-
ND_MAC/
- Book (submodule)
- src/
__pycache__/- tests/
__init__.pynDMAC_test.py
__init__.pynD_MAC.py
LICENSEREADME.mdExample.ipynb
-
Book/: Contains the
PacketandPageclasses. -
src/: Contains the main implementation (
nD_MAC.py) and the unit tests (tests/nDMAC_test.py). -
Example.ipynb: A Jupyter notebook demonstrating the usage of the
MACGeneratorandMACCheckerclasses.
-
Clone the repository:
git clone https://github.com/your-username/ND_MAC.gitcd ND_MAC -
Install dependencies:
Install the required Python packages using pip.
pip install -r requirements.txt(Create this file if it doesn't exist)
-
MAC Generation:
Use the
MACGeneratorclass to generate MACs for the packets in aPage. -
MAC Verification:
Use the
MACCheckerclass to verify the integrity of the packets and calculate message latencies.
You can find an example of how to use these classes in Example.ipynb.
To ensure everything is working correctly, you can run the provided unit tests.
-
Navigate to the
srcdirectory:cd src -
Run the tests:
python3 -m unittest discover -s src/testsAlternatively, you can run a specific test file:
python3 -m unittest src/tests.nDMAC_test
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request or open an issue if you find a bug or have a feature request.
For any questions or issues, please contact [mkashani.phd@gmail.com].