Skip to main content

fognode - headless secure encrypted data transmission. TLS + X25519 + AESGCM + PBKDF2.

Project description

fognode

headless secure encrypted data transmission.

License Python Platform black ruff pyright


Encrypted channel library for headless projects. Built for speed and zero-trust networking.

Stack: TLS 1.2+ · X25519 · AESGCM-256 · HMAC-SHA256 · PBKDF2 · HKDF


Install

pip install fognode

Quick start

Server

from fognode import Server, MessageEvent

server = Server(host="0.0.0.0", port=9443, password="secret")

@server.on_event(MessageEvent)
async def echo(ctx):
    if ctx.event.text:
        await ctx.answer(f"echo: {ctx.event.text}")

@server.on_event(ConnectEvent)
async def on_connect(ctx):
    print("+ peer connected")

@server.on_event(DisconnectEvent)
async def on_disconnect(ctx):
    print("- peer disconnected")

if __name__ == "__main__":
    server.run()

Client

from fognode import Client, MessageEvent, ClosedEvent

client = Client(connect_string="oak-pine-stone-field:9443", password="secret")

@client.on_event(MessageEvent)
async def on_message(ctx):
    print(f"msg: {ctx.event.text}")

@client.on_event(ClosedEvent)
async def on_closed(ctx):
    print("connection closed")

if __name__ == "__main__":
    client.connect()

Events

Event Server Client Description
StartEvent Server/client started
ConnectEvent Peer connected
DisconnectEvent Peer disconnected
MessageEvent Message received
ClosedEvent Connection closed
ErrorEvent Error occurred

Classic API

from fognode import start_server, client_connect

ip, code, fp = start_server("0.0.0.0", 9443, "secret")
print(f"Connect: {code}:9443")

Structure

src/fognode/
├── app.py          # Server, Client, Context
├── core/
│   ├── events.py   # Event classes
│   ├── server.py   # start_server()
│   ├── client.py   # client_connect()
│   └── probe.py    # probe_server()
├── crypto/         # primitives, kdf, cert, channel
├── ciphers/        # aesgcm, chacha20, x25519, hkdf, pbkdf2, hmac
├── wire/           # framing
├── auth/           # handshake
├── types/          # exceptions, constants, protocol
├── decorators.py   # retry, rate_limited, timed
├── exceptions.py   # errors
├── utils/          # ipwords, ratelimit, net
└── cli/            # entrypoint

MIT © reekeer

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fognode-0.2.3.tar.gz (32.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fognode-0.2.3-py3-none-any.whl (35.8 kB view details)

Uploaded Python 3

File details

Details for the file fognode-0.2.3.tar.gz.

File metadata

  • Download URL: fognode-0.2.3.tar.gz
  • Upload date:
  • Size: 32.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fognode-0.2.3.tar.gz
Algorithm Hash digest
SHA256 4a31bfed7ca5fee85efdaea0d766c1e35f8a86c7c0b0da30d24d6e4e46888e39
MD5 64cd41ef4af33bf8b06ede50933752c5
BLAKE2b-256 afeef2ae38f600c0f57e43b2b3a9953f253e6cd9747fadf2e8ed7fc43b6beaba

See more details on using hashes here.

File details

Details for the file fognode-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: fognode-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 35.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fognode-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2271c7fe172880356a12b7a3d7f2e8d56d33726061477a387383f4e89b9daa0b
MD5 0927a7c7dc02500cba16ba9b4ab6592e
BLAKE2b-256 631e3642bc04280550de10949ab95f84fecf9e52e02655736949f2292d6a86c1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page