I'm implementing different applications that will use UDP to exchange real-time data, thus a low impact on performance is very important. This system will not be connected to the Internet so I just need a symmetric encryption mechanism and one option would be AES-128. I am googling a lot but I am not finding a lot of material about the combination of AES, UDP and C++, is it not used much? Any resources would be really appreciated!

Would DTLS be an appropriate choice for this case in this private LAN far away from the internet?

I've posted a similar question on Information Security SE with more details (after the answers here came in).

  • $\begingroup$ Handling your edit (and checking both profiles) I noticed you obviously created two accounts by accident. For your convenience, I've contacted the community team with a request to merge both accounts into one. $\endgroup$
    – e-sushi
    Commented Jul 8, 2018 at 2:31
  • $\begingroup$ You may want to read this help center page and merge your accounts if e-sushi's action hasn't fixed your problem (yet). $\endgroup$
    – SEJPM
    Commented Jul 9, 2018 at 11:45

2 Answers 2


Consider using Noise. If that's too heavy, consider using NaCl crypto_secretbox, at least.

Now that we've got that out of the way: Write down a design document that articulates what you're trying to enable the legitimate parties to achieve with what resources, enumerates the powers of an adversary, and identifies the security properties you hope to guarantee in the face of an adversary. Do this without mentioning cryptography! You need to be specific about what resources the adversary can subvert and how—read packets on the wire, replace them, act maliciously to peers in some way—and specific about what you want to guarantee they can't do in spite of those powers.

Then you can use that design document decide what cryptography to use to provide those security properties, and anyone else studying your system can use that design document to assess whether you did it sensibly. Simply putting the letters A-E-S or D-T-L-S in your application means approximately nothing other than that you used everyone's favorite pseudorandom permutation family or the unloved cousin of a protocol whose family gave us Heartbleed.


I agree with Squeamish Ossifrage, you should use either Noise Protocol Framework, or Signal Protocol library, or any other library/framework for encryption. But if you want implement your own crypto system, I think you should look on ECIES (Elliptic Curve Integrated Encryption Scheme). ECIES use AES or any other symmetric cipher and. Also ECIES use other crypto building blocks and this scheme is more secure than just one AES. You can encrypt an message and send this encrypted messaged by using UDP (or TCP).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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