-
Notifications
You must be signed in to change notification settings - Fork 218
End‐to‐end encryption in WebRTC audio call
The SDK facilitates end-to-end encrypted audio call using WebRTC's RTCRtpSender and RTCRtpReceiver along with the Window Crypto API for encryption. The encryption and decryption of media streams are handled using AES-GCM, providing a robust mechanism to encrypt audio data end-to-end.
- Audio streams are encrypted before being transmitted to the peer.
- Decryption of the streams occurs on the receiver’s end, ensuring confidentiality.
- The encryption keys are generated using the Web Crypto API.
Sender:
The media stream (audio) is intercepted before transmission using RTCRtpSender.createEncodedStreams()
.
The data is encrypted using AES-GCM with a unique IV for each chunk.
The encrypted data is passed back to the RTP sender for transmission.
Receiver:
The encrypted media stream is intercepted using RTCRtpReceiver.createEncodedStreams()
.
The encrypted data is decrypted using the remote peer’s AES key and the IV.
The decrypted data is then passed to the media player for playback.