private function compareStrings($knownString, $userString)
    {
        $result = "\x00";

        for ($i = 0, $length = strlen($knownString); $i < $length; $i++) {
            $result |= $knownString[$i] ^ $userString[$i];
        }

        return $result === "\x00";
    }