Re: Question regarding using AES in CTR mode to encrypt UDP
- From: Itay <itaydagani@xxxxxxxxx>
- Date: Tue, 02 May 2006 08:21:57 +0200
On 1 May 2006 12:49:13 -0700, tomstdenis@xxxxxxxxx wrote:
Itay wrote:
In his libtomnet, he is using AES-128 in CTR mode.
I am interested in encrypting/decrypting packet buffers which I then
sendto/recvfrom using UDP,
but in CTR mode I have a problem synchronising the counter of the CTR
mode (or the IV) -
in UDP packets might get lost, so the synchronization between counters
on both peers is lost as well, for example :
I'd use GCM or CCM mode to get authentication as well. [LTN uses
HMAC-SHA1 for that].
OK, I will check those out in your LTC manual, thanks :-)
As for handling out of order, the simplest method is
1. Reject old packets with a soft error
2. Accept packets from the future
Another way is to have a sliding window of upto 32 packets . As you
get newer packets you slide older ones off. E.g. if you get 2 then 1
that's ok but if you get 33 then 1 that will be too old and return a
soft error.
This solves the problem of knowing which sequence number to
accept\reject
when doing the authentication (anti replay), but how does it solve the
synchronization of the CTR counters (assuming I still want to use CTR,
and I need the exact same counters in order to reverse the encryption
on peer B and get the same plaintext that peer A had before he did the
encryption) ?
Could someone please help me in resolving this issue(one idea I had,
was to send the counter/IV with the encrypted
message, but that increases the packets, and I would like to avoid
it).
You have to make sure you're in sync when you start. After that you
should be ok.
Can you explain in a little more detail, thanks :-)
So, how can I use CTR mode to encrypt UDP traffic (or if I cannot use
it, what mode (CBC, CFB or other )is best
recommended for working with such a protocol as UDP (unreliable) ?
Why would CBC mode be better?
I didn't say it was better, my main question is :
can I use CTR when encrypting UDP ?
Tom.
- References:
- Question regarding using AES in CTR mode to encrypt UDP
- From: Itay
- Re: Question regarding using AES in CTR mode to encrypt UDP
- From: tomstdenis
- Question regarding using AES in CTR mode to encrypt UDP
- Prev by Date: I Wanted Some Feedback On A Cipher...
- Next by Date: Re: Question regarding using AES in CTR mode to encrypt UDP
- Previous by thread: Re: Question regarding using AES in CTR mode to encrypt UDP
- Next by thread: Re: Question regarding using AES in CTR mode to encrypt UDP
- Index(es):
Relevant Pages
|