@vex-chat/crypto 2.0.1 → 2.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/CLA.md ADDED
@@ -0,0 +1,38 @@
1
+ # Contributor License Agreement (Individual)
2
+
3
+ Thank you for your interest in contributing to this project (“**Project**”).
4
+
5
+ This Contributor License Agreement (“**Agreement**”) documents the rights granted by contributors to the Project’s copyright holders and maintainers (collectively, the “**Maintainers**”).
6
+
7
+ ## Definitions
8
+
9
+ **“Contribution”** means any original work of authorship, including any modifications or additions to the Project, that you submit or have submitted to the Project in any form (for example, pull requests, issues with attached patches, or mailing-list posts).
10
+
11
+ **“Submit”** means any form of electronic or written communication sent to the Maintainers or Project repositories.
12
+
13
+ ## Grant of rights
14
+
15
+ You hereby grant the Maintainers:
16
+
17
+ 1. **Copyright license** — A perpetual, worldwide, non-exclusive, royalty-free, irrevocable license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute your Contributions under the **AGPL-3.0-or-later** license that applies to the Project.
18
+
19
+ 2. **Relicensing for dual licensing** — The same rights as in (1), but under **other license terms** chosen by the Maintainers, solely as needed to offer **commercial or proprietary licenses** to third parties, without owing you royalties for such sublicensing.
20
+
21
+ 3. **Patent license** — If your Contribution includes a patent claim that you have the right to license, you grant the Maintainers and users of the Project a perpetual, worldwide, non-exclusive, royalty-free license under those claims to make, use, sell, offer for sale, import, and otherwise dispose of the Contribution and works including it.
22
+
23
+ ## Representations
24
+
25
+ You represent that:
26
+
27
+ - Each Contribution is your original creation, or you have sufficient rights to submit it under this Agreement.
28
+ - To your knowledge, your Contribution does not violate anyone else’s rights.
29
+
30
+ ## Miscellaneous
31
+
32
+ This Agreement does not obligate the Maintainers to use or merge your Contributions.
33
+
34
+ If any part of this Agreement is held invalid, the remainder stays in effect.
35
+
36
+ ---
37
+
38
+ _This document is a practical starting point for open-source contribution. It is **not** legal advice. Have qualified counsel review and adapt it for your jurisdiction and entity before relying on it for government, procurement, or high-stakes decisions._
@@ -0,0 +1,10 @@
1
+ # Commercial licensing
2
+
3
+ This software is also available under **commercial license terms** from:
4
+
5
+ **Vex Heavy Industries LLC**
6
+
7
+ - **Email:** [licensing@vex.wtf](mailto:licensing@vex.wtf)
8
+ - **Web:** [vex.wtf](https://vex.wtf)
9
+
10
+ The default **public** license for open source use is the **GNU Affero General Public License v3.0** — see the [`LICENSE`](./LICENSE) file in this repository.
package/LICENSING.md ADDED
@@ -0,0 +1,15 @@
1
+ # Licensing
2
+
3
+ ## Open source (default)
4
+
5
+ The default **public** license is the **GNU Affero General Public License v3.0** — see the full text in [`LICENSE`](./LICENSE). The SPDX identifier in `package.json` may use **AGPL-3.0-or-later**; either way, the grant is at least AGPL v3.
6
+
7
+ ## Commercial licensing
8
+
9
+ Commercial licenses are offered by **Vex Heavy Industries LLC**. See [`LICENSE-COMMERCIAL`](./LICENSE-COMMERCIAL) for contact details ([vex.wtf](https://vex.wtf), **licensing@vex.wtf**).
10
+
11
+ If you need terms **other than the AGPL** (for example, a proprietary product or a deployment where AGPL obligations are not acceptable), inquire there.
12
+
13
+ ---
14
+
15
+ _This file summarizes how we intend licensing to work. It is not legal advice. For binding terms, rely on the written agreement or license grant you receive from the copyright holders._
package/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
  [![OpenSSF Scorecard](https://img.shields.io/ossf-scorecard/github.com/vex-protocol/crypto-js?style=flat-square&label=Scorecard)](https://securityscorecards.dev/viewer/?uri=github.com/vex-protocol/crypto-js)
11
11
  [![Socket](https://socket.dev/api/badge/npm/package/@vex-chat/crypto)](https://socket.dev/npm/package/@vex-chat/crypto)
12
12
 
13
- Crypto primitives for the [Vex](https://vex.wtf) encrypted chat platform. Sign, encrypt, hash, derive keys, and encode bytes — everything the client and server need to speak the protocol.
13
+ Crypto primitives for the [Vex](https://vex.wtf) protocol. Sign, encrypt, hash, derive keys, and encode bytes — everything the client and server need to speak the protocol.
14
14
 
15
15
  ## What's in the box
16
16
 
@@ -23,6 +23,8 @@ Crypto primitives for the [Vex](https://vex.wtf) encrypted chat platform. Sign,
23
23
  - **Text & byte encoding** — `XUtils` hex/base64/UTF-8 helpers (`@stablelib/base64`, `@stablelib/utf8`).
24
24
  - **Mnemonics** — `xMnemonic()` (BIP39 via `bip39`).
25
25
  - **Utilities** — `xConcat()`, `xMakeNonce()`, `xRandomBytes()`, `XUtils.bytesEqual` (constant-time when lengths match), and `XKeyConvert` (Ed25519 ↔ X25519 via `ed2curve`).
26
+ - **Runtime profile** — `setCryptoProfile()` / `getCryptoProfile()` to select `tweetnacl` (default) or `fips` mode.
27
+ - **Async portable crypto** — `xSignAsync()`, `xSignOpenAsync()`, `xSignKeyPairAsync()`, `xBoxKeyPairAsync()`, `xDHAsync()`, `xSecretboxAsync()`, `xSecretboxOpenAsync()` for cross-runtime WebCrypto-backed flows.
26
28
 
27
29
  **HKDF, PBKDF2, HMAC, and SHA-512 / SHA-256** all run through **`@noble/hashes`**. **`tweetnacl`** supplies CSPRNG, box, sign, and secretbox.
28
30
 
@@ -42,6 +44,11 @@ npm install @vex-chat/types @vex-chat/crypto
42
44
 
43
45
  ```ts
44
46
  import {
47
+ getCryptoProfile,
48
+ setCryptoProfile,
49
+ xSignAsync,
50
+ xSignOpenAsync,
51
+ xSignKeyPairAsync,
45
52
  xBoxKeyPair,
46
53
  xSignKeyPair,
47
54
  xSign,
@@ -53,6 +60,10 @@ import {
53
60
  XUtils,
54
61
  } from "@vex-chat/crypto";
55
62
 
63
+ // Optional: select backend profile once at process startup.
64
+ setCryptoProfile("tweetnacl");
65
+ console.log(getCryptoProfile()); // "tweetnacl"
66
+
56
67
  // Generate identity keys
57
68
  const signKeys = xSignKeyPair();
58
69
  const boxKeys = xBoxKeyPair();
@@ -77,18 +88,23 @@ const wire = XUtils.packMessage({
77
88
  data: null,
78
89
  });
79
90
  const [, body] = XUtils.unpackMessage(wire);
80
- ```
81
91
 
82
- ## API documentation
92
+ // Cross-runtime async path (required for full FIPS profile usage)
93
+ setCryptoProfile("fips");
94
+ const fipsKeys = await xSignKeyPairAsync();
95
+ const fipsSigned = await xSignAsync(message, fipsKeys.secretKey);
96
+ const fipsOpened = await xSignOpenAsync(fipsSigned, fipsKeys.publicKey);
97
+ ```
83
98
 
84
- HTML and JSON API reference is generated from TSDoc on `src/index.ts`:
99
+ ## Crypto profiles
85
100
 
86
- ```sh
87
- npm run docs
88
- ```
101
+ - `tweetnacl` (default): current behavior for signing, key exchange, secretbox, and random bytes.
102
+ - `fips`:
103
+ - sync NaCl-shaped APIs (`xSign`, `xDH`, `xSecretbox`, etc.) still throw (to avoid silent semantic drift),
104
+ - async APIs (`...Async`) use WebCrypto-backed P-256 ECDSA, P-256 ECDH, and AES-GCM, plus WebCrypto random bytes.
89
105
 
90
- Output is written to `./docs/` (gitignored). CI runs the same generator with `--treatWarningsAsErrors`.
106
+ Outside contributors should follow [CONTRIBUTING.md](./CONTRIBUTING.md) (including the [CLA](./CLA.md)). Release workflow: [AGENTS.md](./AGENTS.md).
91
107
 
92
108
  ## License
93
109
 
94
- [AGPL-3.0-or-later](./LICENSE)
110
+ Default public license: **[AGPL-3.0](./LICENSE)** (see `package.json` for SPDX). Commercial licenses from **Vex Heavy Industries LLC**: [**LICENSE-COMMERCIAL**](./LICENSE-COMMERCIAL), [**LICENSING.md**](./LICENSING.md).
package/dist/index.d.ts CHANGED
@@ -1,7 +1,24 @@
1
+ /**
2
+ * Copyright (c) 2020-2026 Vex Heavy Industries LLC
3
+ * Licensed under AGPL-3.0. See LICENSE for details.
4
+ * Commercial licenses available at vex.wtf
5
+ */
1
6
  import type { BaseMsg } from "@vex-chat/types";
2
7
  import { decode as decodeBase64, encode as encodeBase64 } from "@stablelib/base64";
3
8
  import { encode as decodeUTF8, decode as encodeUTF8 } from "@stablelib/utf8";
4
9
  import ed2curve from "ed2curve";
10
+ /** Runtime crypto profile selector. */
11
+ export type CryptoProfile = "fips" | "tweetnacl";
12
+ /** Returns the currently configured crypto profile. */
13
+ export declare function getCryptoProfile(): CryptoProfile;
14
+ /**
15
+ * Sets the runtime crypto profile.
16
+ *
17
+ * `tweetnacl` preserves existing behavior.
18
+ * `fips` currently enables only backend-agnostic helpers; NaCl-coupled
19
+ * primitives throw until a FIPS backend implementation is wired in.
20
+ */
21
+ export declare function setCryptoProfile(profile: CryptoProfile): void;
5
22
  /**
6
23
  * Provides an interface that can map an ed25519 keypair to its equivalent
7
24
  * X25519 keypair.
@@ -41,6 +58,18 @@ export declare class XUtils {
41
58
  * @returns The hex-encoded secret key.
42
59
  */
43
60
  static decryptKeyData: (keyData: Uint8Array, password: string) => string;
61
+ /**
62
+ * Async variant of decryptKeyData for cross-runtime/FIPS backends.
63
+ * Supports both profile formats emitted by encryptKeyDataAsync.
64
+ */
65
+ static decryptKeyDataAsync: (keyData: Uint8Array, password: string) => Promise<string>;
66
+ /**
67
+ * 32-byte AES-256 key for local at-rest encryption (e.g. sqlite) derived from
68
+ * identity `secretKey`. For `tweetnacl` this is the 32-byte X25519 private key.
69
+ * For `fips` the identity secret is PKCS#8; HKDF is applied so AES keys never
70
+ * equal the raw private key material.
71
+ */
72
+ static deriveLocalAtRestAesKey(identitySk: Uint8Array, profile: CryptoProfile): Uint8Array;
44
73
  /**
45
74
  * Returns the empty header (32 0's)
46
75
  *
@@ -66,6 +95,11 @@ export declare class XUtils {
66
95
  * @returns The encrypted key data as a Uint8Array.
67
96
  */
68
97
  static encryptKeyData: (password: string, keyToSave: string, iterationOverride?: number) => Uint8Array;
98
+ /**
99
+ * Async variant of encryptKeyData for cross-runtime/FIPS backends.
100
+ * Format remains [iterations(6)|salt(24)|nonce(24)|ciphertext(N)].
101
+ */
102
+ static encryptKeyDataAsync: (password: string, keyToSave: string, iterationOverride?: number) => Promise<Uint8Array>;
69
103
  /**
70
104
  * Returns a six bit Uint8Array representation of an integer.
71
105
  * The integer must be positive, and it must be able to be stored
@@ -137,10 +171,21 @@ export interface XConstants {
137
171
  KEY_LENGTH: 32 | 57;
138
172
  MIN_OTK_SUPPLY: number;
139
173
  }
174
+ /**
175
+ * FIPS: `device.signKey` in the database is the P-256 ECDSA public key (SPKI),
176
+ * used for account/device signature verification. X3DH on the client expects
177
+ * the same curve point as Web Crypto "raw" P-256 ECDH public bytes for
178
+ * `importEcdhPublicKey`. This converts SPKI → raw without a private key.
179
+ */
180
+ export declare function fipsEcdhRawPublicKeyFromEcdsaSpkiAsync(ecdsaSpki: Uint8Array): Promise<Uint8Array>;
140
181
  /** Generate a fresh X25519 box key pair. */
141
182
  export declare function xBoxKeyPair(): KeyPair;
183
+ /** Async box keypair generation for the active profile. */
184
+ export declare function xBoxKeyPairAsync(): Promise<KeyPair>;
142
185
  /** Restore an X25519 box key pair from a 32-byte secret key. */
143
186
  export declare function xBoxKeyPairFromSecret(secretKey: Uint8Array): KeyPair;
187
+ /** Async box key restore from private key material. */
188
+ export declare function xBoxKeyPairFromSecretAsync(secretKey: Uint8Array): Promise<KeyPair>;
144
189
  /**
145
190
  * Concatanates multiple Uint8Arrays.
146
191
  *
@@ -156,6 +201,14 @@ export declare function xConcat(...arrays: Uint8Array[]): Uint8Array;
156
201
  * @returns The derived shared secret, SK.
157
202
  */
158
203
  export declare function xDH(myPrivateKey: Uint8Array, theirPublicKey: Uint8Array): Uint8Array;
204
+ /** Async DH for cross-runtime/FIPS backends. */
205
+ export declare function xDHAsync(myPrivateKey: Uint8Array, theirPublicKey: Uint8Array): Promise<Uint8Array>;
206
+ /**
207
+ * In `fips` mode only: derive a P-256 ECDH `KeyPair` (raw public + pkcs8 secret)
208
+ * from a P-256 ECDSA `KeyPair` (spki + pkcs8) using the same private scalar in Web Crypto.
209
+ * In `tweetnacl` mode, use `XKeyConvert.convertKeyPair` to map Ed25519 → X25519 instead.
210
+ */
211
+ export declare function xEcdhKeyPairFromEcdsaKeyPairAsync(sign: KeyPair): Promise<KeyPair>;
159
212
  /**
160
213
  * Encode an X25519 or X448 public key PK into a byte sequence.
161
214
  * The encoding consists of 0 or 1 to represent the type of curve, followed by l
@@ -179,14 +232,26 @@ export declare function xMakeNonce(): Uint8Array;
179
232
  export declare function xRandomBytes(length: number): Uint8Array;
180
233
  /** Encrypt with a shared secret key. */
181
234
  export declare function xSecretbox(plaintext: Uint8Array, nonce: Uint8Array, key: Uint8Array): Uint8Array;
235
+ /** Async authenticated encryption for cross-runtime/FIPS backends. */
236
+ export declare function xSecretboxAsync(plaintext: Uint8Array, nonce: Uint8Array, key: Uint8Array): Promise<Uint8Array>;
182
237
  /** Decrypt with a shared secret key. Returns null if authentication fails. */
183
238
  export declare function xSecretboxOpen(ciphertext: Uint8Array, nonce: Uint8Array, key: Uint8Array): null | Uint8Array;
239
+ /** Async authenticated decryption for cross-runtime/FIPS backends. */
240
+ export declare function xSecretboxOpenAsync(ciphertext: Uint8Array, nonce: Uint8Array, key: Uint8Array): Promise<null | Uint8Array>;
184
241
  /** Sign a message with an Ed25519 secret key. Returns signed message (64-byte signature prefix + message). */
185
242
  export declare function xSign(message: Uint8Array, secretKey: Uint8Array): Uint8Array;
243
+ /** Async signing for cross-runtime/FIPS backends. */
244
+ export declare function xSignAsync(message: Uint8Array, secretKey: Uint8Array): Promise<Uint8Array>;
186
245
  /** Generate a fresh Ed25519 signing key pair. */
187
246
  export declare function xSignKeyPair(): KeyPair;
247
+ /** Async keypair generation for the active profile. */
248
+ export declare function xSignKeyPairAsync(): Promise<KeyPair>;
188
249
  /** Restore an Ed25519 signing key pair from a 64-byte secret key. */
189
250
  export declare function xSignKeyPairFromSecret(secretKey: Uint8Array): KeyPair;
251
+ /** Async restore of signing keypair for the active profile. */
252
+ export declare function xSignKeyPairFromSecretAsync(secretKey: Uint8Array): Promise<KeyPair>;
190
253
  /** Verify and open a signed message. Returns the original message, or null if verification fails. */
191
254
  export declare function xSignOpen(signedMessage: Uint8Array, publicKey: Uint8Array): null | Uint8Array;
255
+ /** Async verify/open for cross-runtime/FIPS backends. */
256
+ export declare function xSignOpenAsync(signedMessage: Uint8Array, publicKey: Uint8Array): Promise<null | Uint8Array>;
192
257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