GSMCalls

VoIP & SIP

SRTPAlso known as Secure Real-time Transport Protocol

Definition

SRTP (Secure Real-time Transport Protocol) is the profile of RTP, defined in RFC 3711, that encrypts and authenticates voice and video packets. It protects call audio from eavesdropping and tampering, typically using AES in counter mode for encryption and HMAC-SHA1 for message authentication, while adding only a few bytes per packet.

How SRTP works

SRTP keeps the RTP header readable (so routers and jitter buffers still work) but encrypts the payload and appends an authentication tag. The default suite, AES_CM_128_HMAC_SHA1_80, uses a 128-bit AES key and an 80-bit tag; the _32 variant uses a shorter tag. A companion protocol, SRTCP, protects the RTCP statistics channel.

Both ends need the same keys, which SRTP itself does not provide. Three key-exchange methods are common:

  • SDES (RFC 4568): keys are sent in the SDP body as a=crypto lines. Simple and widely supported, but only safe when signalling is encrypted with TLS.
  • DTLS-SRTP (RFC 5763/5764): keys are negotiated in a DTLS handshake on the media path. Mandatory in WebRTC.
  • ZRTP (RFC 6189): peer-to-peer key agreement with a short authentication string users can compare.

SRTP and TLS together

TLS encrypts SIP signalling (who is calling whom, and SDES keys); SRTP encrypts the audio. Using one without the other leaves a gap: SRTP with SDES over plain UDP exposes the keys, and TLS without SRTP leaves the voice in clear text. Our guide to SIP security with TLS and SRTP covers configuration on common PBXs.

Practical considerations

Every hop that needs to touch the audio, such as an SBC that transcodes or records, must decrypt and re-encrypt it, so SRTP is usually hop-by-hop rather than end-to-end. On a mobile gateway call, the radio leg is protected separately by the mobile network’s own air-interface encryption.

Frequently asked questions

Does SRTP need TLS?

If keys are exchanged with SDES, yes: without TLS the keys travel in clear text in SDP. DTLS-SRTP and ZRTP negotiate keys on the media path and do not depend on TLS signalling.

Does SRTP add latency or bandwidth?

Very little. Encryption is fast and the authentication tag adds 4 or 10 bytes per packet.

What port does SRTP use?

The same kind of dynamically negotiated UDP ports as RTP; there is no special port.

Further reading

All glossary terms