Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

one way authentication what does timestamp and nonce mean?

http://technet.microsoft.com/en-us/library/cc767123.aspx

in this article the client encrypts a timestamp , nounce and destination identity to the destination. I cannot understand what timestamp does here and what is a nounce ?

like image 334
user581734 Avatar asked Jan 20 '11 18:01

user581734


1 Answers

Both timestamp and nonce are ways to prevent a man in the middle attack on an authentication mechansim. They work slightly differently, but the intent is the same - to provide a peice of data that is cryptographically built into the authentication mechanism that would make it difficult or impossible for an attacker to attack the system by replaying the message. A typical mechanism is authentication via digital signature. In either case, here's the steps:

1 - make message, attach timestamp or nonce to message

2 - hash both the message and the timestamp or nonce

3 - encrypt the hash with the private key (ie, sign it)

4 - send signature and message and nonce/timestamp

(this is the point at which the attacker gets a hold of it.

5 - recipient gets message.

6 - recipient checks that the signature matches the sent data (repeat step 2, decrypt signature with public key, compare to hash)

7 - recipient checks timestamp or nonce:

a - check timestamp - the value of the timestamp must be within an acceptable range of the current time. Ideally, the whole system is served by a timestamp server that defines to a tight precision what the "current time" is. If not, the system risks false negatives where the recipient incorrectly decides that the message time stamp is too old (or hasn't yet occured) do to a current time mismatch.

b - check nonce - verify that the nonce that was received has never before been received from this sender. Since the hash is unique to the contents of the message, this message MUST have come from the authorized sender, because this message is not being replayed.

8 - recipient performs any further authorization and access control checks.

The important things are:

  • either the timestamp or the nonce MUST be part of the signature
  • the timestamp is good if you are concerned about replay within a given time, but it requires good synchronization between servers and it will always assume some spectrum of error as many messages may be sent in a current spectrum of time - for example, if the timestamp is down to the second, then multiple message (including replays) could be sent in that second.
  • the nonce requires some level of persistence, since it only works if uniqueness is guaranteed and checked. Also, if the man in the middle can interrupt the sender, get the nonce, and keep the sender from sending it, the man in the middle attack could still be successful.
like image 89
bethlakshmi Avatar answered Oct 24 '22 15:10

bethlakshmi