Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am working on a product that requires devices to exists anywhere in the world hooked up to the internet though cell modems or on WLAN lines which communicates to a server(s) that exists elsewhere in the world.

When deigning the networking portion of the program i cant figure what the best option is for securing the communication between the server and end device.

From my searches iv'e come up with two options.

Option 1: Using a host to host vpn connection between the two devices.

Pros: VPN software seems to be well tested and does not require extra programming for the network protocol. The IT department is more comfortable with it because of using software that is already tested and they comfortable with vpn.

Cons: Since my end devices are linux on OMAP platforms cross compiling the vpn software if not already done could be tricky. Dealing with firewalls and routers behind the end devices network. Setup of the connection can be tricky.

Option 2: Implementing the TLSv1 protocol in my program to deal with the encryption.

Pros: Does not require extra software to be running on the device. Only relies on the encryption libraries as a dependency. Don't have to worry about dealing with nats and firewalls because the protocol will only require one tcp port to be open.

Cons: Extra coding to the network software. IT is skeptical because our program is responsible for securing the protocol.

FYI: For implementing the TLSv1 i would use http://www.gnu.org/software/gnutls/

share|improve this question
    
You could also use SSH (another very well-tested program) to set up a tunneled port; connect to localhost at one end, connection pops out to (a different) localhost on the other end. Easy. Secure. No extra code. And firewalls let SSH through more often than a VPN (strange, but true). –  Donal Fellows Oct 14 '11 at 14:54
    
Would you just setup a port forward on each machine? –  D. Mathis Oct 14 '11 at 15:00
    
I don't know! :-) Working out the exact option to use is quite complex, and requires much more information than I've been given. My comment was there mainly to say that there are more reasonable options than you appear to have considered. –  Donal Fellows Oct 15 '11 at 7:39

3 Answers 3

up vote 2 down vote accepted

The primary tradeoff is in who has responsibility for ensuring security.

  • If you rely upon a VPN, then the responsibility is on the ops folks to ensure they have set up a VPN. If they forget or misconfigure the VPN, then you will be silently insecure, but probably no one will notice, because the app will keep working.

  • If you embed end-to-end encryption into your application (e.g., using SSL/TLS), then security is automatic. There is nothing to forget and less potential for configuration errors; you may be able to arrange for the security to be on by default, or at least for the software to refuse to start if it cannot negotiate a secure encrypted connection. However, this approach probably requires more effort to code.

I would decide based upon how many installations of your system you plan to make. If you will have only one installation, and your ops folks are willing to take on the extra burden of setting up and maintaining the VPN, and have set up appropriate processes/checklists to detect configuration errors, then the VPN approach will probably be simpler and cheaper, so that's what I'd use. If you have many installations, then I would recommend implementing it in your software: you'll do it once, and it'll save everyone who installs the software from having to individually deal with the VPN; and the resulting security will be more reliable, because there is less risk of configuration errors.

share|improve this answer
    
The goal with the product is to have many installations. –  D. Mathis Nov 7 '11 at 0:55

Using VPN and adding TLS capability to your program are two independent answers, dealing with different protocol layers with each other.

VPN secures the network packets between two hosts. On the other hand, TLS capability of your program will secure the communication between the two programs regardless of the underlying protocols, including the physical layer (WLANs or modem links).

If you're trying to use your program where VPNs are not available, TLS is mandatory.

share|improve this answer

My advise would be figure out what type of communication style is required, one way or two way. If you are looking at a one way communication pattern then it's probably safe to say use something lightweigth and bog standard as https as TLS. If however there is two way communication required looking into vpn is a great option. Big drawback of vpn connections is connection setup requires quite a lot of time (relatively speaking). If the user has to wait for this setup than that would be less than ideal. In that case custom TLS would be the preferrable option.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.