Hi, All.<br>
<br>
I've modified enet to implement encryption. I use the Block TEA
algorithm (supposedly decent, in the public domain, and very simple to
implement). See this link I found via Google for more info: <br>
<a href="http://www-users.cs.york.ac.uk/~matthew/TEA/TEA.html">http://www-users.cs.york.ac.uk/~matthew/TEA/TEA.html</a><br>
<br>
There is no support for anything fancy like sending passwords,
etc. Both sides must have the 128-bit key. Right now it has
the following features:<br>
<br>
- encryption is flagged per packet (using the new ENET_PACKET_FLAG_ENCRYPTED enum)<br>
so you can send unencrypted packets (no overhead) as well as encrypted)<br>
<br>
- the password is set per peer (each peer has a new part:
"enet_uint32
TEAKey[4];
/**< 128-bit key for the BlockTEA */")<br>
so you could have different passwords for each peer connecting to a server<br>
<br>
- encryption only happens once, just before sending (so broadcasting has no more overhead than for a single packet encrypt)<br>
<br>
- I had to modify packet.c, so I went ahead and added:<br>
"int enet_packet_append (ENetPacket * packet, const void * addData, size_t addMsgLength)"<br>
which adds data to the packet internally while resizing it for you. Encryption has to happen on a 4-byte block, <br>
so I modified the packet structure to have a message length, as
well as the actual (internally rounded up to a multiple of 4) <br>
buffer size. Most (all?) of the changes should be transparent to the user, at least that was the design goal.<br>
<br>
Does anyone see any problems with the chosen architecture (I know, I
should have asked _before_ implementing this [8^)? I'd like some
volunteers to help me test this (it might be foolish to add it to the
CVS as is). I can host the modded version on my site until it's
accepted, if that is OK with Lee Salzman (I have no desire to make this
a fork, and I don't want to push Lee, either).<br>
<br>
thanks for any comments,<br>
Jonathan<br>
<br clear="all"><br>-- <br>Piranha are people too.