Hi, All.<br>
<br>
I've modified enet to implement encryption.&nbsp; I use the Block TEA
algorithm (supposedly decent, in the public domain, and very simple to
implement).&nbsp; 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.&nbsp; Both sides must have the 128-bit key.&nbsp; Right now it has
the following features:<br>
<br>
- encryption is flagged per packet (using the new ENET_PACKET_FLAG_ENCRYPTED enum)<br>
&nbsp; 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:
&quot;enet_uint32&nbsp;&nbsp;
TEAKey[4];&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/**&lt; 128-bit key for the BlockTEA */&quot;)<br>
&nbsp; 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>
&nbsp; &quot;int enet_packet_append (ENetPacket * packet, const void * addData, size_t addMsgLength)&quot;<br>
&nbsp; which adds data to the packet internally while resizing it for you.&nbsp; Encryption has to happen on a 4-byte block, <br>
&nbsp; 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>
&nbsp; buffer size.&nbsp; 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^)?&nbsp; I'd like some
volunteers to help me test this (it might be foolish to add it to the
CVS as is).&nbsp; 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.