views:

55

answers:

3

How do I protect my program's from packet sniffers?

E.g. I don't want packet sniffers to be able to see where my program connects to.

What is the best way to counter packet sniffing?

+5  A: 

The package content can always be encrypted, but the destination address always needs to be visible for the packets to be routed correctly.

The only way to hide the destination would be to use a proxy and encrypt the message containing the real destination. This only protects the path from the source to the proxy however.

Alexander Sagen
"This only protects the path from the source to the proxy however." wouldn't that be from the proxy to the final destination?
peachykeen
No. Say my mum is watching my router. I send a packet to my proxy containing an address (badsite.com) and some data, both being encrypted. My mum just sees the address of my proxy and some jibberish. Protected. The proxy has to make a connection to badsite.com however, which could be picked up if a man-in-the-middle was placed between my proxy and badsite.com.
Alexander Sagen
+4  A: 

You can protect the content of your communications using a scheme such as SSL. However, you can't hide the destination of your communications because all the routers along the way also need to know where to send your packets.

It's sort of like asking whether you can send a letter to your friend in London, without telling the postal service where your friend lives.

Greg Hewgill
i like the postman example :)
YeenFei
A: 

Use encryption. You can either use SSL to protect everything, or you can encrypt specific data using one of the many public key encryption schemes available.

Revision

If you want to hide where the program is connecting to, perhaps you can use an Anonymizer service

RyanHennig
As other posts say, SSL does not protect the destination of packets, only the content.
SamStephens
I read the question too quickly, so I added a solution for hiding the destination
RyanHennig