encryption - Best practices for encrypting continuous/small UDP data -


I am getting an application where I have to send many small data per second through the network using UDP . The app needs to send data in real time (do not wait). I want to encrypt these data and insure what I am doing is as safe as it is.

Since I am using UDP, there is no way to use SSL / TLS, so I have to encrypt every packet alone because the protocol is non-convincing / unreliable / irregular.

Right now, I am using a 128-bit key from passphrase to the user, and in ABC (PBS using AES-CBC) in CBC mode. I decided to use a random salt with a passphrase to get a 128-bit key (to stop the dictionary attack on passphrase), and of course IS (to stop statistical analysis for packets).

Although I am concerned about some things: Each packet contains small amounts of data (such as some of the integer values ​​per pack), which make the encrypted packet weak for known text attacks (Which will make it easier to circumvent the key) Also, since the encryption key has been received from the passphrase, less space will decrease (I know that salt will help, but once I have to send salt through the network and no one can get it). Given these two things, anyone can smell and store the sent data, and try to crack the key. Although this process may take some time, once the key is broken, all the stored data will be decrypted, which will be a real problem for my application.

So my question is, what is the best practice to send / encrypt continuous small data using a connectionless protocol (UDP)? Is this the best way for me? Was streaming? Overkill ...

Please note that I am not asking for a 100% safe solution, because there is no such thing.

You have several options, you can use DTLS, which is an appetite of TLS for Datagram The version is. It is specified in one and has been implemented in the openssl library. You can also use the IKE / IPsec protocol and you can use an UDP encapsulation of IPsec part. Usually the IPS is available at the OS level. You can also use it, which appears to be a hybrid of TLS and a proprietary UDP-based packet encryption protocol for key exchange.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -