@@ -1,7 +1,13 @@
|
||||
# Architecture
|
||||
|
||||
Crypto Tools is a static React/Vite inspection application wrapped in the shared Toolbox shell. `crypto/inspection.ts` accepts a bounded string or byte buffer, separates PEM blocks or JSON, and produces one plain report model. It uses `@peculiar/x509` for X.509/PKCS #10/CRL parsing and signature primitives, and browser WebCrypto for SHA-256 fingerprints and RFC 7638 thumbprints.
|
||||
Crypto Tools is a static React/Vite application wrapped in the shared Toolbox shell. `crypto/inspection.ts` accepts a bounded string or byte buffer, separates PEM blocks or JSON, and produces one plain report model. It uses `@peculiar/x509` for X.509/PKCS #10/CRL parsing and signature primitives, strict `asn1js` DER parsing for the supported PKCS containers, and browser WebCrypto for fingerprints, key import and operations.
|
||||
|
||||
Certificate linking is deliberately explicit and shallow: certificates in the same input are matched by issuer/subject and the child signature is checked with that candidate. The app does not build a trust path, load platform roots, fetch intermediates or revocation data, or infer trust from a valid signature. DNS SAN matching is an isolated syntax check against a user-entered host name.
|
||||
Certificate paths are built only from the bounded explicit input. Issuer names select candidates, AKI/SKI disambiguates when available, and each link checks its signature, Basic Constraints, keyCertSign, path-length and inspection-time validity. Ambiguous, missing and looping paths stop rather than guess. A self-signed terminus is labelled as present but never trusted. The app does not load platform roots, fetch intermediates/revocation data or infer trust from a valid signature. DNS SAN matching remains an isolated syntax check against a user-entered host name.
|
||||
|
||||
The 8 MiB/256-PEM-block bounds are checked before expensive parsing. Version 0.1 does not use a worker, persistence, or a server API. Relative entry and asset URLs keep the build relocatable below a nested portal path.
|
||||
`crypto/pbes2.ts` accepts DER EncryptedPrivateKeyInfo and reusable AlgorithmIdentifier/ciphertext pairs using PBES2 + PBKDF2, bounded iterations/salts, supported HMAC PRFs and WebCrypto AES-CBC/AES-GCM schemes. Successful private-key decryption must produce a structurally valid PKCS #8 PrivateKeyInfo. Passwords and plaintext key bytes are not returned in reports.
|
||||
|
||||
`crypto/pkcs12.ts` parses a version-3 PFX, its CMS-data AuthenticatedSafe, bounded `data`/`encryptedData` ContentInfos, SafeContents and at most 512 bags across four nested levels. It inventories attributes, unencrypted and shrouded PKCS #8 keys, X.509 certificate bags and nested SafeContents; CRL, secret and unknown bag values are identified without being decoded. MacData is verified before password-based decryption when SHA-1/SHA-256/SHA-384/SHA-512 is declared, using the RFC 7292 PKCS #12 MAC KDF with at most 50,000 iterations. Modern PBES2/PBKDF2 AES content is decrypted through the shared WebCrypto path. Legacy PKCS #12 PBE, non-data CMS content, unknown certificate types, wrong passwords and malformed or excessive nesting fail closed with contextual diagnostics. Plaintext SafeContents and private-key buffers are overwritten after extracting metadata; certificates are retained as public inputs for the existing path analyzer.
|
||||
|
||||
`crypto/operations.ts` exposes fixed algorithm profiles rather than parameter auto-detection. It imports PKCS #8/SPKI/certificate/JWK keys, rejects implicit legacy conversions, enforces RSA/AES/curve bounds, and overwrites temporary decoded/decrypted private-key buffers after WebCrypto import on both success and failure. It generates a fresh 96-bit IV for each AES-GCM encryption and releases no plaintext after an authenticated-decryption failure. The AES JSON envelope and asymmetric signatures/ciphertexts use explicit unpadded Base64url encodings.
|
||||
|
||||
The 8 MiB/256-PEM-block bounds are checked before expensive parsing. Encrypted PEM blocks are processed sequentially; PBKDF2 is capped at 10,000,000 iterations per object and 20,000,000 aggregate iterations per inspection, including encrypted PKCS #12 content and shrouded key bags. PKCS #12 MAC iterations are capped at 50,000 and explicit PKCS #12 passwords at 4,096 UTF-16 units. The app does not use persistence or a server API. Relative entry and asset URLs keep the build relocatable below a nested portal path.
|
||||
|
||||
@@ -2,6 +2,12 @@
|
||||
|
||||
Certificate, key and JWK material is parsed locally and kept only in page memory. The app makes no network request, does not consult a trust store, and has no telemetry, analytics, account or persistence. File input is size-checked before it is read; text/DER input is limited to 8 MiB, PEM input to 256 blocks, and JWKS input to 1,000 valid JWK objects.
|
||||
|
||||
Private or symmetric material is identified and prominently warned about, but never decrypted, generated, exported or stored by the app. A compromised browser, extension, device or copied report can still expose sensitive material, so users should prefer public test material whenever possible.
|
||||
Private or symmetric material is prominently warned about. Password use has a separate explicit opt-in; leaving the enabled field blank deliberately requests an empty PKCS #12 password. A supplied password can verify supported PKCS #12 MacData and decrypt modern PBES2 PKCS #8/SafeContents in page memory. The password and decrypted key/SafeContents bytes are not put in inspection reports or persistence, and transient plaintext buffers are overwritten after metadata extraction. Public certificates may remain in the result for path analysis. The operations workspace can generate an AES key and display cryptographic output so the user can copy it, but it does not store it. A compromised browser, extension, device, clipboard or screenshot can still expose sensitive material, so users should prefer public test material whenever possible and leave the page when finished.
|
||||
|
||||
Fingerprints and thumbprints identify exact bytes or canonical JWK members; they do not establish identity or trust. Issuer signature links are not RFC 5280 validation, validity dates use the local clock, and no live revocation check is performed. Rendered values are React text rather than imported HTML.
|
||||
Fingerprints and thumbprints identify exact bytes or canonical JWK members; they do not establish identity or trust. Explicit-input path analysis is not complete RFC 5280 validation, validity dates use the selected inspection time, and no live revocation check is performed. A verified PFX MacData authenticates the encoded AuthenticatedSafe under the supplied password; it does not establish certificate trust or validate every semantic use of a bag. PFX files without MacData are explicitly reported as unauthenticated. Rendered values are React text rather than imported HTML.
|
||||
|
||||
The fixed WebCrypto profiles are narrow interoperability tools, not a cryptographic protocol. RSA-OAEP is limited to short UTF-8 messages; AES-GCM authenticates the tool's JSON envelope; ECDSA signatures use the browser WebCrypto representation. Authentication/decryption failures return only an error. Algorithm availability, including Ed25519, depends on the current browser.
|
||||
|
||||
PBES2 AES-GCM authenticates its ciphertext. PBES2 AES-CBC does not provide integrity; a successful password, padding and PKCS #8 structure check cannot authenticate the encrypted container. Password text is converted to PBKDF2 bytes as UTF-8, which may not match every legacy producer's password convention. Encrypted PEM objects are inspected sequentially, and one shared 20,000,000-iteration PBKDF2 budget prevents a multi-object input from multiplying the per-object work limit.
|
||||
|
||||
PKCS #12 legacy PBE (including RC2/3DES), unsupported CMS content, non-X.509 certificate bags and excessive nesting are rejected instead of partially interpreted. CRL, secret and unknown bag values are inventoried by type/OID but deliberately not decoded or exported. The parser is a narrow local inspection implementation, not a general PKCS #12 writer or a replacement for hardware-backed key storage.
|
||||
|
||||
Reference in New Issue
Block a user