Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.

Latest commit

 

History

History
78 lines (57 loc) · 1.6 KB

File metadata and controls

78 lines (57 loc) · 1.6 KB

🔍 IoTIVP-Verify v1.5

Integrity Scoring Engine (0–100)

IoTIVP-Verify evaluates IoTIVP-Core packets to determine:

  • 🔒 Valid / Invalid
  • 📊 Integrity Score (0–100)
  • 🚩 Flags (hash mismatch, replay, anomalies, etc.)
  • 🔎 Behavior-level insights

📈 Integrity Score Formula v2.0

Dimension Weight
Hash Validity 0.40
Timestamp Freshness 0.20
Nonce Behavior 0.15
Value Anomalies 0.15
Device Behavior 0.10

If hash fails → score = 0 immediately.


🔧 Python Example

from iotivp_verify import verify_packet, VerifyConfig

cfg = VerifyConfig(max_age_seconds=60)

result = verify_packet(
    packet_json,
    secret=b"demo-secret",
    cfg=cfg
)

print(result)

📤 Output Example

{
  "valid": true,
  "integrity_score": 94,
  "flags": {
    "hash_mismatch": false,
    "timestamp_expired": false,
    "nonce_reuse": false,
    "value_out_of_range": []
  }
}

🧩 What Verify Checks

  • ✔ Hash correctness
  • ✔ Timestamp expiration
  • ✔ Nonce replay detection
  • ✔ Field anomaly detection
  • ✔ Device behavior deviation

IoTIVP-Verify converts raw sensor data into trusted intelligence.