DiscordPHP Documentation

VoiceGroupCryptoTrait

Provides group-based AEAD encryption and decryption for Discord voice RTP packets.

Tags
author

Valithor Obsidion valithor@valgorithms.com

since
10.41.0

Table of Contents

Properties

$secret_key  : string
$mode  : string

Methods

decryptRTPPacket()  : string|false
Decrypt an RTP packet (header + encrypted payload).
encryptRTPPacket()  : string
Encrypt an RTP packet (header + Opus payload).
buildNonce()  : string
Build a nonce for RTP-style AEAD.
decrypt()  : string|false
Decrypt a message from Discord's MLS Group.
encrypt()  : string
Encrypt a message for Discord's MLS Group.

Properties

Methods

decryptRTPPacket()

Decrypt an RTP packet (header + encrypted payload).

public decryptRTPPacket(VoicePacket $packet[, int $seq = 0 ]) : string|false
Parameters
$packet : VoicePacket
$seq : int = 0
Return values
string|false

encryptRTPPacket()

Encrypt an RTP packet (header + Opus payload).

public encryptRTPPacket(VoicePacket $packet[, int $seq = 0 ]) : string
Parameters
$packet : VoicePacket
$seq : int = 0

Sequence number for AES-GCM mode

Return values
string

buildNonce()

Build a nonce for RTP-style AEAD.

protected buildNonce([string $header = '' ][, int $seq = 0 ]) : string
Parameters
$header : string = ''
$seq : int = 0
Return values
string

decrypt()

Decrypt a message from Discord's MLS Group.

protected decrypt(string $ciphertext[, string $header = '' ][, int $seq = 0 ]) : string|false
Parameters
$ciphertext : string
$header : string = ''

Optional RTP header

$seq : int = 0

Optional sequence number

Return values
string|false

encrypt()

Encrypt a message for Discord's MLS Group.

protected encrypt(string $plaintext[, string $header = '' ][, int $seq = 0 ]) : string
Parameters
$plaintext : string
$header : string = ''

Optional 12-byte RTP header (for RTP-style nonce)

$seq : int = 0

Optional sequence number (for AES-GCM)

Return values
string

        
On this page

Search results