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:

277 questions
188
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
  • 2,874
  • 5
  • 17
  • 28
76
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
  • 29,255
  • 58
  • 174
  • 263
41
votes
4 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…
CloudMeta
  • 39,869
  • 66
  • 178
  • 289
24
votes
1 answer

What is CPN in youtube video

The context menu which appears after RMB click has one option named Stats for nerds after which another menu appears on the left top corner. One of the parameter associated is CPN. What does that mean?
Shivam
  • 383
  • 1
  • 2
  • 8
21
votes
2 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