Jump to content

- - - - -

Voice chat

  • Please log in to reply
1 reply to this topic

#1 mSparks



  • Members
  • 102 posts
  • Gender:Male

Posted 17 February 2012 - 09:35 AM

So following the intelligence agencies aquisition of Redphone, I thought I'd have a play with my own implimentation.

What I have found so far:
Streaming audio from android devices is incredibly easy, but compressing it is not, so it works fine on high bandwidth connection, but over 3g is a bit of a pain.
I implimented Ogg vorbis compression, this works sweet on higher powered devices, but is unusable on the lesser power machines, only alternative for these is to reduce the capture quality significantly (11025Hz, 8 bit, gives an ~11KBs stream, works works ok on my htc wildfire). vorbis is a much better choice, giving ~9KBs for full 44Khz 16 bit.

I already have a multipart encryption library running for group comms, this works thus:
Use RSA to exchange a seed
use the seed to exchange the username (XOR)
use username, usernames password & seed to create a one time preshared key for AES - private comms
Server sends a group key over private comms - establishing group comms (everyone in this group can now talk directly with each other).

This would work well for creating private chat rooms.

It also means I can now "bug" any room simply by leaving an android device in it - or an entire house using several :) - the gain on these devices is stunning - can seperate a whisper from TV noise at 15 feet - but only when using HQ audio.

The encryption stuff is all "plug in", for the enc library above I use the standard RSA implimentation, but a custom AES jar which strips out/compresses highly repetitive patterns from whatever it encrypts. Both of these can be easily substituted for other implimentations simply by swapping the jars.

true P2P voice doesn't seem easy, most of the phones seem to be exposed to the internet inside a NAT - I know tunneling through these is possible, but have no idea how, and afaik, it still requires a device acting as a proxy to establish the connection - does anyone know of a protocol used to hand over to p2p?
something like:
Users A & B behind NAT
User A connects to server and sends text message to user B
user B uses A's text message to contact same server
server links A & B directly together (how to do this?)

The alternative would be to just route encrypted traffic through a proxy (where the proxy doesn't know the Key used by the users), but this would be limited by the bandwidth of the proxy (or users would have to set up their own).

#2 mSparks



  • Members
  • 102 posts
  • Gender:Male

Posted 20 February 2012 - 05:29 AM



So, can run in the background and over 3g, (switched to UDP - much better - even do P2P) tested with up to 10 devices in a "chat room" (could do more, but I don't have any more devices).

Fairly gentle on battery life.

Didn't seem to like the twitter application, just seizing the mic seems to crash twitter when the phone is on wifi.........Had to uninstall it. (wtf is was twitter doing with the mic anyway)

More work to do on a gui and server code (just finished the mixing code).

Ultimate in concealed "bugs" - hidden in plane sight.

All the fun I could have with this is only just starting to dawn on me. Source release when I'm happy with it.

Peering protocol:

Edited by mSparks, 20 February 2012 - 05:34 AM.

BinRev is hosted by the great people at Lunarpages!