<div dir="ltr"><div class="gmail_default" style="font-size:small">So I am having the following think.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">First off, before I get started, I plan to use OCB to encrypt packets. No GCM or even GCM-SIV in sight.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I am writing a very small scale scheme for use on a UDP based presence service. I am not concerned about traffic analysis at this point, I will add an obfustification layer later on. Same for rekeying the connection, just starting things off with a Kerberos like scheme.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Messages to the service are prefixed by a token currently 8 bytes in length which specifies the client endpoint device. I am considering changing that to:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">DeviceID (8 bytes)</div><div class="gmail_default" style="font-size:small">CurrentTime (8 bytes) [in ticks)</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">So how about bundling those up and using them as the IV for encrypting the packet with OCB?</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Alternatively, if folk get worried about the possibility someone use GCM by 'mistake', could do:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><div class="gmail_default">DeviceID (4 bytes)</div><div class="gmail_default">Counter (4 bytes)</div><div class="gmail_default">CurrentTime (8 bytes) [in ticks)</div><div class="gmail_default"><br></div><div class="gmail_default">While a service could serve more than 4 million connected clients in theory, the protocol is designed to allow use of multiple services...</div><div class="gmail_default"><br></div><div class="gmail_default"><br></div><div class="gmail_default">So the reason I am finding including the time in this scheme attractive is that it provides a lightweight means of preventing replay attacks outside an arbitrarily narrow time window. The presence service also provides NTP like synchronization.</div><div class="gmail_default"><br></div><div class="gmail_default">If the timestamp is tampered with, the IV will be changed and decryption/authentication of the message will fail. That is not necessarily the only replay attack prevention I intend to use but it is part of it.</div><div class="gmail_default"><br></div><div class="gmail_default">What do folk think? Good idea or not?</div></div></div>