21EC63 · Computer Networks & Protocols · RV College of Engineering

Secure every packet.
Trust no device.

IoTBlockSec is a lightweight, software-only blockchain framework that secures zero-trust IoT ecosystems end-to-end — a custom SHA-256 Proof-of-Work ledger, HMAC-SHA256 device authentication and encrypted, replay-proof channels, with 100% detection across five live cyberattack simulations.

0%
Attack Detection
0
Attack Vectors Blocked
0
REST API Endpoints
0
False Negatives
SHA-256 Proof-of-WorkHMAC-SHA256 Device Auth UUID Nonce Replay ShieldFastAPI Gateway Zero-Trust ArchitectureSmart Contract Registry Solidity · Remix + GanacheChart.js Live SOC Python 3.10 · Zero Blockchain Deps
The Problem

30 billion devices.
An unprotected attack surface.

By 2030, over 30 billion IoT devices will stream telemetry that drives industrial, medical and logistical decisions — yet most IoT protocols transmit sensor data in plaintext, with weak or no device authentication and no way to detect modification mid-transit.

🎭
THREAT

Identity Spoofing

Attackers extract legitimate device IDs from observed traffic and impersonate trusted nodes with forged credentials.

✂️
THREAT

Data Tampering

Intercepted telemetry is altered in transit — a 99× value spike can falsify environmental state and trigger wrong decisions.

🔁
THREAT

Replay Attacks

Stale but perfectly valid packets are retransmitted to deceive backends into acting on outdated readings.

🕵️
THREAT

MitM Interception

On-path adversaries eavesdrop and mutate ciphertext bit-by-bit — invisible without envelope integrity signatures.

Objectives

Four goals. One verifiable pipeline.

01

Design

A lightweight blockchain-based framework securing IoT communication end-to-end — no heavy external blockchain infrastructure.

02

Implement

A SHA-256 Proof-of-Work blockchain ledger providing tamper-evident, hash-chained data storage with continuous validation.

03

Integrate

HMAC-SHA256 device authentication and per-device payload encryption for confidentiality and identity verification.

04

Validate

The framework against live simulated cyberattacks — spoofing, tampering, replay, unauthorized access and MitM.

System Architecture

A five-layer, zero-trust pipeline

Every reading flows from simulated perception hardware through cryptographic fortification, PoW consensus and smart-contract access control, up to a live SOC monitoring plane.

LAYER APerception
Five virtual sensors — sinusoidal baselines + Gaussian noise V(t)=V₀+A·sin(0.1t)+𝒩(0,σ) 🌡 temp💧 humidity📊 pressure🏃 motion🌫 CO₂
LAYER BSecure Channel
Triple cryptographic fortification per packet 256-bit key XOR cipher HMAC-SHA256 envelopeUUID nonce · 30s window
LAYER CBlockchain Core
SHA-256 PoW consensus, difficulty D=3 H = SHA-256(I‖T‖Txns‖H₋₁‖n) H[0:3] = 000continuous validation
LAYER DDevice Registry
Virtual smart contract — whitelist access control Token = HMAC(Secret, DeviceID) constant-time comparerevocation support
LAYER EGateway + SOC
FastAPI REST gateway & live dark-theme SOC dashboard 20+ endpoints 5s live pollingChart.js telemetrybreach alerting
IoTBlockSec system architecture and operational algorithm flowchart
Fig. 1 — IoTBlockSec layered architecture and operational algorithm: perception → gateway → consensus → SOC, with breach-abort paths.
Interactive Demo

Watch the cryptographic pipeline
run in your browser

This is the exact worked example from the paper — a temperature reading is encoded, hashed with real SHA-256 (WebCrypto), "mined", then verified. Flip the tamper switch to see why a one-degree forgery is computationally infeasible to hide.

🔬 Worked Example — Temperature Sensor

Reading (°C) Attacker tampers in transit
1Form payload
2Base64 cipher
3SHA-256 proof
4Broadcast + mine
5Verify: recompute
✔ VERIFIED — recomputed hash matches on-chain proof. Telemetry accepted.
Cyberattack Simulation Lab

Five attack classes. Zero got through.

