Input Fields
Relevant source files
The following files were used as context for generating this wiki page:The input fields are the core components of the qib13 user interface, enabling users to configure encoding systems, generate seeds, and recover generator codes. These fields are organized into functional tabs within the index.html page and are directly linked to JavaScript functions that perform the system's cryptographic operations. User inputs, such as the master seed and generator code, are fundamental to the deterministic and reproducible nature of the qib13 tool.
Sources: index.html:68-171, README.md:10-14
System Generation Inputs
These inputs are located in the "Generate Systems" tab and are used to configure and create the set of encoding systems.
Sources: index.html:81-93
Input Field Details
| ID | HTML Element | Purpose | Constraints / Default |
|---|---|---|---|
masterSeed | <input type="text"> | Provides the root seed for deterministically generating all encoding systems. | Placeholder: "Enter your master seed". If left empty, a default value is used. |
numSystems | <input type="number"> | Specifies the number of "Deviation Systems" to generate in addition to the "Original System". | min="1", max="100", value="10" |
Sources: index.html:83-86, index.html:712-718
Data Flow
The values from these fields are read by the generateSystems() JavaScript function. If the masterSeed input is empty, a hardcoded default master seed is used.
The following diagram illustrates the flow when the "Generate Systems" button is clicked.
This diagram shows the logic within the generateSystems() function for handling user-provided or default master seeds.
Sources: index.html:712-750
Seed Generation Inputs
Located in the "Generate Seed" tab, these inputs are used to create a 55-letter seed from a 13-letter generator code.
Sources: index.html:98-121
Input Field Details
| ID / Name | HTML Element | Purpose | Constraints / Default |
|---|---|---|---|
generatorCodeInput | <input type="text"> | The 13-letter code to be encoded into a seed. | maxlength="13", Placeholder: "Enter 13-letter generator code (a-z)" |
generateMode | <input type="radio"> | Selects which encoding system to use. | Options: "Original", "Deviation", "Random", "Specific". Default: "Original". |
generateSpecificSystemIndex | <input type="number"> | Specifies the system index when generateMode is "Specific". | min="1", max="10", value="1". Max value is updated dynamically. |
Sources: index.html:100, index.html:102-107, index.html:110-111
Conditional Logic
The generateSpecificSystemIndex input field is only visible when the user selects the "Specific System" radio button. This logic is handled by a JavaScript event listener.
Sources: index.html:689-699
The diagram below shows the control flow within the generateSeed() function based on the selected generateMode.
This diagram outlines how the selected mode determines which EncodingSystem is used for seed generation.
Sources: index.html:886-912
Code Recovery Inputs
These inputs, found in the "Recover Code" tab, are used to recover the original 13-letter generator code from a 55-letter seed.
Sources: index.html:123-146
Input Field Details
| ID / Name | HTML Element | Purpose | Constraints / Default |
|---|---|---|---|
seedInput | <input type="text"> | The 55-letter seed to be decoded. | maxlength="55", Placeholder: "Enter 55-letter seed (a-z)" |
recoverMode | <input type="radio"> | Selects the recovery strategy. | Options: "Sequential", "Original Only", "Specific System". Default: "Sequential". |
specificSystemIndex | <input type="number"> | Specifies the system index to try when recoverMode is "Specific". | min="1", max="10", value="1". Max value is updated dynamically. |
Sources: index.html:125, index.html:127-131, index.html:134-135
Recovery Logic
The recoverGeneratorCode() function implements the logic based on the selected recoverMode. The "Sequential" mode is the most comprehensive, iterating through all generated systems until one successfully decodes the seed.
The following sequence diagram shows the interaction for a sequential recovery attempt.
This diagram details the trial-and-error process of sequential recovery.
Sources: index.html:936-967
Input Validation
Input validation is performed at both the HTML attribute level and within the JavaScript logic to ensure data integrity before processing.
HTML Constraints
Basic constraints are defined directly on the input elements.
| Input ID | Attribute | Value | Purpose |
|---|---|---|---|
numSystems | min | 1 | Ensures at least one deviation system is requested. |
numSystems | max | 100 | Prevents excessive system generation. |
generatorCodeInput | maxlength | 13 | Enforces the required length for a generator code. |
seedInput | maxlength | 55 | Enforces the required length for a seed. |
Sources: index.html:86, index.html:100, index.html:125
JavaScript Validation
More specific validation occurs within the EncodingSystem class methods before any cryptographic operations are performed. For example, the generator code and seed are checked to ensure they contain only lowercase letters.
// From generateSeedOriginal method
if (!/^[a-z]+$/.test(generatorCode) || generatorCode.length !== 13) {
throw new Error("Generator code must be exactly 13 lowercase letters (a-z)");
}
// From recoverGeneratorCodeOriginal method
if (!/^[a-z]+$/.test(seed) || seed.length !== 55) {
throw new Error("Seed must be exactly 55 lowercase letters (a-z)");
}
This ensures that the core logic only operates on valid inputs, throwing an error if the format is incorrect.
Sources: index.html:543-545, index.html:575-577