The 55-Character Seed
Relevant source files
The following files were used as context for generating this wiki page. Note: The project repository contains only two primary source files. The analysis is based entirely on them.
The 55-character seed is the primary output of the qib13 system. It is a string of 55 lowercase letters (a-z) that deterministically encodes a 13-character "generator code". This process is governed by a user-provided "master seed", which ensures that the encoding is both reproducible and cryptographically secure. The purpose of the 55-character seed is to provide a reliable and recoverable representation of the simpler, more memorable generator code.
The system can generate multiple "Encoding Systems" from a single master seed, including one "original" system and several "deviation" systems. Each system will produce a different 55-character seed for the same generator code, adding a layer of security and redundancy. The recovery process can sequentially test a seed against all generated systems until the original 13-character code is successfully retrieved.
Sources: README.md:10-15, README.md:50-53, index.html:619-622
Seed Generation Process
The generation of a 55-character seed is initiated with a 13-character generator code and the selection of an encoding system. The process transforms the generator code into a 55-character permuted string containing the original message and error-checking parity information.
Sources: README.md:126-132, index.html:594-633
Generation Flow
The following diagram illustrates the high-level data flow for generating a seed.
This diagram shows the transformation from a 13-character generator code to the final 55-character seed.
Sources: index.html:518-530, index.html:532-548
Key Functions
| Function | Description | Source File |
|---|---|---|
generateSeed() | Main UI function to trigger seed generation based on selected mode. | index.html:594-633 |
EncodingSystem.generateSeed() | Class method that calls the appropriate generation logic based on system type. | index.html:499-505 |
generateSeedOriginal() | Encodes the generator code using the 'original' system rules. | index.html:518-530 |
generateSeedDeviation() | Encodes the generator code using the 'deviation' system rules. | index.html:532-548 |
matrixVectorMultiplyMod26() | Performs matrix-vector multiplication over a modulo 26 field to generate parity. | index.html:580-589 |
applyPermutation() | Scrambles the codeword using a deterministically generated permutation map. | index.html:590-593 |
Sources: index.html
Seed Structure
Before the final permutation is applied, the seed exists as a 55-element numeric "codeword". This codeword's structure depends on whether an 'original' or 'deviation' encoding system was used. In both cases, it begins with the 13 numbers representing the generator code, followed by parity information.
Sources: index.html:525-526, index.html:544
Codeword Composition
This diagram shows the composition of the 55-element codeword for both system types before permutation.
Sources: index.html:525-526, index.html:544-546, README.md:43-45
The key difference lies in the parity data:
- Original System: Uses one
42x13matrix (P) to generate a single 42-element parity block. - Deviation System: Uses two matrices,
15x13(P1) and27x13(P2), to generate two separate parity blocks (15 and 27 elements, respectively).
Sources: index.html:770-771, index.html:780-782
Seed Recovery Process
Recovery is the process of extracting the original 13-character generator code from a 55-character seed. It is essentially the reverse of the generation process and requires the same master seed to reproduce the exact encoding systems for validation.
Sources: README.md:134-140, index.html:635-710
Recovery Flow
The system can attempt recovery with a specific system or sequentially try all available systems until a valid generator code is found.
This diagram outlines the steps to decode a seed and validate its integrity.
Sources: index.html:550-578
Recovery Logic Example
The core of the recovery is the parity check. The system recalculates the parity from the recovered message portion and compares it to the parity portion stored in the seed.
// Simplified logic from recoverGeneratorCodeOriginal
recoverGeneratorCodeOriginal(seed) {
// ...
const permutedCodeword = this.lettersToNumbers(seed);
const codeword = this.applyPermutation(permutedCodeword, this.inversePermutation);
const message = codeword.slice(0, 13);
const parity = codeword.slice(13, 55);
const expectedParity = this.matrixVectorMultiplyMod26(this.matrices.P, message);
const negatedExpectedParity = expectedParity.map(x => (-x + 26) % 26);
for (let i = 0; i < 42; i++) {
if (parity[i] !== negatedExpectedParity[i]) {
throw new Error("Invalid seed for original mode: parity check failed");
}
}
return this.numbersToLetters(message);
}
This code snippet from index.html shows how the received parity is validated against a freshly computed one.
Sources: index.html:550-569
Associated System Components
The generation and recovery of the 55-character seed rely on several key classes and functions that are deterministically created from the master seed.
Class Diagram
The EncodingSystem class encapsulates all the necessary components (matrices, permutations) to process a seed. It uses a CryptoSeededRandom instance, which is a HMAC-SHA256 based deterministic random number generator, to ensure reproducibility.
This diagram shows the relationship between the main application logic, the EncodingSystem that defines the encoding rules, and the CryptoSeedenRandom that provides the deterministic entropy.
Sources: index.html:444-460, index.html:491-497, index.html:724-760
Conclusion
The 55-character seed is the core artifact of the qib13 tool, acting as a secure and robust container for a simpler 13-character generator code. Its structure, combining the original message with extensive parity data and then permuting the result, ensures that the original code can be recovered reliably. The entire system's security and reproducibility are anchored by the master seed, which deterministically generates all the components—matrices and permutations—needed to create and validate the 55-character seed.
Sources: README.md:10-15, README.md:154-160