Generated from the canonical agy2/cipher-jump headers (include/cipher_jump.h, include/cipher_jump.hpp, CipherJump.cs, and CipherJumpPacketHandler.h). Press Ctrl+K or / to filter docs and ABI exports instantly.
ARCHITECTURE • DIRECTIONAL THREAT MODEL
Mode A (Managed UDP Sockets) vs. Mode B (In-Memory Engine Pipeline)
CipherJump exposes two complementary integration surfaces from the same Rust core library (cipher_jump_core.dll on Windows x64, libcipher_jump_core.so on Linux x86_64):
Mode B — In-Memory Session Pipeline (Recommended for Game Engines):CipherJumpClientSession and CipherJumpServerSession operate directly on caller-owned memory buffers with zero internal sockets and zero heap allocations on hot game ticks. Game engines (Unreal Engine UNetConnection / PacketHandler, Unity / Godot custom transports, C++20 dedicated servers) pass outbound payload and cleartext attestation bytes into cipher_jump_client_session_encrypt and pass raw incoming UDP datagrams into cipher_jump_server_session_decrypt.
Mode A — Standalone Managed UDP Transport:CipherJumpHandle and CipherJumpServerHandle bind and manage OS UDP sockets directly for standalone tools, custom daemons, and simulation harnesses.
Directional Security Architecture: CipherJump is engineered to protect authoritative game state and client telemetry by cryptographically securing the Client → Server datagram pipeline against tampering, forging, and replay attacks. Server → Client broadcast and replication traffic is unencrypted (plaintext) by design in v0.3.0; studios requiring Server → Client confidentiality should pair CipherJump with DTLS or engine-level broadcast encryption.
The Unreal Engine plugin (plugins/UnrealEngine/CipherJump/CipherJump.uplugin) pins "EngineVersion": "5.8.0" and has been compiled and verified against Unreal Engine 5.8.3 (earlier UE 5.x releases are target-compatible). It implements Unreal's HandlerComponent interface to intercept bitstreams between UNetConnection and the raw UDP socket.
1. Module & Project Configuration
Copy Plugins/CipherJump into your Unreal project's Plugins/ folder, add "CipherJump" to your target's PublicDependencyModuleNames, and add the project configuration block below to your game's Config/DefaultEngine.ini:
; Config/DefaultEngine.ini (Project configuration consuming the CipherJump module)
[PacketHandlerComponents]
+Components=CipherJump.CipherJumpPacketHandler
2. Per-Connection Session Initialization & Advisory 1200B MTU Check
Per-Connection Replay Isolation: On dedicated servers, each UNetConnection instantiates its own FCipherJumpPacketHandler (or calls SetClientId(uint64) when multiplexing) so replay tracking is isolated per 64-bit client connection ID.
Automatic Seed Zeroization: Calling ConfigureSession(...) initializes the underlying cipherjump::ClientSession / ServerSession and immediately wipes the temporary WOD buffer via FMemory::Memzero.
Advisory / Warn-Only 1200B MTU Check:FCipherJumpPacketHandler::MaxUdpMtuBytes = 1200 (`FixedCryptoOverheadBytes = 44`) is strictly advisory (warn-only via UE_LOG) in CipherJumpPacketHandler.cpp:188-194 so oversized initial handshake packets are never truncated or dropped.
#include "CipherJumpPacketHandler.h"
void UMyNetDriverSubsystem::BindMatchTicketToConnection(
FCipherJumpPacketHandler& Handler,
TArrayView<const uint8> MatchWodSeed, // 32 bytes from TLS join ticket
uint16 NetId,
uint64 ServerEpochOffset,
uint64 ClientConnectionId)
{
Handler.SetClientId(ClientConnectionId);
Handler.ConfigureSession(MatchWodSeed, NetId, ServerEpochOffset, /*EpochDurationMs=*/250, /*WindowSize=*/3);
}
// On client disconnect, evict replay state from the server session:
void UMyNetDriverSubsystem::OnClientDisconnected(FCipherJumpPacketHandler& Handler)
{
Handler.NotifyConnectionLost();
}
bindings/csharp/CipherJump/CipherJump.cs targets netstandard2.1, net8.0, and net9.0 for drop-in compatibility with Unity (via UPM package com.failsafestudio.cipherjump or CipherJump-Unity-v0.3.0.unitypackage) and Godot 4 C#. Native handle lifecycles are managed via SafeHandleZeroOrMinusOneIsInvalid (`SafeClientSessionHandle` and `SafeServerSessionHandle`).
using System;
using CipherJump;
// 1. Client-side zero-allocation encryption:
using var clientSession = CipherJumpClientSession.Create(
wodSeed: joinTicketWod, // ReadOnlySpan<byte> (32 bytes)
netId: 1,
epochOffset: 1000,
epochDurationMs: 250,
windowSize: 3);
Span<byte> wireBuf = stackalloc byte[
CipherJumpSecurity.HeaderFixedSize + attestSpan.Length + payloadSpan.Length + CipherJumpSecurity.GcmTagSize];
int wireLen = clientSession.Encrypt(payloadSpan, attestSpan, wireBuf);
// 2. Dedicated Server zero-allocation decryption & AAD verification:
using var serverSession = CipherJumpServerSession.Create(joinTicketWod, netId: 1, epochOffset: 1000);
Span<byte> outPayload = stackalloc byte[1024];
Span<byte> outAttest = stackalloc byte[128];
var result = serverSession.Decrypt(
clientId: peerConnectionId,
inWire: wireBuf.Slice(0, wireLen),
outPayload: outPayload,
outAttestation: outAttest);
// Disconnect cleanup:
serverSession.RemoveClient(peerConnectionId);
include/cipher_jump.hpp wraps the C99 ABI in move-only RAII classes (cipherjump::ClientSession, cipherjump::ServerSession, cipherjump::Client, cipherjump::Server) returning cipherjump::Result<T> value types. It compiles cleanly with exceptions disabled (verified under MSVC /std:c++20 /EHs-c- in the 4-peer, 1,000-frame @ 60 Hz simulation harness).
#include "cipher_jump.hpp"
// Generate a 32-byte WOD root seed on the match server via OS CSPRNG:
auto seedRes = cipherjump::generate_wod_seed();
if (!seedRes) return;
std::array<uint8_t, 32> wodSeed = *seedRes;
// Create move-only RAII client & server sessions:
auto clientRes = cipherjump::ClientSession::create(wodSeed, /*net_id=*/1, /*epoch_offset=*/1000);
auto serverRes = cipherjump::ServerSession::create(wodSeed, /*net_id=*/1, /*epoch_offset=*/1000);
std::array<uint8_t, 512> wireBuf{};
auto encRes = clientRes->encrypt(payloadSpan, attestSpan, wireBuf);
if (encRes.is_ok()) {
std::span<const uint8_t> wireFrame{wireBuf.data(), *encRes};
std::array<uint8_t, 256> decPayload{};
std::array<uint8_t, 128> decAttest{};
auto decRes = serverRes->decrypt(/*client_id=*/42ULL, wireFrame, decPayload, decAttest);
}
FLEET DEPLOYMENT • TLS JOIN-TICKET HANDSHAKE
Dedicated Server Fleet & Out-of-Band WOD Seed Handshake
CipherJump does not require a standalone matchmaker binary. Instead, the 32-byte match secret is generated and distributed inside your studio's existing authenticated matchmaking / join-ticket flow:
Server Seed Generation: When a match instance spins up (Windows cipher_jump_core.dll or Linux x86_64 libcipher_jump_core.so), the dedicated server calls cipher_jump_generate_wod_seed(uint8_t *out_seed) to generate a 256-bit CSPRNG Word-of-Day seed and initializes cipher_jump_server_session_create.
Out-of-Band TLS Join-Ticket Delivery: When a player is authorized to join the match, your matchmaking service includes the 4-tuple (wod_seed [32B], net_id [u16], epoch_offset [u64], epoch_duration_ms [250]) inside the player's TLS-encrypted join ticket.
Zero-Handshake UDP Datagram Flow: The game client initializes cipher_jump_client_session_create with the join-ticket parameters and immediately wipes its copy of wod_seed. From the very first UDP packet, both peers deterministically hop keys and AEAD cipher suites every 250ms with zero UDP handshake round-trips.
C99 Return Status & Error Code Table (12 Constants)
Note: Statistical rate-burst anomalies (Scenario 7, exceeding max(μ + 3.0σ, 10.0) packets/epoch) are surfaced asynchronously via the server's AnomalyReport callback rather than a negative FFI return code.