Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between a "nonce" and a "GUID"?

Tags:

security

guid

This question here is about creating an authentication scheme. The accepted answer given by AviD states

Your use of a cryptographic nonce is also important, that many tend to skip over - e.g. "lets just use a GUID"...


Which leads me to my question. Why wouldn't you just use a GUID?

like image 511
Michael Shnitzer Avatar asked Jul 11 '10 03:07

Michael Shnitzer


People also ask

What is the main purpose of a nonce?

A nonce in cryptography is a number used to protect private communications by preventing replay attacks. Nonces are random or pseudo-random numbers that authentication protocols attach to communications.

Can a nonce be used more than once?

Nonce in cryptography means “number once,” and this arbitrary number is only used one time in a cryptographic communication. A nonce often includes a timestamp, which means it is only valid during a specific amount of time, to help ensure that it is only used once.

How big should a nonce be?

The nonce should have sufficient length, aim for at least 128 bits of entropy (32 hex characters, or about 24 base64 characters). Script tags that have a nonce attribute must not have any untrusted / unescaped variables within them.

What is a nonce token?

Nonce is a randomly generated, cryptographic token used to prevent the theft of user name tokens used with SOAP messages. Nonce is used with the basic authentication (BasicAuth) method.

What is the length of a nonce?

What Is a Nonce? "Nonce" is a portmanteau of "number used only once." It is a four-byte number added to a hashed—or encrypted—block in a blockchain that, when rehashed, meets the difficulty level restrictions. The nonce is the number that blockchain miners are solving for.


1 Answers

Whenever you randomly generate a random number intended to be used in cryptography, you should be really sure that the number is really random. GUIDs tend to be generated based on values that can be discovered, guessed or inferred, such as current system time or a network card MAC address, and thus the nonce could potentially be guessed.

like image 96
nlawalker Avatar answered Sep 20 '22 19:09

nlawalker