https://github.com/cr2007/f20cn-cw2
Group Coursework which concepts in asymmetric cryptography, and firewall rules maintenance
https://github.com/cr2007/f20cn-cw2
Last synced: 4 months ago
JSON representation
Group Coursework which concepts in asymmetric cryptography, and firewall rules maintenance
- Host: GitHub
- URL: https://github.com/cr2007/f20cn-cw2
- Owner: cr2007
- Created: 2023-11-01T15:45:40.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-17T09:54:06.000Z (over 1 year ago)
- Last Synced: 2025-07-30T08:47:49.557Z (11 months ago)
- Language: Python
- Homepage:
- Size: 143 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# F20CN CW2
[](https://codespaces.new/cr2007/F20CN-CW2)
## [Computer Network Security (F20CN)](https://curriculum.hw.ac.uk/coursedetails/F20CN?termcode=202425&programmeCode=F291-COS)
### Asymmetric Cryptography, Firewall Rules Maintenance
Team Members:
- Chandrashekhar Ramaprasad (cr2007)
- Oluwadolabomi Faith Muraino (fm2020)
---
1. **Task 1 - Alternative Method of Public-Key Encryption**
Develops an asymmetric cryptography system with custom methods for generating public and private keys, encryption, and decryption of messages.
2. **Task 2 - Firewall Rules Application**
Implements tools to validate and process IP addresses and ranges, ensuring compliance with firewall rules and configurations.
---
## Requirements
- Python 3.8+
- Dependencies
- [`ipaddress`](https://docs.python.org/3/library/ipaddress.html) (Standard library module for IP validation)
- (Optional) [`pytest`](https://docs.pytest.org/en/stable) for running Task 1 tests
---
## Setup Instructions
### Clone the Repository
```bash
git clone https://github.com/cr2007/F20CN-CW2
cd F20CN-CW2
```
### Run the Scripts
#### Task 1: Public-Key Encryption
```bash
python task1-g14.py
```
This script includes:
- Key generation (private and public keys)
- Encryption and decryption functionalities
#### Task 2: Firewall Rules Maintenance
```bash
# Add new rule to the list of firewall rules
python task2-g14.py add [rule] [-in | -out] addr
# Remove existing rule from the list of firewall rules
python task2-g14.py remove [rule] [-in | -out]
# Lists existing firewall rules
python task2-g14.py list [rule] [-in | -out] [affr]
```
This script includes:
- Validating IP addresses
- Checking if an IP falls within a given range
- JSON-based input for easy testing of rules
---
## Project Contributors
This project was completed as part of the [F20CN: Computer Network Security](https://curriculum.hw.ac.uk/coursedetails/F20CN?termcode=202425&programmeCode=F291-COS) module at Heriot-Watt University.
Contributions were made by [@cr2007](https://github.com/cr2007) and [@faithm2020](https://github.com/faithm2020).