pplied in existing, widely used C 2009 by Taylor & Francis Group, LLC SIP Security: Threats, Vulnerabilities and Countermeasures SIP Intermediate Hop-by-hop Hop-by-hop Caller End-to-end Callee FIGURE 18.12 Security services modes in SIP. Internet applications and services. Furthermore, SIP security services should be provided both in a hop-by-hop (intermediate servers) and an end-to-end (end users) fashion (see Figure 18.12). In the above context, SIP designers recommend at least the employment of the following security mechanisms: HTTP digest is a challenge-response authentication protocol [22] emplo- yed for message authentication and identity validity in SIP. It is based on a pre-arranged trusted environment for password distribution, SO it can be applied only under a specific domain. An example of a successful HTTP digest authentication transaction is depicted in Figure 18.8. Specifically, whenever a user sends a SIP request to the SIP server (e.g., a SIP REGISTER mes- sage), the server responds back either with an Unauthorized (401) or Proxy Authentication required (407) message, depending on the type of the SIP server. Upon the reception of the response, the user computes the appro- priate credentials, based on the challenge (a random number) included in the response, and sends a new SIP message containing a WWW-Authenticate header with the credentials to the server. The server checks the validity of the message by first (re) computing and then comparing the credentials with those included in the WWW-Authenticate header. If these two values match, it replies with a "200 OK" response message, otherwise it responds back with an authentication error. Note that the HTTP digest does neither provide mes- sage integrity, nor complete authentication (mutual and end-to-end). More- over, considering that both plaintext (challenge) and ciphertext (computed credentials) can be easily captured by an aggressor, the entire procedure is considered vulnerable to "chosen plaintext" attacks [10]. Another problem is that HTTP 