License Decryption Process
TechUI's authorization verification system is built on the principles of "Zero Trust" and "Complete Offline" operation. All decryption and verification logic is executed within the WebAssembly (Wasm) sandbox environment, ensuring that the authorization logic is difficult to tamper with or bypass, even on the browser side.
Depending on the component library level, TechUI employs two different decryption strategies.
Heavy License Decryption
Applicable Components: 💎 @techui/prime (Prime version)
The Prime version utilizes a high-intensity Two-Factor Decryption mechanism. It relies on the collaboration between a public Npm keychain package and a private Client Key, functioning much like a bank vault that requires two keys to open.
Core Composition
- 🔑 Npm Keychain Package
- Form: Published as an npm dependency package (e.g.,
@techui/prime-keychain). - Content: Contains a large number of obfuscated public key fragments. It is versioned and updated alongside the component library.
- Form: Published as an npm dependency package (e.g.,
- 🆔 Client Identity Key
- Form: Encrypted string, issued by TechUI business departments.
- Content: Contains only basic client identity information (company name, type, expiration date, region, etc.). Does not contain specific permission configurations.
- ⚙️ Config Key
- Form: Encrypted string, issued along with the Client Key.
- Content: Contains detailed permission control parameters (project binding rules, sub-license information, function switches, etc.).
Decryption Steps
During initialization, the Wasm module strictly follows this 7-step closed-loop process:
- Fingerprint Extraction: Wasm reads the provided
Client Keyand extracts the Key ID. - Public Key Location: Based on the extracted ID, it locates the matching Npm Key within the loaded
@techui/prime-keychainmemory segment. - First-Layer Decryption: The internal Wasm algorithm performs bootstrap decryption on the Npm Key to obtain a "private key seed" for decryption.
- Identity Unlocking: Uses the "private key seed" to decrypt the user's
Client Keyand verify signature legitimacy. - Basic Information Extraction: Obtains basic license metadata (e.g.,
company,region,expDate). - Second-Layer Decryption (Config Loading): Combines all previous decryption results to perform the final decryption of the Config Key, obtaining detailed control parameters (JSON structure).
- Ultimate Verification: Based on the full set of decrypted parameters combined with the current operating environment (domain, time, project name), it outputs the final
Booleanverification result.
Lite License Decryption
Applicable Components: 🚀 Scifi / 📊 Base / 🎛️ Admin
To pursue ultimate ease of use and distribution efficiency, lightweight components adopt a one-way decryption mechanism.
Core Composition
- Single License String
- Form: A single long string.
- Content: Packages "identity information" and "configuration parameters" together through high-intensity compression and encryption.
- In commercial license distribution scenarios, a Sub-License Key String is also included.
Decryption Steps
- Main License Decryption: Wasm directly uses internal algorithms to decrypt the main string and obtain authorization information for the current entity.
- Sub-License Decryption (Commercial Licenses Only): If the license is detected as a "Commerce" license and contains a
subLicensefield, Wasm retrieves and decrypts the sub-license key to verify the final customer's authorization status. - Environment Verification: Compares the decrypted parameters (such as domain binding and expiration date) with the current running environment to determine whether to grant access.