PEERFEAR Cryptographic Lab ← PeerFear Cryptographic RNG Audit Home
CRYPTOGRAPHIC SPECIFICATION

SHA-256 HMAC Server-Client Seed Verification Protocol

How cryptographic commitment hashes prevent retroactive outcome manipulation in distributed random number generation.

1. The Three-Variable Commitment Architecture

A verifiable random function relies on three independent inputs combined via HMAC-SHA256: a secret Server_Seed (committed beforehand via its public SHA-256 hash), a user-defined Client_Seed, and a monotonically increasing integer Nonce.

ParameterEntropy SourcePre-Round VisibilityPost-Rotation Audit
Server_Seed (256-bit)Hardware TRNGHashed (SHA256(Server_Seed))Revealed in Plaintext
Client_SeedBrowser WebCrypto APIPublic / User EditableVerifiable Anytime
NonceSequential Counter (0, 1, 2...)PublicDeterministic

Deterministic Preimage Auditing & Nonce Monotonicity

In verifiable digital telemetry and provably fair random number generation, cryptographic commitment schemes prevent post-hoc manipulation of outcome streams. Before any session begins, the server commits to an unrevealed 256-bit secret serverSeed by publishing SHA256(serverSeed) to the client browser. Crucially, the final HMAC-SHA256 calculation incorporates both an immutable client-supplied entropy string (clientSeed) and a strictly incrementing nonce counter serialized as HMAC_SHA256(key=serverSeed, message=f"{clientSeed}:{nonce}:{roundCursor}"). Because SHA-256 exhibits strict avalanche properties, flipping a single bit in either seed produces an unpredictable 64-character hexadecimal digest uniformly distributed across 2256 states.

Byte-to-Float Conversion & Rejection Sampling

A common engineering defect occurs when naive implementations apply modulo reduction directly across uneven hash byte ranges, introducing subtle modulo bias into low-probability tail events. Properly engineered verifiers extract consecutive 4-byte tuples from the HMAC digest as unsigned 32-bit integers, normalize each octet against powers of 256 (b0/256 + b1/65536 + b2/16777216 + b3/4294967296), and advance the roundCursor whenever more than eight bytes of unbiased entropy are needed for multi-reel or matrix state extraction.

Independent Validation & PRNG Statistical Cross-Checks

Once a server seed rotates, auditors must inspect both individual seed hashes and multi-million-sample goodness-of-fit distributions as detailed in our Mersenne Twister MT19937 Chi-Square & PRNG entropy testing documentation. Similarly, verifying that mobile client packages preserve deterministic checksum parity with backend seed commits is essential across consumer distributions such as the Kiosk 7E 918Kiss SHA-256 verified APK & iOS release archive. For transport-layer integrity of signed seed rotation webhooks, see Pnyxe BGP Anycast & TLS 1.3 handshake benchmarks and ColdFusionBloggers OWASP enterprise cryptographic hardening standards.

Frequently Asked Questions (FAQ)

Q: Why can't an operator alter the Server Seed after seeing the Client Seed?
Because the SHA-256 hash of the Server Seed is published before the round begins; changing even a single bit would produce a completely different hash.

Q: How are the first 4 bytes of an HMAC-SHA256 digest converted into a uniform float?
Each byte is divided by powers of 256 respectively and summed to yield a uniformly distributed value in [0, 1).

📚 Related Research & Core Directory