It might sound stupid but I could not find the straight answer.

  1. Do I need to worry about communication security if I use only TCP socket to communicate between 2 machines? Is the byte stream can be intercepted and read in plain?
  2. Do I need to SSL/TLS if I am not using application-level protocol(HTTP)?
  3. If 2 Yes, then how to that in C++/C.
  • 2
    1: yes, 2: yes, 3: that's very broad – AndrolGenhald Jan 30 '18 at 21:09
  • Is the byte stream encrypted? Do you need encryption at all? – schroeder Jan 30 '18 at 21:13
  • @schroeder: No, but I can encrypt it If I want. If I encrypt SSL/TLS not required ?. – Roshan Mehta Jan 30 '18 at 21:27
  • Why do you assume there is any layer where exchanging confidential information wouldn't require encryption? – Arminius Jan 30 '18 at 21:59

The short answer is that yes, if you want secure communication using TCP you need to either implement application-level security or use SSL/TLS. https://en.wikipedia.org/wiki/Transmission_Control_Protocol and see the right hand side of the page for a description of the different layers. TCP is on a fundamentally different layer than TLS/SSL.

As to how to do that in C or C++, that depends largely on what you're trying to accomplish and is too broad a question.

  • But I'm not going beyond TCP layer. – Roshan Mehta Jan 30 '18 at 21:29
  • I'm not sure what you mean. What is the "But" in response to? You're not going beyond in which direction - higher or lower? – Russbear Jan 30 '18 at 21:40
  • Assume my endpoints and applications are secure. Can some man-in-middle attack can happen if I don't use SSL. – Roshan Mehta Jan 30 '18 at 21:43
  • Yes, absolutely. – Russbear Jan 30 '18 at 21:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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