Skip to content
Intensive-Desire08Public

About

<Placeholder>

Resources

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

KAIROS

Quantum-Inspired Cryptographic Gateway & Security Operations Platform

Secure. Adaptive. Observable.

KAIROS combines entropy collection, cryptographic session management, ML-based threat detection, dynamic threat response, and real-time security monitoring into a unified security platform.

Status Frontend Backend ML DTRE


Overview

KAIROS is a modular security platform designed around a cryptographic gateway architecture.

The system combines:

  • Hardware-assisted entropy collection
  • Cryptographic session management
  • Secure key generation and distribution
  • ML-based anomaly and threat detection
  • Dynamic Threat Response Engine (DTRE)
  • Real-time security telemetry
  • SOC-style security visualization
  • Network topology monitoring
  • Administrative security controls

The architecture separates detection, decision-making, cryptographic operations, and visualization, allowing each subsystem to be developed, tested, and extended independently.


Architecture

                              KAIROS
                                 β”‚
             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
             β”‚                                       β”‚
             β–Ό                                       β–Ό
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚   Security SOC      β”‚                β”‚  Entropy / Hardware β”‚
   β”‚      Dashboard      β”‚                β”‚       Layer         β”‚
   β”‚                     β”‚                β”‚                     β”‚
   β”‚ React + TypeScript  β”‚                β”‚ ESP32 / QRNG        β”‚
   β”‚ Vite + Tailwind     β”‚                β”‚ C++ Entropy Pool    β”‚
   β”‚ Recharts + xterm    β”‚                β”‚ OpenSSL Fallback    β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              β”‚                                      β”‚
              β”‚ REST / WebSocket                     β”‚
              β”‚                                      β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚
                                 β–Ό
                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                     β”‚     KAIROS GATEWAY      β”‚
                     β”‚                         β”‚
                     β”‚ Session Management      β”‚
                     β”‚ Cryptographic Engine    β”‚
                     β”‚ Device Registry         β”‚
                     β”‚ Key Distribution        β”‚
                     β”‚ Policy Integration       β”‚
                     β”‚ Logging                 β”‚
                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                  β”‚
                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                     β”‚                         β”‚
                     β–Ό                         β–Ό
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚   ML Threat Engine  β”‚   β”‚ Dynamic Threat      β”‚
          β”‚                     β”‚   β”‚ Response Engine     β”‚
          β”‚ Python              β”‚   β”‚                     β”‚
          β”‚ FastAPI             β”‚   β”‚ Node.js             β”‚
          β”‚ Isolation Forest    β”‚   β”‚ Policy Engine       β”‚
          β”‚ Threat Scoring      β”‚   β”‚ Security Actions    β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Core Modules

01 β€” Entropy & QRNG Layer

The entropy subsystem provides randomness for cryptographic operations.

Components

  • Hardware entropy collection
  • ESP32-based entropy source
  • Serial/USB entropy interface
  • C++ entropy pool
  • OpenSSL entropy fallback
  • Entropy analysis tools
  • Statistical randomness testing

The system is designed to maintain entropy availability even when the external hardware source is unavailable.


02 β€” KAIROS Cryptographic Gateway

The Gateway forms the central security boundary of the platform.

Responsibilities

  • Session management
  • Device registration
  • Key distribution
  • Cryptographic operations
  • Entropy management
  • WebSocket communication
  • REST APIs
  • ML integration
  • Policy integration
  • Security logging

Cryptographic Components

The project includes support for:

  • RSA-OAEP key exchange
  • AES-256-GCM encryption
  • Secure session keys
  • Nonce generation
  • Hashing
  • Key generation

The Gateway acts as the controlled interface between external clients and internal security services.


03 β€” ML Threat Detection & Dynamic Threat Response

KAIROS separates threat detection from security response.

ML Threat Detection

The Python service analyzes connection and session features and produces a threat assessment.

Current implementation uses:

Isolation Forest

The service produces:

Threat Score
Security Level
Attack Label

Supported attack labels include:

DOS
BRUTE_FORCE
PORT_SCAN

Technology

  • Python
  • FastAPI
  • scikit-learn
  • NumPy
  • pandas
  • joblib
  • Pydantic

04 β€” Dynamic Threat Response Engine

The Node.js DTRE consumes threat assessments and applies configurable security policies.

Response Actions

Depending on the policy and threat level, actions can include:

rotateSessionKey
blockIP
rateLimitClient
forceReAuthentication
alertAdmin

Additional policy functionality includes:

  • Threat thresholds
  • Attack-specific rules
  • Confidence gates
  • IP blocklists
  • Rate limiting
  • Automatic expiry
  • Dependency-injected actions

Design Principle

ML Service
    β”‚
    β”‚ Threat Assessment
    β–Ό
DTRE Policy Engine
    β”‚
    β”‚ Decision
    β–Ό
