public byte[] evaluateResponse(final byte[] response) throws SaslException {
      if (state == 0) {
         msgID = CramMD5Util.createMsgID();
         state++;
         return msgID;
      }

      final String responseStr = new String(response);
      final int index = responseStr.lastIndexOf(" ");
      final String username = responseStr.substring(0,index);
      final byte[] responseDigest;
      try {
         responseDigest = responseStr.substring(index+1).getBytes("UTF-8");
      } catch (UnsupportedEncodingException x) {
         throw new AuthenticationException("evaluateResponse()", x);
      }

      // Look up the password
      final char[] password = lookupPassword(username);

      // Compute the digest
      byte[] digest;
      try {
         digest = CramMD5Util.createHMac(password, msgID);
      } catch (InvalidKeyException x) {
         throw new AuthenticationException("evaluateResponse()", x);
      }
      try {
//         digest = (new String(Util.toString(digest).toLowerCase())).getBytes("UTF-8");
         digest = Util.toString(digest).toLowerCase().getBytes("UTF-8");
      } catch (UnsupportedEncodingException x) {
         throw new AuthenticationException("evaluateResponse()", x);
      }

      // Compare the received and computed digests
      if (!Arrays.equals(digest, responseDigest)) {
         throw new AuthenticationException("Digest mismatch");
      }
      state++;
      return null;
   }