Questions tagged [nonce]

A nonce, short for “number used once”, is a random number used to sign a message in client-server communication. The HTML “nonce” attribute is used as part of Content Security Policy feature in browsers.

See also:

347 questions
240
votes
1 answer

What’s the purpose of the HTML "nonce" attribute for script and style elements?

W3C says there is a new attribute in HTML5.1 called nonce for style and script that can be used by the Content Security Policy of a website. I googled about it but finally didn't get it what actually this attribute does and what changes when using…
ata
  • 3,398
  • 5
  • 20
  • 31
85
votes
5 answers

How to create and use nonces

I am running a website, and there is a scoring system that gives you points for the number of times you play a game. It uses hashing to prove the integrity of http request for scoring so users cannot change anything, however as I feared might…
Malfist
  • 31,179
  • 61
  • 182
  • 269
42
votes
5 answers

What's the point of a timestamp in OAuth if a Nonce can only be used one time?

I had at first misinterpreted the timestamp implementation of OAuth into thinking that it meant a timestamp that was not within 30 seconds past the current time would be denied, it turned out this was wrong for a few reasons including the fact that…
MetaGuru
  • 42,847
  • 67
  • 188
  • 294
39
votes
4 answers

How to generate a nonce in node.js?

I need to generate a nonce (number generated only once) to remove the CSP rule 'unsafe-inline' and all the trusted URLs for scripts, improving the CSP score. Thus I need to have in the HTML