Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using a TCP Client Server Library called Lacewing.

What I noticed is that messages I send and receive are in plain text. Is there a way to encrypt / decrypt the messages easily given that I use TCP? How could I add something like TLS or similar?


The library is pretty high level but here is client server in a nutshell:

#include <string>
#include <iostream>  
#define  LacewingFunction
#include "Lacewing.h"

void onReceive (Lacewing::Server &Server, Lacewing::Server::Client &Client,
                char * Data, int Size) {
                    /* callback body */
                    std::cout << Data << "\n";

void onConnect (Lacewing::Server &Server, Lacewing::Server::Client &Client)
    std::cout << "Connected!" << "\n";

void onReceiveC (Lacewing::Client &Client, char * Data, int Size)
    std::cout << Data << "\n";

int main(int argc, char* argv[])  
    std::string s;
    std::cin >> s;
    if(s == "server")
        Lacewing::EventPump pump;
        Lacewing::Server* server = new Lacewing::Server(pump);
        Lacewing::EventPump pump;
        Lacewing::Client* server = new Lacewing::Client(pump);

    return 0;  

If I have too, I can modify the Lacewing source code to use SSL. I just do not know how.

share|improve this question

closed as off topic by Tetrad May 14 '12 at 15:52

Questions on Game Development Stack Exchange are expected to relate to game development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

TLS/SSL is pretty complicated; I would advise you to use a third-party library for it. You might find one that can work on top of Lacewing, or you might need to find a new TCP library. It might not hurt to ask the Lacewing devs how to best add TLS support. – stephelton May 14 '12 at 3:34
This question is off topic for this site (as it's not game development specific), and you cross posted it to SO.… – Tetrad May 14 '12 at 15:52

Browse other questions tagged or ask your own question.