Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
O

opennhp

> 安全
Open source

A lightweight, cryptography-powered, open-source toolkit built to enforce Zero Trust security for infrastructure, applications, and data in the AI-driven world.

13.8K stars0 likes7 views
WebsiteGitHub

About

A lightweight, cryptography-powered, open-source toolkit built to enforce Zero Trust security for infrastructure, applications, and data in the AI-driven world.

OpenNHP: Open Source Zero Trust Security Toolkit

OpenNHP is a lightweight, cryptography-powered, open-source toolkit implementing Zero Trust security for infrastructure, applications, and data. It is the reference implementation of the Cloud Security Alliance (CSA) Network-infrastructure Hiding Protocol (NHP) specification, and features two core protocols:

  • Network-infrastructure Hiding Protocol (NHP): Conceals server ports, IP addresses, and domain names to protect applications and infrastructure from unauthorized access.
  • Data-content Hiding Protocol (DHP): Ensures data security and privacy via encryption and confidential computing, making data "usable but not visible."

Website · Vision · Live Demo · Documentation · Discord


Why OpenNHP

The modern internet is a dark forest. Attackers — increasingly backed by LLMs that scan, fingerprint, and exploit at machine speed via Autonomous Vulnerability Exploitation — treat every reachable service as a target. Gartner projects AI-driven cyberattacks will rise rapidly. Traditional defenses authenticate users after the network lets them in, leaving exposed ports, IPs, and domains as a permanent attack surface.

In the AI era, VISIBILITY = VULNERABILITY.

OpenNHP inverts that model: invisible until trusted. Every port, IP, and hostname sits behind a default-deny gate. Access is granted only after a cryptographically signed knock is authenticated and authorized out-of-band. Attackers can't exploit what they can't discover.

The third-generation network hiding protocol

NHP is the next step in a line of "hide the service first" designs:

Generation Protocol Limitations
1 Port Knocking Plaintext, replay-prone
2 Single Packet Authorization (SPA) Shared secrets, one-way, typically hides ports only, typically C/C++
3 NHP Modern crypto, bi-directional with status, hides domain + IP + ports, stateless and horizontally scalable, memory-safe Go

NHP slots in alongside existing IAM, DNS, FIDO, and Zero Trust policy engines rather than replacing them — it extends your stack instead of forking it.


Architecture

OpenNHP follows a modular design with three core components, inspired by the NIST Zero Trust Architecture:

Core Component Role
NHP-Agent Client that sends encrypted knock requests to gain access
NHP-Server Authenticates and authorizes requests; runs separately and is architecturally decoupled from the protected host
NHP-AC Access controller that manages firewall rules on the protected server
Addon Component Role
NHP-Relay HTTP-to-UDP bridge enabling browser-based agents to send NHP knocks via HTTPS
NHP-KGC Key Generation Center for Identity-Based Cryptography (IBC)

Protocol flow

  1. Agent sends an encrypted knock (NHP_KNK) to the Server.
  2. Server validates the knock and sends an operation request (NHP_AOP) to the AC.
  3. AC opens the firewall and replies (NHP_ART) to the Server.
  4. Server returns an acknowledgment (NHP_ACK) with access info to the Agent.
  5. Agent reaches the protected resource through the AC.

Cryptography

OpenNHP ships with two interchangeable cipher suites:

  • CIPHER_SCHEME_CURVE — Curve25519 + AES-256-GCM + BLAKE2s
  • CIPHER_SCHEME_GMSM — SM2 + SM4-GCM + SM3

Both are driven by the Noise Protocol Framework. An Identity-Based Cryptography (IBC) mode is available via the Key Generation Center (KGC).

For protocol details, deployment models, and cryptographic design, see the documentation.


Repository Structure

…

Quick Start

Prerequisites

  • Go 1.26+
  • make
  • Docker and Docker Compose (for the full-stack demo)

Build

bash
# Build all components
make

# Build individual daemons
make agentd    # NHP-Agent
make serverd   # NHP-Server
make acd       # NHP-AC
make db        # NHP-DB
make relayd    # NHP-Relay
make kgc       # NHP-KGC

Test

bash
cd nhp && go test ./...
cd endpoints && go test ./...

Run with Docker

bash
cd docker && docker-compose up --build

Follow the Quick Start tutorial to simulate the full authentication workflow in a Docker environment.


Contributing

We welcome contributions! Please read CONTRIBUTING.md before submitting pull requests.

Note: All commits must be signed with a verified GPG or SSH key.

bash
git commit -S -m "your message"

Security

Found a vulnerability? Please follow the responsible-disclosure process in SECURITY.md rather than opening a public issue.


Sponsors

     

License

Released under the Apache 2.0 License.

Contact

  • Email: [email protected]
  • Discord: Join our Discord
  • Website: https://opennhp.org

Issues· 15 open

View all issuesOpen on GitHub
  • #1732

    TEE Remote Attestation Fallback Bypass

    bugUpdated Sep 14, 2026
  • #1682

    Move agent server.toml demo-key drift gate into the release build pipeline

    Updated Jul 26, 2026
  • #1681

    Agent: distinguish DNS-resolution failure from unparseable IP in knock error

    Updated Jul 26, 2026
  • #1680

    Scheduled drift check for hard-coded demo key in endpoints/agent/main/etc/server.toml

    Updated Jul 26, 2026
  • #1665

    Hackathon: passive origin/topology recon of the demo (your port-hiding held; CT/DNS leak flag) — from a very new IETF newcomer

    Updated Jul 24, 2026
  • #1611

    spec: clarify NHP-LST direction and NHP-LRT response semantics

    compatibilityUpdated Jun 30, 2026
  • #1583

    spec: reconcile NHP header size and packet framing with CSA standard

    bugcompatibilityP1Updated Jun 12, 2026
  • #1582

    spec: map message payload schemas to CSA Appendix 2

    bugcompatibilityP1Updated Jun 12, 2026
  • #1581

    spec: align encrypted timestamp units with CSA NHP standard

    bugcompatibilityP1Updated Jun 12, 2026
  • #1580

    spec: implement CSA-standard keyed header HMAC semantics

    bugcompatibilityP1Updated Jun 12, 2026

> Tags

Gocybersecurityzero-trustzero-trust-network-accesszero-trust-security

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 2, 2026
Category安全
PricingOpen source

> Related tools

O
OWASP ZAP
开源 Web 应用安全扫描器
O
owasp-wstg-tracker
Simple web app to track OWASP WSTG security testing progress
H
homebridge-mi-gateway-security
XiaoMi Gateway Security plugin for HomeBridge.