Using the Tool Offline
Relevant source files
The following files were used as context for generating this wiki page:
The qib13 tool is designed as a single, self-contained HTML file, which allows it to be run entirely offline in a web browser. The project documentation explicitly recommends this method for maximizing security. By running the tool offline, users can ensure that sensitive information, such as the Master Seed and Generator Code, never leaves their local machine, mitigating risks associated with network exposure.
All functionality, including the generation of encoding systems and the encoding/decoding of seeds, is performed client-side using embedded JavaScript. No internet connection is required after the index.html file has been downloaded.
Sources: README.md, index.html
How to Use Offline
The process for using the qib13 tool offline is straightforward as it is a single, portable file.
- Download: Save the
index.htmlfile to your local machine. - Disconnect: For maximum security, disconnect your machine from the internet.
- Open: Open the downloaded
index.htmlfile in any modern web browser.
The following diagram illustrates the recommended user workflow for secure, offline operation.
Sources: README.md
Fully-Featured Offline Experience
The qib13 tool provides its complete feature set in an offline environment. All calculations and data manipulations happen within the browser. The user interface is organized into four main tabs, each corresponding to a core function of the tool.
| Feature Tab | Description |
|---|---|
| Generate Systems | Creates a set of reproducible encoding systems from a user-provided or default Master Seed. |
| Generate Seed | Encodes a 13-letter generator code into a 55-letter seed using a selected encoding system. |
| Recover Code | Recovers the original 13-letter generator code from a 55-letter seed by trying the available systems. |
| Batch Test | Runs a series of automated tests to verify the encode/recover cycle for multiple randomly generated codes. |
Sources: index.html:61-80
Self-Contained Architecture
The tool's ability to run offline is due to its architecture as a single file containing all necessary components. The index.html file bundles the application's structure, styling, and logic together.
- HTML: Defines the user interface, including input fields, buttons, and result display areas.
- CSS: All visual styling is embedded within a
<style>block in the document's head, ensuring the UI renders correctly without external stylesheets. - JavaScript: The entire application logic, including cryptographic functions, system generation, and UI event handling, is contained within a single
<script>block.
This diagram shows the components encapsulated within the index.html file.
Sources: index.html:4-60, index.html:61-173, index.html:174-1048
Client-Side Cryptography and State Management
All sensitive operations and application state are handled locally on the client-side.
Cryptographic Engine
The core of the tool's deterministic nature is a custom-seeded random number generator.
CryptoSeededRandom: A class that implements a cryptographically secure deterministic RNG using HMAC-SHA256 in counter mode. It is seeded by the Master Seed.- Fallback Implementations: The script includes pure JavaScript implementations of
sha256andhmacto ensure functionality even in environments that might lack the Web Crypto API. This makes the tool highly portable.
The diagram below shows the key classes involved in the tool's logic.
State Management
Application state, such as the generated encoding systems, is stored in a global JavaScript variable allSystems.
- In-Memory: The state is held in memory and is lost when the browser tab is closed or refreshed.
- Reproducibility: To restore a session, the user must re-generate the systems using the exact same Master Seed and number of deviation systems. This is a critical part of the offline security model, as no state is persisted to disk automatically.
The sequence diagram below shows how a user action (generating systems) is handled entirely within the browser.
Sources: index.html:175, index.html:665-717
Key Data Structures and Configuration
The behavior of the tool is determined by the EncodingSystem class and a few key configuration values.
EncodingSystem Class
Each generated system is an instance of the EncodingSystem class, which holds the components needed for encoding and decoding.
| Property | Type | Description |
|---|---|---|
id | number | A unique identifier for the system. |
type | string | The type of system: 'original' or 'deviation'. |
matrices | object | Contains the parity-check matrices (P or P1, P2). |
permutation | number[] | The permutation array applied during seed generation. |
inversePermutation | number[] | The inverse permutation used for recovering the code from a seed. |
Sources: index.html:512-518
Default Configuration
If a user does not provide a custom Master Seed, the tool uses a hardcoded default configuration to generate a standard set of systems.
| Parameter | Default Value |
|---|---|
| Master Seed | xtphkxlzrkleosumdxykzmmhzdtaqdsfbzimlwglctrcezpffqtbfhbiakksgwauprtbhfflulpnrbhghbvpnwqhyozkjgsavudi |
| Number of Systems | 10 (plus 1 original system, for a total of 11) |
Sources: index.html:176-177, index.html:737-740
Conclusion
The qib13 tool is architected for secure, offline use by design. Its single-file, self-contained nature ensures that all operations, including sensitive cryptographic ones, are performed locally within the user's browser. This approach, recommended in the project's documentation, provides a strong security posture by eliminating network-based threats and ensuring the confidentiality of the Master Seed and user data. The deterministic generation of systems from a Master Seed provides reproducibility, which is essential for a recovery tool.