DaveField

The Satellite-Field Cipher

A single number of a few dozen digits defines a vast, uniquely reproducible landscape of prime pairs. This page turns that landscape into a keystream, gives the reference code, and shows the analysis — including a candid account of what it is not. It is best understood not as a rival to standard encryption but as an instrument that happens to be unpredictable.

The object

Fix a midpoint M. Its satellite field is the set of radii d for which both M − d and M + d are prime — a mirrored pair of primes reflected about M. Each such radius is one object in the field. The field is deterministic given M, finite (it terminates near d = M), and unique: two different midpoints produce fields with no measurable correlation between them.

Crucially the field is randomly accessible. Because prime pairs near any radius can be found directly by testing, you can begin enumerating at radius 1012 or 1040 without walking there from zero. The key is therefore a location in the landscape — the pair (M, x) — not merely a number.

From field to keystream

Take the consecutive gaps between objects in a window of the field, and compare gaps in disjoint pairs:

bit i = 1 if gapa > gapb, else 0  —  ties (equal gaps) are dropped.

The comparison can be between the two halves of a window (a palindrome), between adjacent gaps, or across two windows started at different radii. All rest on the same idea: within a region where the prime density is effectively constant, two gaps are taken to be exchangeable — equally likely to fall either way. Under that assumption the comparison is unbiased by symmetry, with no whitening step required. Exchangeability is not guaranteed a priori: radial density variation, dependence between nearby gaps, and the window construction could all in principle disturb it. It is therefore a claim to be tested, not a theorem — and the measurements below found no departure from it over the range examined.

The bit is a comparison, never a gap magnitude. This matters: emitting gap sizes would expose each object's residue modulo small primes and allow the midpoint to be reconstructed almost instantly. A sign comparison exposes no such residue.

Probability that an earlier gap exceeds a later one, plotted against their separation, sitting on 0.5 at every separation.
The keystream bit is unbiased at every separation between compared gaps. P(earlier gap > later gap) sits on 0.5 from adjacent gaps out to a separation of 50,000 on this 20-digit field — empirical support for the exchangeability assumption, not a proof of it.

Reference implementation

pfxor2.py is a constant-memory, parallel generator. The key is (M, x); the window is sized from the payload and reproduced on decryption, so nothing but the key need be shared. The keystream is XORed with the file, so the same command encrypts and decrypts.

# encrypt
py pfxor2.py plaintext.jpg cipher.bin -m "10**30+61" -x "10**12" --meta run.json

# decrypt (identical command, files swapped)
py pfxor2.py cipher.bin recovered.jpg -m "10**30+61" -x "10**12"

−m and −x accept plain decimals or Python expressions. The tool prints the radius range it consumed and warns if the combined keyspace falls below 100 bits or if the window strays into the field’s outer skin.

Download pfxor2.py Download pfxor.py (simple version)

Keyspace and scale

The key (M, x) draws entropy from both parts, and the search over them is joint — a wrong midpoint makes every radius wrong. A 20-digit midpoint yields approximately 122 bits of combined search space (66 from M, 56 from the radius after discounting hit-spacing) — approaching the scale of AES-128 but not matching it. A larger midpoint raises both figures; see the note on quantum resistance below. The same midpoint holds roughly 3.5 petabytes of keystream before the field is exhausted, so a single M is effectively inexhaustible.

Field capacity scales as M / ln²M and keyspace as roughly 2 log⊂2 M — both driven by the same parameter. There is no awkward regime where one is adequate and the other is not. Twenty digits is a natural operating point: strong key, vast field, and small enough that primality tests fit in machine words.

Analysis

An all-zeros file was encrypted with a randomly chosen 20-digit midpoint, so the ciphertext is the raw keystream. It was then regenerated independently on separate hardware from the key alone — byte-for-byte identical — and subjected to a statistical battery over its 65,528 bits.

TestResultp-value
Monobit frequencypass0.52
Block frequency (128-bit)pass0.56
Runspass0.03
Longest run of onespass0.83
Cumulative sumspass0.47
Approximate entropy (m=8)pass0.70
Byte distribution (χ²)pass0.72
Autocorrelation (lags 1–32)pass0.54

Byte entropy was 7.979 of 8 bits — exactly the value a random sample of this size should give — and both zlib and lzma expanded the file, as incompressible data does.

Cumulative sum of the keystream forming a random walk that stays near zero.
The running sum of the keystream (mapping 0→−1, 1→+1) shows no statistically detected drift and remains within the range of excursion expected for a random walk of this length.

What this does and does not establish

Passing a statistical battery demonstrates the absence of crude bias. It is the weakest thing that could be true, and it is not evidence of security. A known attack against a related construction — one that reconstructs the midpoint from emitted gap magnitudes — would also pass every test above, because it exploits structure rather than bias. This cipher withholds magnitudes precisely to close that route, but the deeper question — whether the sequence of sign comparisons can be inverted to recover the midpoint — is open. No one has answered it, and until someone tries hard and fails, this is a research object, not a deployable cipher.

Possible roles, if the construction survives analysis

Honestly appraised, this is far slower than AES and occupies the same functional slot as a stream cipher. Its merit is not throughput. The following are research directions rather than present recommendations — each is a high-value setting in which an unanalysed cipher should not yet be trusted, listed to show where the object might one day fit rather than where it belongs today:

The most durable outcome is not the cipher but the question it poses: how much of a midpoint’s identity is recoverable from its satellite field? That is a genuinely novel question about the primes, and it is a better one than whether this makes a good stream cipher.

The construction and analysis on this page were developed in a working collaboration between the author and AI systems — the “AI and I” method described elsewhere on this site. The reference code is provided as-is, for study and attack rather than for protecting anything that matters.