ModernUUID Icon ModernUUID
Module 03 / Secure Key & Secret Generator

Random Key, Secret & Token Studio

Generate enterprise-grade API keys, cryptographic hex salts, Base64URL bearer tokens, and Diceware passphrases with built-in screen share privacy masking.


Max 1024-bit

Generated Secret
🔒 Screen Share Privacy & Zero Log Assurance

When Mask Secret is toggled on, your sensitive credentials are obscured as •••••••• on your screen during video calls or demos. Pressing Copy Secret will still copy the full raw cryptographic plaintext directly into your secure system clipboard.

256-BIT HARDWARE ENTROPY & KEY MANAGEMENT

Enterprise API Secret Architecture & Cryptographic Token Design

W3C Web Cryptography API & RFC 4648 Compliant Base64 / Base64URL Encoding

Why Modern Platforms Mandate Structured API Key Prefixes

Industry leaders (including Stripe, GitHub, OpenAI, and Slack) have standardized on formatted, prefixed secret keys (e.g. sk_live_..., ghp_...). Prefixing solves three critical engineering problems:

🔍 Automated Secret Scanning

Static analysis tools (like TruffleHog and GitHub Secret Scanning) instantly detect leaked keys in public repositories using exact regex patterns.

🚦 Environment Isolation

Differentiating pk_test_ from sk_live_ prevents accidental test transactions from hitting production financial ledgers.

⚡ Routing Optimization

API gateways can inspect the key prefix to route requests to specific regional clusters without parsing the entire credential body.

Security Imperative: Web Crypto vs. Math.random()

⚠️ The Danger of Pseudo-Random PRNGs

Standard JavaScript Math.random() uses non-cryptographic PRNG algorithms (such as XorShift128+). An attacker observing a sequence of generated values can mathematically predict future outputs! Modern UUID strictly binds to window.crypto.getRandomValues(), pulling entropy directly from your host operating system's kernel hardware entropy pool.

Developer FAQ & Technical Reference

Frequently Asked Questions

Deep technical explanations covering identifier architecture, token security, cryptographic hashing, and zero-backend client execution.

JWT (JSON Web Tokens) & Auth

RFC 7519 Security
01. What is a JWT token, what does JWT stand for, and how does JWT work? +

JWT stands for JSON Web Token (pronounced "jot"), an industry standard defined under RFC 7519 for securely representing claims between two interacting parties as a compact, self-contained JSON object.

A JWT consists of three Base64URL-encoded strings separated by periods: Header.Payload.Signature.

  • Header: Specifies the metadata, including the token type and cryptographic signature or encryption cipher algorithm (such as HMAC SHA-256 or RSA/ECDSA).
  • Payload (Claims): Encapsulates domain-specific user assertions, permissions, and standard security timestamps (including sub for subject, iat for issued-at, and exp for expiration time).
  • Signature: A cryptographic evaluation generated by hashing the Header and Payload together using a private server secret or private key, preventing data tampering in transit.

On Modern UUID, our specialized client-side JWT engine parses, decodes, and validates these cryptographic signatures entirely within your browser sandbox—zero token strings or validation secrets are ever transmitted across external network sockets.

02. What is the difference between JWT authentication and authorization? +

While frequently interconnected within application security workflows, authentication and authorization enforce two structurally distinct security requirements:

  • Authentication (AuthN - "Who are you?"): The protocol of validating identity credentials. For example, verifying a submitted email and password combination against a database, and subsequently issuing an immutable, cryptographically signed JWT to represent that validated session.
  • Authorization (AuthZ - "What can you do?"): The verification of resource access privileges and action permissions. When an authenticated client transmits a JWT to an API gateway, the backend verifies the signature and parses internal authorization claims (e.g., "role": "admin" or "scopes": ["write:orders"]) before permitting route execution.

Because JWTs encapsulate validated authorization claims directly within the signed token body, backend microservices can execute stateless authorization verification locally without querying a relational database on every subsequent HTTP request.

03. What is an access token vs refresh token in token authentication? +

Modern OAuth2 and OIDC application security architectures mandate a dual-token strategy to balance seamless UX session continuity with rigorous defensive threat containment:

  • Access Token: A short-lived cryptographic credential (typically expiring between 15 minutes and 1 hour) transmitted inside network authorization request headers (Authorization: Bearer <token>) to gain immediate access to protected resource endpoints.
  • Refresh Token: A long-lived, securely sequestered cryptographic secret (lasting several days or months) utilized strictly to request a brand new Access Token from an identity authorization server whenever the prior access token naturally expires.

This separation minimizes attack surface vulnerability: if an in-memory access token is accidentally exfiltrated via network interception, its short expiry renders it useless within minutes. Meanwhile, long-lived refresh tokens remain safely quarantined in hardened vaults where they can be explicitly revoked by server admins.

04. Where should I store JWT tokens on the frontend: LocalStorage vs HTTP-only cookies? +

HTTP-only, Secure Cookies represent the architectural defense-in-depth standard for web client browser token persistence.

  • HTTP-only Cookies: Completely immune to Cross-Site Scripting (XSS) exfiltration attempts because standard DOM JavaScript cannot read, parse, or transmit cookie payloads via the document.cookie interface. Combining HTTP-only flags with SameSite=Strict configurations simultaneously eliminates Cross-Site Request Forgery (CSRF) vulnerability vectors.
  • LocalStorage & SessionStorage: Critically vulnerable to XSS exploitation. If a compromised third-party NPM dependency or malformed script injection executes within the application DOM, attackers can execute trivial harvesting routines via localStorage.getItem() to siphon active JWT session credentials to remote exfiltration servers.

