# Reproducible Hill decryption audit

## Scope

This audit derives a 4-by-4 integer matrix from the preserved
`nothingisrandom.txt` digit recovery and applies it directly to every
four-letter vector in the canonical `themessage.txt` body. It has no
network or package dependency.

The script verifies file hashes and deterministic outputs; it does not
itself perform OpenPGP verification. See
`archive/gaps/seed-01-themessage-and-nothingisrandom-recovery.md` for
the reconstructed-signature provenance and the limitation on the digit
string's surviving signature armor.

## Inputs

- Ciphertext: `archive/gaps/seed-01-themessage-body-6448.txt` (6448 uppercase letters)
- Ciphertext SHA-256: `50bd9c4424db47e15cc3a543c379b6ec722c8eaed76fbaeef738b0427d4e8e75`
- Digit recovery: `archive/recon/web-archives/ARTIFACT-nothingisrandom-digit-string-1422.txt`
- Full source SHA-256: `04ee148915015d5f1e825d34685b4eab61e1a6c136d98db447499243f3cfd9cd`
- Extracted 1,422-digit line SHA-256: `450a60bce6f2827972f22662b2abcf4112d9a4e45218aa6bf0b5d48aec48492f`

## Bitmap and key extraction

Each `0` expands to one `1` bit; each non-zero decimal digit expands to
that many `0` bits. The resulting 3,151 bits reshape to 137 rows by 23
columns. The number block is read as four groups of four vertical five-bit
integers; the following marker row has `1111` beneath every group.

| Bitmap rows (1-based) | Columns (1-based) | Vertical bit strings | Values |
|---|---|---|---|
| 131-135 | 3-6 | 00001 00011 00111 01111 | 1 3 7 15 |
| 131-135 | 8-11 | 00110 00010 01110 00101 | 6 2 14 5 |
| 131-135 | 13-16 | 01000 01100 10111 10001 | 8 12 23 17 |
| 131-135 | 18-21 | 01001 10000 00100 01011 | 9 16 4 11 |

Derived matrix:

```text
   1  3  7 15
   6  2 14  5
   8 12 23 17
   9 16  4 11
```

Its ordinary determinant is `12375`; modulo 26 it is `25` and has inverse `25`. The matrix inverse modulo 26 is:

```text
  24 11 14 21
   1  9 17 25
  12 17 17  4
  10 19 12 16
```

## Cipher convention

For each ciphertext column vector `c = (c1,c2,c3,c4)^T`, with `A=0`
through `Z=25`, the reproduced plaintext vector is `p = A c (mod 26)`.
The operation is direct: the extracted matrix is used as the decryption
transform, while the displayed modular inverse is checked only to establish
invertibility.

## Output checks

- Plaintext length: `6448`
- Plaintext SHA-256: `a2ccb52f5a840115ac5bd0752501f1ed1081e15663b6f33fb992a9954cd08b1f`
- Prefix check: `ITSTIMETOGIVEYOUOTHERDETAILSOFOURINTERVENTION`
- Suffix check: `THISWASOURGOALYOUMUSTUNDERSTANDONETHINGNOTHINGISRANDOMTOGETTHENEXTINSTRUCTIONSVISITBITLYAABBBCCCC`
- Raw plaintext output: `solution/themessage-hill-plaintext.txt`

The output is an unspaced uppercase English manifesto and ends in the
instruction `VISITBITLYAABBBCCCC`. The audit proves the deterministic
transformation and its output; it does not validate any real-world claims
made by that text.

## Run

```powershell
python scripts/audit_hill_decryption.py
```