An isolated AttackSimulator launches real attack logic against the running pipeline. Every vector is detected, logged and blocked — live, in the SOC dashboard.

🎭

Device Spoofing

Forged token for a real device ID hits the registry — constant-time HMAC comparison rejects it before it touches the queue.

HMAC-SHA256 token mismatch
100%
✂️

Data Tampering

A 99× value spike is injected into a legitimate transaction — the recomputed SHA-256 integrity hash no longer matches.

SHA-256 payload hash mismatch
100%
🔁

Protocol Replay

An exact copy of an authorized packet is retransmitted — its UUID nonce is already indexed in the 30-second sliding window.

Sliding-window nonce rejection
100%
🚫

Unauthorized Access

A rogue node attempts a direct ledger write — the whitelist lookup fails before any cryptographic work executes.

Device registry whitelist check
100%
🕵️

Man-in-the-Middle

4 bytes of ciphertext are bit-flipped on-path — the envelope's HMAC signature invalidates instantly; packet dropped pre-decryption.

Envelope signature integrity drop
100%

Launch them yourself →

The SOC dashboard's Attack Lab lets you fire each vector — or the full five-attack barrage — against the live system and watch detection happen in milliseconds.

⚔ Open Attack Lab
Experimental Results

Measured. Mined. Verified.

Evaluated over extended operational polling runs — every block satisfies the PoW difficulty target, every payload round-trips the encrypt/decrypt path, and every attack is caught.

0%
Mitigation success rate
0
Payloads encrypted + decrypted
0
Blocks mined @ difficulty 3
0
Tamper / replay under normal ops

Table I — Blockchain ledger metrics

BlockNonceTxnsDifficultyHash prefix
Genesis000000004ef48…
#177105000000fbdaf…
#213591000000ce1be…
#32321000000b4267…
#414121000000efa5a…
#542231000000964d1…

Table II — Live device telemetry profiles

DeviceModalityLocationValue
TEMP-879AE4TemperatureFactory Floor A22.82 °C
HUMI-0E2541HumidityServer Room B58.21 %
PRES-E23C37PressureWarehouse C1014.03 hPa
MOTI-5E6FF2MotionOffice Wing D0 (none)
CO2-2C7F9BCO₂Lab Section E433.77 ppm

Table III — Cyberattack mitigation matrix

Attack modalityDetection mechanismRate
Device SpoofingHMAC-SHA256 token mismatch100%
Data TamperingSHA-256 payload hash mismatch100%
Protocol ReplaySliding-window nonce rejection100%
Unauthorized AccessDevice registry whitelist check100%
Man-in-the-MiddleEnvelope signature integrity drop100%
Implementation Gallery

From Solidity contract to live SOC

The smart-contract layer was formally validated with IoTSecure.sol on Remix IDE + Ganache (gas-profiled per transaction), while the production pipeline runs the zero-dependency Python backend.

SOC dashboard overview
SOC OverviewLive KPIs, hash-linked chain strip, telemetry stream and chain-integrity status.
Cryptographic audit pipeline
Cryptographic Audit PipelineRaw reading → on-chain cipher → decrypted proof → transaction hash, per row.
Ganache local blockchain
Ganache Local EVMAutomined blocks at RPC 127.0.0.1:7545 — gas 52,789 to 684,727 per transaction.
Remix IDE IoTSecure.sol
Remix IDE — IoTSecure.solregisterDevice() · uploadData() · getLogCount(), deployed via Ganache provider.

See the whole system running live

Register devices, mine blocks, stream encrypted telemetry, tamper with the ledger and launch all five attacks — then watch the framework catch every single one.

⚡ Launch the SOC Dashboard
Team

Built at RV College of Engineering

VI Semester PBL · 21EC63 Computer Networks & Protocols · Department of Electronics & Communication Engineering, Bengaluru

PK

Prathik P Kekare

Author · UG Student, ECE
1RV23EC195 · prathikpkekare.ec23@rvce.edu.in
KR

Dr. K B Ramesh

Project Guide · Associate Professor, ECE
rameshkb@rvce.edu.in
References

Standing on cryptographic shoulders