protected Response authCramMD5(String user, String password) {
        Response response = doCommand("AUTH", "CRAM-MD5");
        if (response.code == 503)
            return response;
        Mac mac;
        try {
            mac = Mac.getInstance("HmacMD5");
            mac.init(new SecretKeySpec(password.getBytes(Charset.forName("UTF-8")), "HmacMD5"));
        } catch (NoSuchAlgorithmException e) {
            return response;
        } catch (InvalidKeyException e) {
            return response;
        }
        byte[] hash = mac.doFinal(Coder.decode(response.message));
        return doCommand(Coder.encodeString(user + " " + Coder.convertToHex(hash)));
    }