Reputation: 259
I am implementing a decrypting mix-net in C using OpenSSL.
I have encrypted the data using EVP_SealInit, EVP_SealUpdate, and EVP_SealFinal. I would then like to transfer this data over TCP to an open port (the first "mix").
Is EVP_SealInit, etc. the best way to go about encrypting a message string to be sent over TCP?
And if that's the case, how do i transfer the IV over this connection? I mean: i can think of a few ways, but i guess i don't see the point of having an IV if i'm just going to transmit it with the message. Is it possible to set the IV to some value, such as all zeroes? How would i go about doing that?
I'm happy to post code if it helps.
Upvotes: 1
Views: 380
Reputation: 982
You need something that you can call a protocol. In its terms you will know when to send a data, when to send an IV, etc.
IV can also be zero if your session key is random each time (EVP_Seal... provides that).
Upvotes: 1