class

FNetCrypto

Module
Networking
Header
#include "Networking/NetCrypto.h"
Namespace
Mowo

Public functions

ReturnsNameDescription
ENetEncryptionModeGetConfiguredEncryptionModenet.encrypt (off/on/auto) and net.psk, with MOWO_NET_ENCRYPT / MOWO_NET_PSK env overrides on top.
std::stringGetConfiguredPreSharedKey
const char*EncryptionModeName
boolNetCryptoRandomBytesFills out from the OS CSPRNG (BCryptGenRandom / /dev/urandom).
std::stringGenerateJoinKeyThe key a host makes up when no net.psk is configured: 130 random bits as Crockford base32 in groups of five.
std::stringNormalizeJoinKeyWhat both ends mix into the KDF: upper case, dashes and spaces dropped, and the letters Crockford reads as digits (O, I, L) folded, so a key read aloud or retyped still matches.
boolIsLoopbackAddress

Function details

GetConfiguredEncryptionMode

C++
static ENetEncryptionMode GetConfiguredEncryptionMode()

net.encrypt (off/on/auto) and net.psk, with MOWO_NET_ENCRYPT / MOWO_NET_PSK env overrides on top.

GetConfiguredPreSharedKey

C++
static std::string GetConfiguredPreSharedKey()

EncryptionModeName

C++
static const char* EncryptionModeName(ENetEncryptionMode mode)

NetCryptoRandomBytes

C++
static bool NetCryptoRandomBytes(uint8_t* out, uint32_t size)

Fills out from the OS CSPRNG (BCryptGenRandom / /dev/urandom).

GenerateJoinKey

C++
static std::string GenerateJoinKey()

The key a host makes up when no net.psk is configured: 130 random bits as Crockford base32 in groups of five. It is the PSK of every link from off this machine, so a player can only join with it, and it has to be long: a peer that connects without it learns enough from the reply to guess offline.

NormalizeJoinKey

C++
static std::string NormalizeJoinKey(const std::string& key)

What both ends mix into the KDF: upper case, dashes and spaces dropped, and the letters Crockford reads as digits (O, I, L) folded, so a key read aloud or retyped still matches.

IsLoopbackAddress

C++
static bool IsLoopbackAddress(const std::string& address)
Generated from Networking/NetCrypto.h via networking.json · Nov 4, 2026Version 1.0.0