TeamSpeak3/Helper/Crypt.php
protected function setSecretKey($passphrase)
    {
        $length = strlen($passphrase);

        if (strlen($passphrase) < 1 || strlen($passphrase) > 56) {
            throw new Ts3Exception(
                "secret passphrase must contain at least one but less than 56 characters"
            );
        }

        $k = 0;
        $data = 0;
        $datal = 0;
        $datar = 0;

        for ($i = 0; $i < 18; $i++) {
            $data = 0;
            for ($j = 4; $j > 0; $j--) {
                $data = $data << 8 | ord($passphrase{$k});
                $k = ($k + 1) % $length;
            }
            $this->p[$i] ^= $data;
        }


        for ($i = 0; $i <= 16; $i += 2) {
            $this->encipher($datal, $datar);
            $this->p[$i] = $datal;
            $this->p[$i + 1] = $datar;
        }

        foreach ($this->s as $key => $val) {
            for ($i = 0; $i < 256; $i += 2) {
                $this->encipher($datal, $datar);
                $this->s[$key][$i] = $datal;
                $this->s[$key][$i + 1] = $datar;
            }
        }
    }
protected function setSecretKey($passphrase)
    {
        $length = strlen($passphrase);

        if (strlen($passphrase) < 1 || strlen($passphrase) > 56) {
            throw new Ts3Exception(
                "secret passphrase must contain at least one but less than 56 characters"
            );
        }

        $k = 0;
        $data = 0;
        $datal = 0;
        $datar = 0;

        for ($i = 0; $i < 18; $i++) {
            $data = 0;
            for ($j = 4; $j > 0; $j--) {
                $data = $data << 8 | ord($passphrase{$k});
                $k = ($k + 1) % $length;
            }
            $this->p[$i] ^= $data;
        }


        for ($i = 0; $i <= 16; $i += 2) {
            $this->encipher($datal, $datar);
            $this->p[$i] = $datal;
            $this->p[$i + 1] = $datar;
        }

        foreach ($this->s as $key => $val) {
            for ($i = 0; $i < 256; $i += 2) {
                $this->encipher($datal, $datar);
                $this->s[$key][$i] = $datal;
                $this->s[$key][$i + 1] = $datar;
            }
        }
    }
Sets the secret key using the specified pasphrase.

@param  string $passphrase
@throws \Teamspeak3\Ts3Exception
@return void