@shieldfive/crypto 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## Unreleased
9
9
 
10
+ ## 1.1.1 — 2026-11-14
11
+
12
+ ### Documentation
13
+
14
+ - `spec/format-v1.md`: suites `0x01` and `0x04` were described as having
15
+ disjoint `(prefix, counter)` IV spaces. They do not: they share a chunk key
16
+ and their IVs coincide when the `0x04` prefix equals the `0x01` prefix
17
+ followed by four zero bytes, probability 2^-64 for a reused
18
+ `(content_key, file_id)`. The spec now states that bound and forbids
19
+ reusing the pair across suites. Informational, no reachable impact; the
20
+ library's writers create a fresh pair per file. No code change (#76).
21
+ Reported by an external researcher.
22
+
10
23
  ## 1.1.0 — 2026-10-22
11
24
 
12
25
  ### Added
package/dist/index.d.ts CHANGED
@@ -55,7 +55,7 @@ export interface AutoDecryptOptions {
55
55
  */
56
56
  export declare function autoDecryptBlob(options: AutoDecryptOptions): Promise<Blob>;
57
57
  /** Library version, also written into format documentation. */
58
- export declare const SHIELDFIVE_CRYPTO_VERSION = "1.1.0";
58
+ export declare const SHIELDFIVE_CRYPTO_VERSION = "1.1.1";
59
59
  /** Default cipher suite for new files when not specified by the caller. */
60
60
  export declare const DEFAULT_SUITE: 3;
61
61
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -142,7 +142,7 @@ export async function autoDecryptBlob(options) {
142
142
  }
143
143
  }
144
144
  /** Library version, also written into format documentation. */
145
- export const SHIELDFIVE_CRYPTO_VERSION = '1.1.0';
145
+ export const SHIELDFIVE_CRYPTO_VERSION = '1.1.1';
146
146
  /** Default cipher suite for new files when not specified by the caller. */
147
147
  export const DEFAULT_SUITE = SUITE.PQ_HYBRID_XCHACHA_MLKEM1024_V1;
148
148
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shieldfive/crypto",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Client-side post-quantum hybrid encryption for cloud storage. The cryptographic core of ShieldFive.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
package/spec/format-v1.md CHANGED
@@ -399,9 +399,18 @@ files written before `0x04` existed stay readable.
399
399
  This is bit-for-bit identical to the `0x01` chunk-key derivation — same
400
400
  HKDF `info` string (`shieldfive/v1/aes-gcm/chunk-key`), same inputs. A
401
401
  `0x01` file and a `0x04` file sharing a `content_key` and `file_id`
402
- derive the same chunk key. They never collide on AEAD inputs, because
403
- the nonce-prefix derivation below uses a distinct `info` string, giving
404
- the two suites disjoint `(prefix, counter)` spaces.
402
+ derive the same chunk key. The nonce-prefix derivation below uses a
403
+ distinct `info` string, so the two suites' prefixes are *independent*
404
+ HKDF outputs, but their IV spaces are **not disjoint**: a `0x01` IV is
405
+ `P1[4] || uint64_be(i)` and, for `i < 2^32`, equals
406
+ `P1 || 00000000 || uint32_be(i)`, so whenever the `0x04` prefix `P2`
407
+ equals `P1 || 00000000` every chunk index of the two files shares a
408
+ (key, IV) pair. For a reused `(content_key, file_id)` this happens with
409
+ probability 2^-64. Writers MUST NOT reuse a `(content_key, file_id)`
410
+ pair across suites (or within one); the library's writers generate both
411
+ fresh per file unless the caller supplies them. A future AES-GCM suite
412
+ will bind the suite id into the chunk-key derivation (audit M5) so that
413
+ cross-suite reuse yields different keys.
405
414
 
406
415
  - `chunk_nonce(file_id, i)` =
407
416
  `HKDF-SHA-256(ikm=file_id, salt=zeros(32), info="shieldfive/v1/aes-gcm-v2/nonce-prefix", L=8)`
@@ -412,7 +421,8 @@ files written before `0x04` existed stay readable.
412
421
  4-byte prefix and an 8-byte counter. Widening the prefix shrinks the
413
422
  cross-file `(prefix, counter)` collision space (for two files that reuse
414
423
  a `content_key` — which never happens under correct use, but defense in
415
- depth) from 2^32 to 2^64. The trade is a per-file chunk ceiling of 2^32
424
+ depth) from 2^32 to 2^64. This bound is probabilistic, not structural;
425
+ see the cross-suite note above. The trade is a per-file chunk ceiling of 2^32
416
426
  chunks rather than 2^64; this is far above the format's
417
427
  `MAX_TOTAL_CHUNKS` bound (1e9), so it is not a practical constraint.
418
428
  Readers MUST reject a `0x04` file whose `total_chunks` exceeds 2^32. The
package/src/index.ts CHANGED
@@ -220,7 +220,7 @@ export async function autoDecryptBlob(
220
220
  }
221
221
 
222
222
  /** Library version, also written into format documentation. */
223
- export const SHIELDFIVE_CRYPTO_VERSION = '1.1.0'
223
+ export const SHIELDFIVE_CRYPTO_VERSION = '1.1.1'
224
224
 
225
225
  /** Default cipher suite for new files when not specified by the caller. */
226
226
  export const DEFAULT_SUITE = SUITE.PQ_HYBRID_XCHACHA_MLKEM1024_V1