Recursive Random Number Generator Using Prime Reciprocals
A recursive random number generator using prime reciprocals is described.
đĄ Research Summary
The paper investigates the use of prime reciprocal sequencesâcommonly called dâsequencesâas the basis for a new class of recursive random number generators (RNGs). A dâsequence is obtained by expanding the reciprocal of a primeâŻpâŻ(1/p) in a chosen radix and extracting its digits. In binary, the sequence can be generated by the simple recurrence a(i) = 2^i modâŻpâŻmodâŻ2. When 2 is a primitive root moduloâŻp, the period of the binary dâsequence reaches its theoretical maximum ofâŻpâŻââŻ1; the second half of the period is the bitwise complement of the first half, giving a balanced distribution of 0s and 1s.
Although dâsequences are easy to generate, a single sequence is insecure for cryptographic purposes because knowledge of roughly logââŻpâŻbits of the output suffices to reconstruct the whole sequence. To overcome this limitation, the author proposes combining two or more dâsequences using moduloâ2 addition (XOR). Each component sequence is derived from a different prime (pâ, pâ, âŚ) and a seedâŻSâŻthat is relatively prime to all chosen primes. The basic construction is:
a(0) = (S modâŻpâ modâŻ2) â (S modâŻpâ modâŻ2)
a(1) = (S² modâŻpâ modâŻ2) â (S² modâŻpâ modâŻ2)
a(2) = (Sâ´ modâŻpâ modâŻ2) â (Sâ´ modâŻpâ modâŻ2) âŚ
If both component sequences are maximalâlength, the period of the XORâcombined output is theoretically lcm(pââŻââŻ1,âŻpââŻââŻ1). In practice the period may be a divisor of this value because the chosen primes need not both make 2 a primitive root, and the seedâŻSâŻmay not be a primitive root for either modulus. To increase nonâlinearity and further obscure the period, the author suggests raising the exponent for the second component by a factorâŻk, yielding:
a(0) = (S modâŻpâ modâŻ2) â (S^k modâŻpâ modâŻ2)
a(1) = (S² modâŻpâ modâŻ2) â (S^{2k} modâŻpâ modâŻ2) âŚ
ChoosingâŻkâŻdifferent from 1 makes the two streams evolve at incommensurate rates, which typically reduces the overall period below lcm(pââŻââŻ1,âŻpââŻââŻ1) but makes prediction substantially harder.
For security, the paper recommends selecting primes congruent toâŻ3âŻ(modâŻ4) and, optionally, using composite moduli (products of primes) instead of single primes. This ties the difficulty of recoveringâŻSâŻor the moduli to classic hard problems such as the quadratic residuosity problem. The construction also allows dynamic changes ofâŻSâŻorâŻkâŻduring operation, providing additional entropy.
The author further argues that any finite binary sequence can be expressed as a rational number, showing that linear feedback shift register (LFSR) sequences are a special case of dâsequences. Conversely, dâsequences are more general because they can represent any rationalâbased sequence, though not all dâsequences can be efficiently realized by LFSRs.
Practical implications are discussed: the ability to tailor the period to any desired length makes primeâreciprocal based generators attractive for communication systems (e.g., spreadâspectrum codes), cryptographic protocols, and MonteâCarlo simulations where specific statistical properties are required. The generatorâs simplicityârequiring only modular exponentiation and XORâmakes it suitable for hardware implementation, while the flexibility in choosing primes, seeds, and exponent multipliers offers a wide design space for balancing performance, period length, and security.
In summary, the paper presents a novel recursive RNG architecture that leverages the arithmetic properties of prime reciprocals, introduces nonâlinearity through XOR of multiple dâsequences, and provides mechanisms (choice of primitive roots, composite moduli, exponent scaling) to control period and enhance cryptographic strength. This approach offers a compelling alternative to traditional linear generators, especially in applications where custom period lengths and easy hardware realization are valuable.
Comments & Academic Discussion
Loading comments...
Leave a Comment