Security Action

The ML service identifies suspicious behavior.

The DTRE decides what should happen.

This separation keeps detection and response logic independently configurable.


05 β€” KAIROS Security Operations Center

The KAIROS frontend provides a real-time SOC-style monitoring interface.

Frontend Stack

Technology Purpose
React UI framework
TypeScript Type safety
Vite Frontend tooling
Tailwind CSS UI styling
Zustand State management
Recharts Security telemetry visualization
Framer Motion Controlled UI animation
xterm.js Administrative terminal
WebSocket Real-time events
Axios Gateway API communication

Dashboard Capabilities

The dashboard provides visibility into:

  • Live threat telemetry
  • Threat score trends
  • Security levels
  • Security events
  • Active sessions
  • Device health
  • Security actions
  • Network topology
  • Gateway status
  • Administrative operations

Security Boundary

The frontend communicates with the Gateway, not directly with the ML service.

                    FRONTEND
                       β”‚
                       β”‚
                REST / WebSocket
                       β”‚
                       β–Ό
                KAIROS GATEWAY
                       β”‚
            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
            β”‚                     β”‚
            β–Ό                     β–Ό
       ML SERVICE              DTRE

This prevents internal ML infrastructure from becoming a direct client-facing interface.


Frontend Features

Threat Monitoring

Real-time visualization of:

  • Threat scores
  • Security levels
  • Attack classifications
  • Threat events
  • Historical trends

Session Matrix

Provides operational visibility into active sessions while exposing only safe session metadata.

Device Health

Displays connected devices and their operational state.

Security Action Queue

Shows actions generated by the Dynamic Threat Response Engine.

Network Topology

Visualizes relationships between security components and connected devices.

Administrative Terminal

Provides a terminal-style interface for supported administrative operations.

Offline Development Mode

When the Gateway is unavailable, the frontend can use a controlled mock-data layer for development and UI testing.

The mock layer does not replace the real Gateway integration.


Repository Structure

KAIROS/
β”‚
β”œβ”€β”€ analyzer/
β”‚   β”œβ”€β”€ entropy_analyzer.py
β”‚   β”œβ”€β”€ nist_tests.py
β”‚   └── test_results_schema.json
β”‚
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ include/
β”‚   └── src/
β”‚       β”œβ”€β”€ Crypto/
β”‚       β”œβ”€β”€ entropy/
β”‚       └── utilities/
β”‚
β”œβ”€β”€ config/
β”‚   β”œβ”€β”€ backend_config.json
β”‚   └── logging_config.json
β”‚
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ CONTEXT.md
β”‚   └── report_text.txt
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ store/
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ vite.config.ts
β”‚   └── index.html
β”‚
β”œβ”€β”€ hardware/
β”‚   └── PQHardware.ino
β”‚
β”œβ”€β”€ nodejs/
β”‚   β”œβ”€β”€ config/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   └── policy/
β”‚   └── tests/
β”‚
β”œβ”€β”€ python/
β”‚   β”œβ”€β”€ ml_service/
β”‚   β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ training/
β”‚   β”œβ”€β”€ tests/
β”‚   └── main.py
β”‚
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ build.sh
β”‚   β”œβ”€β”€ run.bat
β”‚   └── run.sh
β”‚
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ example.spec.ts
β”‚   └── site-audit.spec.ts
β”‚
β”œβ”€β”€ CMakeLists.txt
β”œβ”€β”€ CMakePresets.json
β”œβ”€β”€ package.json
β”œβ”€β”€ playwright.config.ts
β”œβ”€β”€ tsconfig.json
└── vcpkg.json

Getting Started

Prerequisites

Install:

  • Git
  • Node.js
  • npm
  • Python 3.x
  • CMake
  • A C++ compiler
  • vcpkg
  • OpenSSL

Hardware functionality additionally requires the supported entropy hardware.


Frontend

Navigate to the frontend:

cd frontend

Install dependencies:

npm install

Start the development server:

npm run dev

Build for production:

npm run build

The frontend currently builds successfully using the Vite production build.


ML Service

Navigate to the Python service:

cd python

Install dependencies:

pip install -r requirements.txt

Train the model:

python training/train.py

Start the service:

python main.py

The ML service exposes threat-analysis functionality through the Gateway architecture.


Dynamic Threat Response Engine

Navigate to the Node.js engine:

cd nodejs

Install dependencies:

npm install

Run tests:

npm test

C++ Backend

Configure the C++ project using the appropriate CMake preset:

cmake --preset <preset>

Build:

cmake --build --preset <preset>

On Windows, the repository also provides:

scripts/run.bat

The script launches the compiled backend executable using the configured backend configuration.


Testing

KAIROS contains tests across multiple layers.

Python

cd python
pytest

Node.js

cd nodejs
npm test

Frontend

cd frontend
npm run build

