πŸ›‘οΈ wFabricSecurity

Zero Trust Security System for Hyperledger Fabric.
Cryptographic identity verification, code integrity validation, and secure communication.

πŸ“š Official Documentation:
https://wFabricSecurity.readthedocs.io/en/latest/
Python 3.10+ MIT License Documentation Status Build Status Coverage

πŸ“š Complete Documentation Available

For comprehensive tutorials, API reference, architecture diagrams, and FAQ,
visit the official documentation:

https://wFabricSecurity.readthedocs.io/en/latest/

πŸ“– Open Official Documentation β†’



Overview

wFabricSecurity implements a comprehensive Zero Trust security model where no participant is automatically trusted. Every transaction must be cryptographically verified before processing.

In a Zero Trust architecture:

  • Never Trust, Always Verify - Every request is authenticated and authorized

  • Least Privilege Access - Users get minimum necessary permissions

  • Assume Breach - Continuous validation and monitoring


Key Features

Feature

Description

Zero Trust Model

Every participant and transaction must be verified before processing

Code Integrity

SHA-256 hash verification of source code to detect tampering

ECDSA Signatures

Elliptic curve cryptography (secp256k1) for message signing and verification

Communication Permissions

Fine-grained access control with bidirectional, outbound, and inbound options

Message Integrity

Hash verification to detect transmission alterations

Rate Limiting

Token bucket algorithm for DoS protection with configurable rates

Retry Logic

Exponential backoff with jitter for resilient network communication

Certificate Caching

LRU cache with TTL for performance optimization

Hyperledger Fabric Integration

Seamless integration with Fabric Gateway API and network management




Architecture

wFabricSecurity follows a layered modular architecture with clear separation of concerns:


digraph Architecture { rankdir=LR; size="8,5"; node [shape=box, style="rounded,filled", fontname="Helvetica"]; User [fillcolor="#667eea", fontcolor="white"]; API [fillcolor="#764ba2", fontcolor="white"]; subgraph cluster_app { label="Application Layer"; style="rounded"; FS [label="FabricSecurity", fillcolor="#4CAF50", fontcolor="white"]; FSS [label="FabricSecuritySimple", fillcolor="#4CAF50", fontcolor="white"]; } subgraph cluster_security { label="Security Layer"; style="rounded"; IV [label="IntegrityVerifier", fillcolor="#FF9800", fontcolor="white"]; PM [label="PermissionManager", fillcolor="#FF9800", fontcolor="white"]; MM [label="MessageManager", fillcolor="#FF9800", fontcolor="white"]; RL [label="RateLimiter", fillcolor="#FF9800", fontcolor="white"]; } subgraph cluster_crypto { label="Cryptographic Layer"; style="rounded"; HS [label="HashingService", fillcolor="#2196F3", fontcolor="white"]; SS [label="SigningService", fillcolor="#2196F3", fontcolor="white"]; IM [label="IdentityManager", fillcolor="#2196F3", fontcolor="white"]; } subgraph cluster_fabric { label="Fabric Layer"; style="rounded"; GW [label="FabricGateway", fillcolor="#9C27B0", fontcolor="white"]; NW [label="FabricNetwork", fillcolor="#9C27B0", fontcolor="white"]; CT [label="FabricContract", fillcolor="#9C27B0", fontcolor="white"]; } subgraph cluster_storage { label="Storage Layer"; style="rounded"; LS [label="LocalStorage", fillcolor="#607D8B", fontcolor="white"]; FSs [label="FabricStorage", fillcolor="#607D8B", fontcolor="white"]; } User -> API; API -> FS; API -> FSS; FS -> IV -> HS; FS -> IV -> SS -> IM; FS -> PM; FS -> MM; FS -> RL; FS -> GW -> NW; FS -> GW -> CT; FS -> LS; FS -> FSs; }



Quick Start


Install wFabricSecurity:


pip install wFabricSecurity

Create a secure Fabric interaction:


from wFabricSecurity import FabricSecurity

# Initialize security system
security = FabricSecurity(
    me="Master",
    msp_path="/path/to/msp",
    gateway_path="/path/to/gateway"
)

