cisco / libsrtp

Library for SRTP (Secure Realtime Transport Protocol)
Other
1.2k stars 472 forks source link

How to implement the same as given in cisco libsrtp link for an audio file instead of a text file ? #540

Closed shrutimohankumar closed 3 years ago

shrutimohankumar commented 3 years ago

Any suggestions on how to encrypt and decrypt audio file instead of text file?

paulej commented 3 years ago

Who is "we"?

shrutimohankumar commented 3 years ago

I meant to say as I followed from the cisco libsrtp github link. My requirement is to encrypt an audio file. Just wanted guidance on how to do that.

paulej commented 3 years ago

SRTP isn't intended to encrypt files. It's intended to encrypt media streamed over the internet that would otherwise be sent in the clear using RTP. As you transmit packets, you call srtp_protect() before transmitting. (There is other setup work needed beforehand and the sample code is useful for understanding that.)

shrutimohankumar commented 3 years ago

Can you elaborate on what exactly the setup should be? I have understood the sample code but I am having difficulty in understanding how to use it to encrypt audio.

paulej commented 3 years ago

It might help to read RFC 3550, which describes transmission of audio and video via RTP. Then read RFC 3771, which describes the encryption procedures for RTP. LibSRTP is just an implementation of RFC 3771.

pabuhler commented 3 years ago

Closing this as it seams to be off topic, libSRTP is for encrypting RTP packets not media directly.