Universal Best Practice: Store sensitive authentication tokens in HTTP-only, Secure, SameSite cookies for traditional web clients, and utilize transient in-memory state or OS native keychain vaults when engineering mobile web views or desktop wrappers.

05. Can a JWT be decrypted or read without the secret key? +

Yes, immediately and trivially. Standard JSON Web Tokens are cryptographically signed to prove authorship and prevent structural modification, but they are almost never encrypted.

The structural Header and Payload sections of a conventional JWT are simply transformed into textual readability using standard Base64URL encoding. Any user, intermediate proxy, or network observer who intercepts a standard JWT can instantly run Base64 decoding routines (using tools like Modern UUID's local client-side JWT decoder) to inspect every embedded user ID, email address, role assertion, and payload variable without possessing the server signing secret.

Critical Security Imperative: Never embed confidential credentials, database passwords, secret keys, or unencrypted personally identifiable information (PII) inside a standard JWT payload. If payload privacy across public channels is strictly required, implement JWE (JSON Web Encryption) protocols.

06. How do you invalidate or revoke a stateless JWT token? +

Because standard JWTs are architecturally stateless—meaning receiving servers verify token legitimacy purely via mathematical signature verification and expiration checking—a remote backend cannot inherently "delete" an issued JWT prior to its natural expiration timestamp (exp claim) without introducing targeted verification logic. Approved engineering patterns include:

  • Aggressive Short-Lived Expirations: Maintain access token TTL lifespans under 10 to 15 minutes, relying on rapid natural expiration to limit access persistence upon session termination.
  • Token Blacklisting (Denylisting): Persist revoked token unique identifiers (the jti claim) within an ultra-fast in-memory cache architecture (such as a Redis cluster) until their timestamp naturally expires. Every incoming API request verifies absence from the denylist.
  • Token Versioning (Generation Counters): Store an integer token generation counter (tv claim) within both the user database record and the signed JWT payload. When a user explicitly signs out or executes an emergency password reset, increment the database version counter—causing all legacy tokens carrying outdated numerical assertions to fail validation instantly.

Secure Tokens & Strings

OS-Level Entropy
01. What is the difference between a security token and an API token? +

While both represent machine-readable verification artifacts engineered to authorize digital transactions, their operational lifecycles and security scopes serve different architectural requirements:

  • API Token (API Key): An opaque, long-lived alphanumeric verification string issued directly to developers, applications, or downstream microservices to authorize programmatic system-to-system interactions. API keys function as persistent identity proxies for automated infrastructure and are typically configured within restricted server environment variables.
  • Security Token (Session / Auth Token): A short-lived, dynamic assertion artifact (such as an OAuth2 bearer token or OIDC identity JWT) issued directly to an end-user client following successful interactive authentication. Security tokens encapsulate detailed permission scopes and carry strict expiration constraints.
02. How long should a cryptographically secure API key or secret be? +

To establish mathematically infallible defense-in-depth against automated exhaustive offline dictionary and brute-force harvesting attacks, an enterprise API secret or verification token must maintain an unalterable floor of 128 bits to 256 bits of underlying entropic randomness.

  • Hexadecimal Representation: Achieving 256 bits of raw cryptographic entropy translates directly into a 64-character hexadecimal string (where each hex digit represents 4 bits of entropy).
  • Base64 / URL-Safe Alphanumerics: Utilizing high-density alphanumeric alphabets yields an ultra-compact 43- to 44-character verification token.

Architectural Best Practice: Always prefix operational API secrets with descriptive, plaintext environment designations (e.g., live_sec_, test_key_, or prod_auth_). This empowers automated GitHub secret scanners and enterprise DLP (Data Loss Prevention) engines to identify and revoke leaked credentials immediately without executing database evaluation lookups.

03. How do you generate a cryptographically secure random string in modern web browsers? +

Developers must strictly eliminate legacy computational functions like JavaScript's standard Math.random() when synthesizing authentication tokens, cryptographic nonces, or security keys. Standard math generators rely on deterministic pseudo-random number generators (PRNGs), which produce predictable numerical distributions that attackers can mathematically reverse-engineer by observing subsequent sequence outputs.

To achieve absolute cryptographic unguessability, modern web architectures must interface exclusively with the hardware-backed Web Crypto API using methods such as window.crypto.getRandomValues() or the native window.crypto.randomUUID() function:

  • Direct OS Kernel Entropy: The Web Crypto API bridges JavaScript runtimes directly into the host operating system's hardware-seeded kernel cryptographic entropy pools (utilizing interfaces such as /dev/urandom on Linux/macOS or the CNG Cryptography API on Windows).
  • Client-Side Sandbox Execution: On Modern UUID, our entire suite of random string generators, high-entropy key synthesizers, and bulk token generators harnesses these exact native browser APIs—guaranteeing that every random string is constructed entirely in your localized client memory with zero server latency or network eavesdropping vulnerability.

Ready to execute these cryptographic utilities locally?

Run multi-format UUID generators, JWT decoders, Bcrypt hashers, and Token synthesis engines inside your browser sandbox—zero server latency, total anti-interception privacy.