End-to-End

From the project root:

npx playwright test

Configuration

Configuration is separated from application code.

config/
nodejs/config/

Configuration includes:

  • Backend settings
  • Logging settings
  • DTRE thresholds
  • Security policies
  • Action parameters

Local secrets and environment-specific credentials should never be committed to the repository.


Security Principles

KAIROS follows a security-first architecture.

Gateway Boundary

The frontend communicates through the Gateway rather than directly accessing internal services.

Detection / Response Separation

ML determines whether activity appears anomalous.

DTRE determines how the system responds.

Sensitive Data Protection

The dashboard must never expose:

Private Keys
Session Keys
Passwords
JWT Secrets
Raw Entropy
Credentials
Sensitive Decrypted Payloads

Only appropriate operational telemetry should be exposed.

Fail-Safe Operation

Security components are designed to maintain safe behavior when dependent services become unavailable.

Modular Architecture

Each subsystem can be developed and tested independently while maintaining defined interfaces between components.


Threat Processing Flow

Client / Device
      β”‚
      β–Ό
KAIROS Gateway
      β”‚
      β”œβ”€β”€ Session Metadata
      β”‚
      β–Ό
ML Threat Detection
      β”‚
      β”‚ threat_score
      β”‚ security_level
      β”‚ attack_label
      β–Ό
DTRE Policy Engine
      β”‚
      β–Ό
Security Decision
      β”‚
      β”œβ”€β”€ Rotate Session Key
      β”œβ”€β”€ Rate Limit Client
      β”œβ”€β”€ Block IP
      β”œβ”€β”€ Force Re-authentication
      └── Alert Administrator
      β”‚
      β–Ό
SOC Dashboard

Threat Levels

Threat assessments use a normalized score:

0.0 ─────────────────────────────── 1.0
 β”‚                                    β”‚
Low                                  High
Threat                               Threat

The dashboard visualizes the resulting security state and associated events in real time.


Development Philosophy

KAIROS is designed around several principles:

Security by design
Security controls are integrated into the architecture rather than added as an afterthought.

Clear service boundaries
Each subsystem has a defined responsibility and communication boundary.

Observable security
Security events and decisions should be visible through operational telemetry.

Modular engineering
Components should remain independently testable and replaceable.

Fail-safe behavior
Service failures should not silently disable security controls.

Minimal exposure
Sensitive cryptographic material and internal service details should remain outside the presentation layer.


Current Status

Implemented

  • Entropy collection infrastructure
  • C++ entropy pool
  • OpenSSL entropy fallback
  • Cryptographic utilities
  • Python ML threat detection service
  • Isolation Forest anomaly detection
  • Threat scoring
  • Attack classification
  • Node.js Dynamic Threat Response Engine
  • Threat policies and thresholds
  • IP blocklist
  • Rate limiting
  • Security response actions
  • React + TypeScript SOC dashboard
  • Gateway API abstraction
  • Mock telemetry fallback
  • Production frontend build
  • Automated testing infrastructure

In Development

  • Complete Gateway REST API integration
  • Complete Gateway WebSocket event integration
  • Full live telemetry pipeline
  • Production authentication flow
  • Expanded administrative controls
  • Additional threat models
  • Hardware-to-Gateway integration refinement

Roadmap

[βœ“] Entropy subsystem
        β”‚
        β–Ό
[βœ“] Cryptographic Gateway components
        β”‚
        β–Ό
[βœ“] ML Threat Detection
        β”‚
        β–Ό
[βœ“] Dynamic Threat Response Engine
        β”‚
        β–Ό
[βœ“] SOC Dashboard foundation
        β”‚
        β–Ό
[ ] Full Gateway integration
        β”‚
        β–Ό
[ ] Real-time production telemetry
        β”‚
        β–Ό
[ ] Expanded threat intelligence
        β”‚
        β–Ό
[ ] Production deployment

Technology Stack

Layer Technologies
SOC Frontend React, TypeScript, Vite, Tailwind CSS
State Zustand
Visualization Recharts, Three.js
Animation Framer Motion
Terminal xterm.js
Gateway / Core C++, CMake, OpenSSL
Entropy ESP32, QRNG, Serial/USB
ML Python, FastAPI, scikit-learn
ML Model Isolation Forest
DTRE Node.js
Testing pytest, Jest, Playwright
Configuration JSON
Build CMake, npm, vcpkg

Project Philosophy

KAIROS is built around a simple principle:

Detect threats. Decide intelligently. Respond dynamically. Observe everything that matters.

The goal is not simply to encrypt traffic or detect anomalies independently, but to connect entropy, cryptography, intelligence, response, and observability into one coherent security architecture.


KAIROS
Quantum-Inspired Cryptographic Gateway & Security Operations Platform

Built for secure systems research, engineering, and experimentation.

About

<Placeholder>

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages