3.3.5.2.1.3 Sending a Wave Encrypt PDU

The structure and fields of the Wave Encrypt PDU are specified in section 2.2.3.5.

Unlike a WaveInfo PDU and Wave PDU, the Wave Encrypt PDU contains the entire audio sample in the data field.

The cBlockNo field MUST be set as specified in section 3.3.5.2.1.1.

The wFormatNo field is an index into the list of formats sent by the client in the Client Audio Formats and Version PDU. A value of i means the format of the audio data is the ith format of that list.

The audio data MUST be encrypted. Given:

  • The original audio data of the same size

  • And given a 36-byte number, where:

    • the first 32 bytes are the field Seed, exchanged in the Crypt Key PDU during the initialization sequence. If the server did not send a Crypt Key PDU, all 32 bytes of the Seed MUST be set to 0x00.

    • the thirty-third byte is cBlockNo

    • the final three bytes are 0x000000

A SHA-1 hash algorithm (as specified in [FIPS180-2]) is run over this 36-byte number and the field data to produce a 20-byte hash. The original audio data is encrypted with RC4 (as specified in [SCHNEIER]) using this 20-byte hash as a key.

If the client and server versions are both at least 5, then the signature field MUST exist. Otherwise, the field MUST NOT exist. This is how the signature is created. Given:

  • A 36-byte number, where:

    • the first 32 bytes are the field Seed, exchanged in the Crypt Key PDU during the initialization sequence. If the server did not send a Crypt Key PDU, all 32 bytes of the Seed MUST be set to 0x00.

    • the thirty-third byte is cBlockNo

    • and the final three bytes are 0x000000

A SHA-1 hash algorithm is run over this 36-byte number and the field data to produce a 20-byte hash. The value of this field is set to the first 8 bytes of this hash.

This PDU MUST be sent over UDP<25>.