private function deriveKeys(string $cipher, string $keySalt) : DerivedKeys
    {
        // Extract the number of bytes from the cipher
        $keyByteLength = $this->getKeyByteLengthForCipher($cipher);

        if ($this->secret->getType() === SecretTypes::KEY) {
            return $this->keyDeriver->deriveKeysFromKey($this->secret->getValue(), $keySalt, $keyByteLength);
        } else {
            return $this->keyDeriver->deriveKeysFromPassword($this->secret->getValue(), $keySalt, $keyByteLength);
        }
    }