@vex-chat/crypto 1.1.1 → 2.0.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/README.md CHANGED
@@ -1,18 +1,94 @@
1
- # @vex-chat/crypto-js
1
+ # @vex-chat/crypto
2
2
 
3
- ![typescript_ci](https://github.com/vex-chat/crypto-js/workflows/typescript_ci/badge.svg)
3
+ [![npm](https://img.shields.io/npm/v/@vex-chat/crypto?style=flat-square&color=cb3837&logo=npm)](https://www.npmjs.com/package/@vex-chat/crypto)
4
+ [![CI](https://img.shields.io/github/actions/workflow/status/vex-protocol/crypto-js/build.yml?branch=master&style=flat-square&logo=github&label=CI)](https://github.com/vex-protocol/crypto-js/actions/workflows/build.yml)
5
+ [![Released](https://img.shields.io/github/release-date/vex-protocol/crypto-js?style=flat-square&label=released)](https://github.com/vex-protocol/crypto-js/releases)
6
+ [![License](https://img.shields.io/npm/l/@vex-chat/crypto?style=flat-square&color=blue)](./LICENSE)
7
+ [![Types](https://img.shields.io/npm/types/@vex-chat/crypto?style=flat-square&logo=typescript&color=3178c6)](./dist/index.d.ts)
8
+ [![Type Coverage](https://img.shields.io/badge/dynamic/json?style=flat-square&label=type-coverage&prefix=%E2%89%A5&suffix=%25&query=$.typeCoverage.atLeast&url=https://raw.githubusercontent.com/vex-protocol/crypto-js/master/package.json&color=3178c6&logo=typescript)](https://github.com/plantain-00/type-coverage)
9
+ [![Node](https://img.shields.io/node/v/@vex-chat/crypto?style=flat-square&color=339933&logo=nodedotjs)](./package.json)
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
+ [![Socket](https://socket.dev/api/badge/npm/package/@vex-chat/crypto)](https://socket.dev/npm/package/@vex-chat/crypto)
4
12
 
5
- All of the crypto functions for the key exchange are contained in here.
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.
6
14
 
7
- [Documentation](https://vex-chat.github.io/crypto-js/)
15
+ ## What's in the box
8
16
 
9
- ## external crypto dependencies
17
+ - **Key generation** — `xBoxKeyPair()` / `xSignKeyPair()` / `xSignKeyPairFromSecret()` / `xBoxKeyPairFromSecret()` for X25519 (box) and Ed25519 (sign) keypairs (`tweetnacl`).
18
+ - **Signing** — `xSign()` / `xSignOpen()` over arbitrary bytes (Ed25519, `tweetnacl`).
19
+ - **Authenticated encryption** — `xSecretbox()` / `xSecretboxOpen()` (XSalsa20-Poly1305 secretbox) and `xDH()` (X25519 scalar mult) via `tweetnacl`.
20
+ - **Hashing & KDF** — `xHash()` (SHA-512 hex via `@noble/hashes`), `xKDF()` (**HKDF-SHA-512** via `@noble/hashes`), `xHMAC()` (HMAC-SHA-256 via `@noble/hashes`), and `XUtils.encryptKeyData` / `decryptKeyData` (**PBKDF2-SHA-512** + `tweetnacl` secretbox).
21
+ - **Curve key encoding** — `xEncode()` prefixes a 32-byte X25519 public key for the wire format (not msgpack).
22
+ - **Msgpack framing** — `XUtils.packMessage()` / `unpackMessage()` wrap a 32-byte header + msgpack body (`msgpackr`); `unpackMessage` validates base fields with Zod.
23
+ - **Text & byte encoding** — `XUtils` hex/base64/UTF-8 helpers (`@stablelib/base64`, `@stablelib/utf8`).
24
+ - **Mnemonics** — `xMnemonic()` (BIP39 via `bip39`).
25
+ - **Utilities** — `xConcat()`, `xMakeNonce()`, `xRandomBytes()`, `XUtils.bytesEqual` (constant-time when lengths match), and `XKeyConvert` (Ed25519 ↔ X25519 via `ed2curve`).
10
26
 
11
- This library utilizes native Node.js crypto where possible for performance and security.
27
+ **HKDF, PBKDF2, HMAC, and SHA-512 / SHA-256** all run through **`@noble/hashes`**. **`tweetnacl`** supplies CSPRNG, box, sign, and secretbox.
12
28
 
13
- - **tweetnacl**: Primitives for signing and encryption (X25519 / Ed25519).
14
- - **ed2curve**: Ed25519 signing key to X25519 encryption key conversion.
15
- - **msgpackr**: High-performance MessagePack serialization (replacing `msgpack-lite`).
16
- - **bip39**: Mnemonic generation for keys.
17
- - **Node Crypto**: Native implementations for HKDF, PBKDF2, HMAC, and SHA hashing (replacing `futoin-hkdf`, `create-hmac`, and `sha.js`).
18
- - **@stablelib**: Constant-time encoding for Base64 and UTF8.
29
+ ## Install
30
+
31
+ ```sh
32
+ npm install @vex-chat/crypto
33
+ ```
34
+
35
+ `@vex-chat/types` is a peer dependency — install it alongside if you don't already have it:
36
+
37
+ ```sh
38
+ npm install @vex-chat/types @vex-chat/crypto
39
+ ```
40
+
41
+ ## Usage
42
+
43
+ ```ts
44
+ import {
45
+ xBoxKeyPair,
46
+ xSignKeyPair,
47
+ xSign,
48
+ xSignOpen,
49
+ xSecretbox,
50
+ xSecretboxOpen,
51
+ xDH,
52
+ xMakeNonce,
53
+ XUtils,
54
+ } from "@vex-chat/crypto";
55
+
56
+ // Generate identity keys
57
+ const signKeys = xSignKeyPair();
58
+ const boxKeys = xBoxKeyPair();
59
+
60
+ // Sign a message (returns 64-byte signature prefix + message)
61
+ const message = XUtils.encodeUTF8("hello vex");
62
+ const signed = xSign(message, signKeys.secretKey);
63
+ const opened = xSignOpen(signed, signKeys.publicKey);
64
+
65
+ // Derive a shared secret and encrypt
66
+ const shared = xDH(boxKeys.secretKey, otherPartyPublicKey);
67
+ const nonce = xMakeNonce();
68
+ const ciphertext = xSecretbox(message, nonce, shared);
69
+
70
+ // Decrypt
71
+ const plaintext = xSecretboxOpen(ciphertext, nonce, shared);
72
+
73
+ // Msgpack wire body (32-byte header + msgpack); see XUtils.packMessage / unpackMessage
74
+ const wire = XUtils.packMessage({
75
+ type: "success",
76
+ transmissionID: "abc",
77
+ data: null,
78
+ });
79
+ const [, body] = XUtils.unpackMessage(wire);
80
+ ```
81
+
82
+ ## API documentation
83
+
84
+ HTML and JSON API reference is generated from TSDoc on `src/index.ts`:
85
+
86
+ ```sh
87
+ npm run docs
88
+ ```
89
+
90
+ Output is written to `./docs/` (gitignored). CI runs the same generator with `--treatWarningsAsErrors`.
91
+
92
+ ## License
93
+
94
+ [AGPL-3.0-or-later](./LICENSE)
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
+ import type { BaseMsg } from "@vex-chat/types";
1
2
  import { decode as decodeBase64, encode as encodeBase64 } from "@stablelib/base64";
2
- import { decode as encodeUTF8, encode as decodeUTF8 } from "@stablelib/utf8";
3
- import type { IBaseMsg } from "@vex-chat/types";
3
+ import { encode as decodeUTF8, decode as encodeUTF8 } from "@stablelib/utf8";
4
4
  import ed2curve from "ed2curve";
5
5
  /**
6
6
  * Provides an interface that can map an ed25519 keypair to its equivalent
@@ -12,131 +12,141 @@ export declare const XKeyConvert: typeof ed2curve;
12
12
  * vex messages.
13
13
  */
14
14
  export declare class XUtils {
15
- static encodeUTF8: typeof encodeUTF8;
15
+ static decodeBase64: typeof decodeBase64;
16
16
  static decodeUTF8: typeof decodeUTF8;
17
17
  static encodeBase64: typeof encodeBase64;
18
- static decodeBase64: typeof decodeBase64;
18
+ static encodeUTF8: typeof encodeUTF8;
19
19
  /**
20
20
  * Checks if two buffer-like objects are equal.
21
+ * When lengths match, comparison is constant-time in the inputs (no early exit on first differing byte).
21
22
  *
22
23
  * @param buf1
23
24
  * @param buf2
24
25
  *
25
26
  * @returns True if equal, else false.
26
27
  */
27
- static bytesEqual(buf1: Uint8Array | ArrayBuffer, buf2: Uint8Array | ArrayBuffer): boolean;
28
+ static bytesEqual(buf1: ArrayBuffer | Uint8Array, buf2: ArrayBuffer | Uint8Array): boolean;
28
29
  /**
29
- * Returns a six bit Uint8Array representation of an integer.
30
- * The integer must be positive, and it must be able to be stored
31
- * in six bytes.
30
+ * Decodes a hex string into a Uint8Array.
32
31
  *
33
- * @param n The number to convert.
34
- * @returns The Uint8Array representation of n.
32
+ * @returns The Uint8Array.
35
33
  */
36
- static numberToUint8Arr(n: number): Uint8Array;
34
+ static decodeHex(hexString: string): Uint8Array;
37
35
  /**
38
- * Converts a Uint8Array representation of an integer back into a number.
36
+ * Decrypts a secret key from the binary format produced by encryptKeyData().
37
+ * No I/O — the caller handles reading the data.
39
38
  *
40
- * @param arr The array to convert.
41
- * @returns the number representation of arr.
39
+ * @param keyData The encrypted key data as a Uint8Array.
40
+ * @param password The password used to encrypt.
41
+ * @returns The hex-encoded secret key.
42
42
  */
43
- static uint8ArrToNumber(arr: Uint8Array): number;
43
+ static decryptKeyData: (keyData: Uint8Array, password: string) => string;
44
44
  /**
45
- * Takes a vex message and unpacks it into its header and a javascript object
46
- * respresentation of its body.
45
+ * Returns the empty header (32 0's)
47
46
  *
48
- * @param arr The array to convert.
49
- * @returns [32 byte header, message body]
47
+ * @returns The empty header.
50
48
  */
51
- static unpackMessage(msg: Uint8Array | Buffer): [Uint8Array, IBaseMsg];
49
+ static emptyHeader(): Uint8Array<ArrayBuffer>;
52
50
  /**
53
- * Packs a javascript object and a 32 byte header into a vex message.
51
+ * Encodes a Uint8Array to a hex string.
54
52
  *
55
- * @param arr The array to convert.
56
- * @returns the packed message.
53
+ * @returns The hex string.
57
54
  */
58
- static packMessage(msg: any, header?: Uint8Array): Uint8Array<ArrayBufferLike>;
55
+ static encodeHex(bytes: Uint8Array): string;
59
56
  /**
60
- * Returns the empty header (32 0's)
57
+ * Encrypts a secret key into a portable binary format.
58
+ * The result can be written to disk, sent over the network, etc.
59
+ * No I/O — the caller handles persistence.
61
60
  *
62
- * @returns The empty header.
61
+ * Format: [iterations(6)|salt(24)|nonce(24)|ciphertext(N)]
62
+ *
63
+ * @param password The password to derive the encryption key from.
64
+ * @param keyToSave The hex-encoded secret key to encrypt.
65
+ * @param iterationOverride Optional PBKDF2 iteration count (random if omitted).
66
+ * @returns The encrypted key data as a Uint8Array.
63
67
  */
64
- static emptyHeader(): Uint8Array<ArrayBuffer>;
65
- /**
66
- * Encrypts a secret key with a password and saves it as a file.
67
- *
68
- * @param path The path to save the keyfile.
69
- /**
70
- * Encrypts a secret key into a portable binary format.
71
- * The result can be written to disk, sent over the network, etc.
72
- * No I/O — the caller handles persistence.
73
- *
74
- * Format: [iterations(6)|salt(24)|nonce(24)|ciphertext(N)]
75
- *
76
- * @param password The password to derive the encryption key from.
77
- * @param keyToSave The hex-encoded secret key to encrypt.
78
- * @param iterationOverride Optional PBKDF2 iteration count (random if omitted).
79
- * @returns The encrypted key data as a Uint8Array.
80
- */
81
68
  static encryptKeyData: (password: string, keyToSave: string, iterationOverride?: number) => Uint8Array;
82
69
  /**
83
- * Decrypts a secret key from the binary format produced by encryptKeyData().
84
- * No I/O the caller handles reading the data.
70
+ * Returns a six bit Uint8Array representation of an integer.
71
+ * The integer must be positive, and it must be able to be stored
72
+ * in six bytes.
85
73
  *
86
- * @param keyData The encrypted key data as a Uint8Array.
87
- * @param password The password used to encrypt.
88
- * @returns The hex-encoded secret key.
74
+ * @param n The number to convert.
75
+ * @returns The Uint8Array representation of n.
89
76
  */
90
- static decryptKeyData: (keyData: Uint8Array, password: string) => string;
77
+ static numberToUint8Arr(n: number): Uint8Array;
91
78
  /**
92
- * Decodes a hex string into a Uint8Array.
79
+ * Packs a javascript object and a 32 byte header into a vex message.
93
80
  *
94
- * @returns The Uint8Array.
81
+ * @param msg Message body (msgpack-serialized).
82
+ * @param header Optional 32-byte header; defaults to an empty header.
83
+ * @returns the packed message.
95
84
  */
96
- static decodeHex(hexString: string): Uint8Array;
85
+ static packMessage(msg: unknown, header?: Uint8Array): Uint8Array<ArrayBufferLike>;
97
86
  /**
98
- * Encodes a Uint8Array to a hex string.
87
+ * Converts a Uint8Array representation of an integer back into a number.
99
88
  *
100
- * @returns The hex string.
89
+ * @param arr The array to convert.
90
+ * @returns the number representation of arr.
101
91
  */
102
- static encodeHex(bytes: Uint8Array): string;
92
+ static uint8ArrToNumber(arr: Uint8Array): number;
93
+ /**
94
+ * Takes a vex message and unpacks it into its header and a javascript object
95
+ * representation of its body.
96
+ *
97
+ * @param msg Full wire message (32-byte header + msgpack body).
98
+ * @returns [32 byte header, message body]
99
+ */
100
+ static unpackMessage(msg: Buffer | Uint8Array): [Uint8Array, BaseMsg];
103
101
  }
104
- /**
105
- * Gets a word list representation of a byte sequence.
106
- *
107
- * @param entropy The bytes to derive the wordlist from.
108
- * @param wordList Optional, override the wordlist. See bip39 docs for details.
109
- */
110
- export declare function xMnemonic(entropy: Uint8Array, wordList?: string[] | undefined): string;
111
102
  /**
112
103
  * Returns a 32 byte HMAC of a javscript object.
113
104
  *
114
105
  * @param msg the message to create the HMAC of
115
106
  * @param SK the secret key to create the HMAC with
116
107
  */
117
- export declare function xHMAC(msg: any, SK: Uint8Array): Uint8Array<ArrayBufferLike>;
108
+ export declare function xHMAC(msg: unknown, SK: Uint8Array): Uint8Array<ArrayBufferLike> & Uint8Array<ArrayBuffer>;
118
109
  /**
119
- * Constants for vex.
110
+ * Gets a word list representation of a byte sequence.
111
+ *
112
+ * @param entropy The bytes to derive the wordlist from.
113
+ * @param wordList Optional, override the wordlist. See bip39 docs for details.
120
114
  */
121
- export declare const xConstants: XConstants;
115
+ export declare function xMnemonic(entropy: Uint8Array, wordList?: string[]): string;
122
116
  /**
123
- * Returns a 24 byte random nonce of cryptographic quality.
117
+ * Constants for vex.
124
118
  */
125
- export declare function xMakeNonce(): Uint8Array;
119
+ export declare const xConstants: XConstants;
120
+ /** Ed25519 or X25519 key pair. Structurally identical to nacl.SignKeyPair / nacl.BoxKeyPair. */
121
+ export interface KeyPair {
122
+ publicKey: Uint8Array;
123
+ secretKey: Uint8Array;
124
+ }
126
125
  /**
127
126
  * Derives a 32 byte secret key from some initial key material.
128
127
  *
129
128
  * @param IKM the initial key material.
130
129
  * @returns The generated key.
131
130
  */
132
- export declare function xKDF(IKM: Uint8Array): Uint8Array;
131
+ /** Shape of the {@link xConstants} runtime object. */
132
+ export interface XConstants {
133
+ CURVE: "X25519";
134
+ HASH: "SHA-512";
135
+ HEADER_SIZE: 32;
136
+ INFO: string;
137
+ KEY_LENGTH: 32 | 57;
138
+ MIN_OTK_SUPPLY: number;
139
+ }
140
+ /** Generate a fresh X25519 box key pair. */
141
+ export declare function xBoxKeyPair(): KeyPair;
142
+ /** Restore an X25519 box key pair from a 32-byte secret key. */
143
+ export declare function xBoxKeyPairFromSecret(secretKey: Uint8Array): KeyPair;
133
144
  /**
134
- * Hashes some data.
145
+ * Concatanates multiple Uint8Arrays.
135
146
  *
136
- * @param data the data to hash.
137
- * @returns The hash of the data.
147
+ * @param arrays As many Uint8Arrays as you would like to concatanate.
138
148
  */
139
- export declare function xHash(data: Uint8Array): string;
149
+ export declare function xConcat(...arrays: Uint8Array[]): Uint8Array;
140
150
  /**
141
151
  * Derives a shared Secret Key from a known private key and
142
152
  * a peer's known public key.
@@ -146,29 +156,37 @@ export declare function xHash(data: Uint8Array): string;
146
156
  * @returns The derived shared secret, SK.
147
157
  */
148
158
  export declare function xDH(myPrivateKey: Uint8Array, theirPublicKey: Uint8Array): Uint8Array;
149
- /**
150
- * Concatanates multiple Uint8Arrays.
151
- *
152
- * @param arrays As many Uint8Arrays as you would like to concatanate.
153
- */
154
- export declare function xConcat(...arrays: Uint8Array[]): Uint8Array;
155
159
  /**
156
160
  * Encode an X25519 or X448 public key PK into a byte sequence.
157
161
  * The encoding consists of 0 or 1 to represent the type of curve, followed by l
158
162
  * ittle-endian encoding of the u-coordinate. See [rfc 7748](https://www.ietf.org/rfc/rfc7748.txt) for more
159
163
  * details.
160
164
  */
161
- export declare function xEncode(curveType: "X25519" | "X448", publicKey: Uint8Array): Uint8Array;
165
+ export declare function xEncode(curveType: "X448" | "X25519", publicKey: Uint8Array): Uint8Array;
162
166
  /**
163
- * @ignore
167
+ * Hashes some data.
168
+ *
169
+ * @param data the data to hash.
170
+ * @returns The hash of the data.
164
171
  */
165
- interface XConstants {
166
- CURVE: "X25519";
167
- HASH: "SHA-512";
168
- INFO: string;
169
- KEY_LENGTH: 32 | 57;
170
- MIN_OTK_SUPPLY: number;
171
- HEADER_SIZE: 32;
172
- }
173
- export {};
172
+ export declare function xHash(data: Uint8Array): string;
173
+ export declare function xKDF(IKM: Uint8Array): Uint8Array;
174
+ /**
175
+ * Returns a 24 byte random nonce of cryptographic quality.
176
+ */
177
+ export declare function xMakeNonce(): Uint8Array;
178
+ /** Cryptographically secure random bytes. */
179
+ export declare function xRandomBytes(length: number): Uint8Array;
180
+ /** Encrypt with a shared secret key. */
181
+ export declare function xSecretbox(plaintext: Uint8Array, nonce: Uint8Array, key: Uint8Array): Uint8Array;
182
+ /** Decrypt with a shared secret key. Returns null if authentication fails. */
183
+ export declare function xSecretboxOpen(ciphertext: Uint8Array, nonce: Uint8Array, key: Uint8Array): null | Uint8Array;
184
+ /** Sign a message with an Ed25519 secret key. Returns signed message (64-byte signature prefix + message). */
185
+ export declare function xSign(message: Uint8Array, secretKey: Uint8Array): Uint8Array;
186
+ /** Generate a fresh Ed25519 signing key pair. */
187
+ export declare function xSignKeyPair(): KeyPair;
188
+ /** Restore an Ed25519 signing key pair from a 64-byte secret key. */
189
+ export declare function xSignKeyPairFromSecret(secretKey: Uint8Array): KeyPair;
190
+ /** Verify and open a signed message. Returns the original message, or null if verification fails. */
191
+ export declare function xSignOpen(signedMessage: Uint8Array, publicKey: Uint8Array): null | Uint8Array;
174
192
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,MAAM,IAAI,YAAY,EACtB,MAAM,IAAI,YAAY,EACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAMhD,OAAO,QAAQ,MAAM,UAAU,CAAC;AAWhC;;;GAGG;AACH,eAAO,MAAM,WAAW,iBAAW,CAAC;AAEpC;;;GAGG;AACH,qBAAa,MAAM;IACf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