# NIDS — Detection of Malicious Activities in Cloud Systems via Analysis of Encrypted Traffic Flows
Graduation project — HIAST (Higher Institute for Applied Sciences and Technology)
Networks and Operating Systems Department
## Overview
An unsupervised anomaly detection system for encrypted TLS/HTTPS traffic that identifies malicious activity without decrypting packets — relying solely on observable flow metadata (packet size, direction, and inter-arrival time).
The core motivation: labeled malicious samples are scarce for supervised learning, and traditional Deep Packet Inspection conflicts with encryption's privacy purpose.
## Approach
-**Model:** Stacked LSTM AutoEncoder, trained exclusively on normal traffic (CESNET-TLS22 dataset)
-**Detection:** Reconstruction error thresholding — flows with error above a fixed threshold are flagged as malicious
-**Sequence length:** L=8 packets, chosen via a systematic sequence-length sweep, balancing early detection with reliability
-**Fine-tuning:** Further adapted on CTU-Normal-20 (external traffic source) to reduce the false positive rate from 48.9% to 12.1%
## Final Model Performance
| Metric | Value |
|--- |--- |
| ROC-AUC (TrickBot) | 0.994 |
| Recall | ≈99.7% |
| False Positive Rate (CTU-Normal-20, post fine-tuning) | 12.1% |
| Detection threshold | 0.0155 |
## Repository Structure
graduation-project/
├── models/ # Training notebooks and architecture-comparison experiments
│ ├── data_preprocessing.ipynb # Preprocessing of CESNET-TLS22 and TrickBot data