Cryptographic Nonce Generator
ガイド
Cryptographic Nonce Generator
Generate cryptographically secure nonces (numbers used once) for CSP headers, OAuth state parameters, CSRF tokens, session IDs, and more. Uses crypto.getRandomValues() for true randomness — no Math.random() fallback. Output in hex, Base64, Base64url, or decimal array format. Everything runs in your browser; nothing is sent to any server.
使い方
Select a byte length (8, 16, 24, 32, or 64 bytes, or enter a custom length), choose your output format (hex, Base64, Base64url, or decimal array), and set how many nonces to generate. Values generate automatically as you change settings. Copy individual nonces or use the pre-formatted usage examples that auto-populate with your generated nonce for CSP headers, HTML script tags, OAuth state parameters, CSRF tokens, and session cookies.
特徴
- Cryptographic Randomness — Uses crypto.getRandomValues() exclusively. No Math.random() fallback. Produces cryptographically secure random bytes from the OS entropy source.
- 複数の出力形式 — Hex (lowercase), Base64 (standard), Base64url (URL-safe, no padding), and decimal byte array. Each format suited for different use cases.
- Configurable Byte Length — Preset lengths (8, 16, 24, 32, 64 bytes) or custom. Entropy display shows bits of randomness (bytes × 8).
- バルク生成 — Generate up to 100 nonces at once, each with individual copy button.
- Usage Examples — Pre-formatted code snippets auto-populated with your nonce: CSP header, HTML script nonce attribute, OAuth state parameter, CSRF hidden input, and session cookie.
- Entropy Display — Shows bits of entropy for the configured byte length so you can verify your nonce meets security requirements.
- 100% クライアントサイド — Nothing leaves your browser. No server requests, no logging. Your nonces stay private.
What is a Nonce?
A nonce (“number used once”) is a random value that should only be used a single time. In cryptography and web security, nonces prevent replay attacks, cross-site scripting (XSS), and request forgery. The key requirement is unpredictability — an attacker must not be able to guess the nonce value, which is why cryptographic randomness (not pseudo-random) is essential.
What is the difference between a nonce and a random token?
Why not use Math.random() for nonces?
How many bytes should my nonce be?
What is Base64url and when should I use it?
恵 スコアボードが到着しました!
スコアボード ゲームを追跡する楽しい方法です。すべてのデータはブラウザに保存されます。さらに多くの機能がまもなく登場します!
