Audio Encryption in Voip SIP I have some project encrypion real-time. I want use Voip SIP to implement the stream cipher.

What I have done so far :


Simple app android Voip SIP https://github.com/android/platform_development/tree/master/samples/SipDemo 
Stream cipher. It can encrypt and decrypt file (but can't open it). It can encrypt .wav audio, you can play it and make weird sound. Also you can decrypt it again and make it back to normal.


My problem :

I dont know how to take audio to encrypt it and how to take the encrypted stream to decrypt it.
You won't be able to use a stream cipher with VOIP, because packet loss will prevent you from properly decrypting data that follows the missing chunks.

It may be possible to work around this issue, if you can figure out the size of the missing data, and assuming your chosen stream cipher does not have feedback, fast-forward to cipher to the start of the next block, all at the cost of wasted computation.

The correct approach that I am aware of, is to use a block cipher in CTR mode of operation, where the counter is based on the sequence numbers stamped in the packet headers. Essentially, you need to use a cipher that supports seeking within the data, without needing to decrypt all blocks prior to the block of interest.