High-Entropy, Unguessable Token Design

System Prompt Canaries utilize unique, random, high-entropy strings that legitimate users are statistically unlikely to ever input, ensuring that any appearance in output unequivocally signals an attack.

The top 3

  1. Leading Sources for High-Entropy Token Generation: Truly unguessable tokens rely on high-quality randomness from sources like True Random Number Generators (TRNGs) that exploit physical phenomena (e.g., thermal noise) and Cryptographically Secure Pseudo-Random Number Generators (CSPRNGs) seeded by these unpredictable sources.
  2. Essential Metrics for Evaluating Token Randomness: Token unguessability is measured by entropy bits, with OWASP recommending at least 64 bits for session IDs and 128 bits for custom CSPRNG-generated IDs. Statistical randomness tests, like those in Burp Sequencer (e.g., FIPS monobit, runs, character distribution), also assess deviation from true random behavior.
  3. Common Pitfalls in Unguessable Token Design: Frequent design errors that compromise token unguessability include insufficient length (e.g., less than 128 bits for critical applications), reliance on weak pseudo-random number generators (PRNGs), predictable patterns (e.g., sequential IDs, timestamp-based generation), and improper seeding of random number generators.

Sources

Open the full topic