UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FEncryption Namespace Reference

Functions

template<typename IntType >
IntType CalculateGCD (IntType ValueA, IntType ValueB)
 
template<typename IntType >
IntType CalculateMultiplicativeInverseOfExponent (IntType Exponent, IntType Totient)
 
template<typename IntType >
void GenerateKeyPair (const IntType &P, const IntType &Q, FEncryptionKey &PublicKey, FEncryptionKey &PrivateKey)
 
template<typename IntType >
IntType ModularPow (IntType Base, IntType Exponent, IntType Modulus)
 
template<typename IntType >
void EncryptBytes (IntType *EncryptedData, const uint8 *Data, const int64 DataLength, const FEncryptionKey &EncryptionKey)
 
template<typename IntType >
void DecryptBytes (uint8 *DecryptedData, const IntType *Data, const int64 DataLength, const FEncryptionKey &DecryptionKey)
 
void EncryptSignature (const FDecryptedSignature &InUnencryptedSignature, FEncryptedSignature &OutEncryptedSignature, const FEncryptionKey &EncryptionKey)
 
void DecryptSignature (const FEncryptedSignature &InEncryptedSignature, FDecryptedSignature &OutUnencryptedSignature, const FEncryptionKey &EncryptionKey)
 

Detailed Description

Math utils for encryption.

Function Documentation

◆ CalculateGCD()

template<typename IntType >
IntType FEncryption::CalculateGCD ( IntType  ValueA,
IntType  ValueB 
)

Greatest common divisor of ValueA and ValueB.

◆ CalculateMultiplicativeInverseOfExponent()

template<typename IntType >
IntType FEncryption::CalculateMultiplicativeInverseOfExponent ( IntType  Exponent,
IntType  Totient 
)

Multiplicative inverse of exponent using extended GCD algorithm.

Extended gcd: ax + by = gcd(a, b), where a = exponent, b = fi(n), gcd(a, b) = gcd(e, fi(n)) = 1, fi(n) is the Euler's totient function of n We only care to find d = x, which is our multiplicatve inverse of e (a).

◆ DecryptBytes()

template<typename IntType >
void FEncryption::DecryptBytes ( uint8 DecryptedData,
const IntType *  Data,
const int64  DataLength,
const FEncryptionKey DecryptionKey 
)

Decrypts a stream of bytes

◆ DecryptSignature()

void FEncryption::DecryptSignature ( const FEncryptedSignature InEncryptedSignature,
FDecryptedSignature OutUnencryptedSignature,
const FEncryptionKey EncryptionKey 
)
inline

◆ EncryptBytes()

template<typename IntType >
void FEncryption::EncryptBytes ( IntType *  EncryptedData,
const uint8 Data,
const int64  DataLength,
const FEncryptionKey EncryptionKey 
)

Encrypts a stream of bytes

◆ EncryptSignature()

void FEncryption::EncryptSignature ( const FDecryptedSignature InUnencryptedSignature,
FEncryptedSignature OutEncryptedSignature,
const FEncryptionKey EncryptionKey 
)
inline

◆ GenerateKeyPair()

template<typename IntType >
void FEncryption::GenerateKeyPair ( const IntType &  P,
const IntType &  Q,
FEncryptionKey PublicKey,
FEncryptionKey PrivateKey 
)

Generate Key Pair for encryption and decryption.

◆ ModularPow()

template<typename IntType >
IntType FEncryption::ModularPow ( IntType  Base,
IntType  Exponent,
IntType  Modulus 
)

Raise Base to power of Exponent in mod Modulus.