# Register identity and code integrity
security.register_identity()
security.register_code(["master.py"], "1.0.0")

# Define communication permissions
security.register_communication("CN=Master", "CN=Slave")

# Create and send a signed message
message = security.create_message(
    recipient="CN=Slave",
    content='{"operation": "process_data", "data_id": "12345"}'
)

# Verify and process
if security.verify_message(message):
    print("βœ“ Message is authentic and unaltered")

Or use the simplified interface:


from wFabricSecurity import FabricSecuritySimple

security = FabricSecuritySimple(msp_path="/path/to/msp")

# One-line verification
result = security.verify_and_process(
    payload={"action": "update"},
    sender="CN=Master"
)

print(f"Verification result: {result}")




digraph SecurityFlow { rankdir=TB; size="10,12"; node [shape=box, style="rounded,filled", fontname="Helvetica", fontsize=11]; Start [label="Start", shape=ellipse, fillcolor="#4CAF50", fontcolor="white"]; CreateHash [label="1. Compute SHA-256 Hash", fillcolor="#E3F2FD"]; Sign [label="2. Sign with ECDSA", fillcolor="#E3F2FD"]; Send [label="3. Send {payload, hash, signature}", fillcolor="#FFF3E0"]; Receive [label="Receive Message", fillcolor="#E8F5E9"]; VerifySig [label="4. Verify Signature", fillcolor="#FFEBEE"]; CheckPerm [label="5. Check Permissions", fillcolor="#FFEBEE"]; QueryHash [label="6. Query Code Hash from Fabric", fillcolor="#F3E5F5"]; GetData [label="7. GetParticipant from Ledger", fillcolor="#F3E5F5"]; Compare [label="8. Compare Hashes", fillcolor="#E3F2FD"]; Invalid [label="❌ Code Integrity Error", shape=ellipse, fillcolor="#F44336", fontcolor="white"]; Process [label="9. Process Payload", fillcolor="#E8F5E9"]; Complete [label="10. Complete Transaction", shape=ellipse, fillcolor="#4CAF50", fontcolor="white"]; Start -> CreateHash -> Sign -> Send; Send -> Receive; Receive -> VerifySig; VerifySig -> CheckPerm; CheckPerm -> QueryHash; QueryHash -> GetData; GetData -> Compare; Compare -> Invalid [label="Hash mismatch"]; Compare -> Process [label="Hash match"]; Process -> Complete; }



Stats


83%+

Test Coverage

300+

Unit Tests

15+

Modules

50+

Functions




Use Cases

πŸ₯ Healthcare

Secure patient data exchange between hospitals using Hyperledger Fabric with cryptographic identity verification.

🏦 Finance

Implement regulatory compliance with tamper-proof transaction logs and audit trails.

🌐 Supply Chain

Track products across supply chains with integrity-verified smart contracts.

πŸ›οΈ Government

Zero Trust architecture for citizen services with fine-grained access control.




Documentation


Contents




Additional Resources


Resource

Link

PyPI Package

https://pypi.org/project/wFabricSecurity/

GitHub Repository

https://github.com/wisrovi/wFabricSecurity

Issue Tracker

https://github.com/wisrovi/wFabricSecurity/issues

Hyperledger Fabric

https://hyperledger-fabric.readthedocs.io/




Citation


If you use wFabricSecurity in your research or project, please cite:


@software{wFabricSecurity,
  author = {William Rodriguez},
  title = {wFabricSecurity: Zero Trust Security System for Hyperledger Fabric},
  url = {https://github.com/wisrovi/wFabricSecurity},
  version = {1.0.0},
  year = {2026},
}


Rodriguez, W. (2026). wFabricSecurity: Zero Trust Security System
for Hyperledger Fabric. https://github.com/wisrovi/wFabricSecurity



Author


William Rodriguez

Research Engineer & Software Architect
eCaptured Technologies



License


MIT License

Copyright (c) 2026 William Rodriguez

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the β€œSoftware”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:


The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.


THE SOFTWARE IS PROVIDED β€œAS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.




Last updated: |today|