Question regarding using AES in CTR mode to encrypt UDP
- From: Itay <itaydagani@xxxxxxxxx>
- Date: Mon, 01 May 2006 21:01:36 +0200
I am using libtomcrypt & libtomnet programmed by Tom St. Denis for my
university project.
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 have two peers A & B which both share the same key and the same IV.
each time, a buffer is encrypted, the IV (or counter) is incremented
by one, and that IV is used in the encryption process.
1. A has counter/IV with a value of 1, and so does B.
2. A encrypts a buffer using the shared key and counter/IV and sends
it to B, but it gets lost (UDP).
3. A now has a new buffer to encrypt and send, it uses the key and
counter/IV of 2 to encrypt, then sends the packet.
This time B gets it, and it uses the shared key and its counter/IV
to decrypt (actually it also encrypts) the buffer.
BUT, since B's counter/IV value is 1 (and not 2 as A's counter/IV
value), the output of the decryption (encryption)
process is totally different from the plain text A encrypted.
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).
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) ?
Thanks :-)
Itay
.
- Follow-Ups:
- Re: Question regarding using AES in CTR mode to encrypt UDP
- From: Joseph Ashwood
- Re: Question regarding using AES in CTR mode to encrypt UDP
- From: David Wagner
- Re: Question regarding using AES in CTR mode to encrypt UDP
- From: tomstdenis
- Re: Question regarding using AES in CTR mode to encrypt UDP
- Prev by Date: Re: Factoring problem, trivial?
- Next by Date: Re: Question regarding using AES in CTR mode to encrypt UDP
- Previous by thread: JSH: Now do you understand?
- Next by thread: Re: Question regarding using AES in CTR mode to encrypt UDP
- Index(es):
Relevant Pages
|