@thenewlabs/entangle-crypto 1.0.0 → 2.0.0
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/dist/index.d.ts +50 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +79 -7
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,15 @@ export interface DerivedKeys {
|
|
|
2
2
|
K_enc: Uint8Array;
|
|
3
3
|
K_auth: Uint8Array;
|
|
4
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* AEAD direction discriminator. Bound into the AAD of every frame so a
|
|
7
|
+
* ciphertext produced for one direction can never be reflected back and
|
|
8
|
+
* accepted in the other direction (both peers share the same K_enc).
|
|
9
|
+
*/
|
|
10
|
+
export declare enum AeadDir {
|
|
11
|
+
ServerToClient = 1,// agent -> invoker
|
|
12
|
+
ClientToServer = 2
|
|
13
|
+
}
|
|
5
14
|
export declare function initCrypto(): Promise<void>;
|
|
6
15
|
export declare function extractSaltFromCapId(capId: string): Uint8Array;
|
|
7
16
|
export declare function generateCapId(): {
|
|
@@ -9,16 +18,55 @@ export declare function generateCapId(): {
|
|
|
9
18
|
saltCap: Uint8Array;
|
|
10
19
|
};
|
|
11
20
|
export declare function generateSecret(): string;
|
|
21
|
+
/**
|
|
22
|
+
* Derive the root key material from the capability secret. This is the
|
|
23
|
+
* expensive Argon2id step; callers should run it once per connection and
|
|
24
|
+
* reuse the returned `K_raw` for both bootstrap and session key derivation.
|
|
25
|
+
*/
|
|
26
|
+
export declare function deriveKeyMaterial(S: Uint8Array | string, saltCap: Uint8Array): Promise<Uint8Array>;
|
|
27
|
+
/**
|
|
28
|
+
* Bootstrap keys — derived purely from the capability secret, identical for
|
|
29
|
+
* every session. Used ONLY to authenticate AUTH1 and to protect the AUTH2
|
|
30
|
+
* handshake message that carries the fresh session nonces. Never used for
|
|
31
|
+
* command data.
|
|
32
|
+
*/
|
|
33
|
+
export declare function deriveBootstrapKeys(K_raw: Uint8Array): DerivedKeys;
|
|
34
|
+
/**
|
|
35
|
+
* Per-session keys — bound to the fresh handshake nonces (nonceB from the
|
|
36
|
+
* client, nonceC from the agent). Because both nonces are random per
|
|
37
|
+
* connection, every session gets distinct K_enc/K_auth, so ciphertext
|
|
38
|
+
* captured from one session cannot be replayed into another (each side's
|
|
39
|
+
* counters also reset per session). This is what actually defeats the
|
|
40
|
+
* cross-session replay / stale-output-injection attack.
|
|
41
|
+
*/
|
|
42
|
+
export declare function deriveSessionKeys(K_raw: Uint8Array, nonceB: string, nonceC: string): DerivedKeys;
|
|
43
|
+
/**
|
|
44
|
+
* Convenience: bootstrap keys directly from the secret. Kept for callers that
|
|
45
|
+
* only need the capability-static keys (e.g. AUTH1 HMAC before nonces exist).
|
|
46
|
+
*/
|
|
12
47
|
export declare function deriveKeys(S: Uint8Array | string, saltCap: Uint8Array): Promise<DerivedKeys>;
|
|
13
48
|
export interface AeadEncResult {
|
|
14
49
|
nonce: Uint8Array;
|
|
15
50
|
cipher: Uint8Array;
|
|
16
51
|
}
|
|
17
|
-
|
|
18
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Canonical AAD for a frame: binds both the frame type and the direction so
|
|
54
|
+
* a peer can never accept its own ciphertext reflected back.
|
|
55
|
+
*/
|
|
56
|
+
export declare function frameAad(type: number, dir: AeadDir): Uint8Array;
|
|
57
|
+
export declare function aeadEncrypt(K_enc: Uint8Array, type: number, ctr: number, plaintext: any, dir: AeadDir): AeadEncResult;
|
|
58
|
+
export declare function aeadDecrypt(K_enc: Uint8Array, type: number, nonce: Uint8Array, cipher: Uint8Array, dir: AeadDir): {
|
|
19
59
|
ctr: number;
|
|
20
60
|
msg: any;
|
|
21
61
|
};
|
|
62
|
+
/**
|
|
63
|
+
* Password hashing for the optional second-factor. Uses Argon2id with a
|
|
64
|
+
* random salt (via libsodium's crypto_pwhash_str), so the stored value is not
|
|
65
|
+
* a password-equivalent secret and cracking a leaked value is expensive.
|
|
66
|
+
*/
|
|
67
|
+
export declare function hashPassword(password: string): Promise<string>;
|
|
68
|
+
/** Constant-time verification of a password against a stored Argon2id hash. */
|
|
69
|
+
export declare function verifyPassword(storedHash: string, password: string): Promise<boolean>;
|
|
22
70
|
export declare function computeHmac(K_auth: Uint8Array, data: Uint8Array): Uint8Array;
|
|
23
71
|
export declare function verifyHmac(K_auth: Uint8Array, data: Uint8Array, mac: Uint8Array): boolean;
|
|
24
72
|
export declare function sha256Hex(text: string): string;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,UAAU,CAAC;CACpB;AAID,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAKhD;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAY9D;AAED,wBAAgB,aAAa,IAAI;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,UAAU,CAAA;CAAE,CAUtE;AAED,wBAAgB,cAAc,IAAI,MAAM,CAGvC;AAED,wBAAsB,UAAU,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,UAAU,CAAC;CACpB;AAED;;;;GAIG;AACH,oBAAY,OAAO;IACjB,cAAc,IAAI,CAAE,mBAAmB;IACvC,cAAc,IAAI;CACnB;AAID,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAKhD;AAED,wBAAgB,oBAAoB,CAAC,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wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAOpE;AAED,+EAA+E;AAC/E,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO3F;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,GAAG,UAAU,CAE5E;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAGzF;AAGD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAO9C;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAUxD;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAcvD;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,CAI9C;AAED,cAAc,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,16 @@ import { sha256 } from '@noble/hashes/sha256';
|
|
|
4
4
|
import { hmac } from '@noble/hashes/hmac';
|
|
5
5
|
import { encode, decode } from 'cborg';
|
|
6
6
|
import { CRYPTO_PARAMS } from '@thenewlabs/entangle-protocol';
|
|
7
|
+
/**
|
|
8
|
+
* AEAD direction discriminator. Bound into the AAD of every frame so a
|
|
9
|
+
* ciphertext produced for one direction can never be reflected back and
|
|
10
|
+
* accepted in the other direction (both peers share the same K_enc).
|
|
11
|
+
*/
|
|
12
|
+
export var AeadDir;
|
|
13
|
+
(function (AeadDir) {
|
|
14
|
+
AeadDir[AeadDir["ServerToClient"] = 1] = "ServerToClient";
|
|
15
|
+
AeadDir[AeadDir["ClientToServer"] = 2] = "ClientToServer";
|
|
16
|
+
})(AeadDir || (AeadDir = {}));
|
|
7
17
|
let sodiumReady = false;
|
|
8
18
|
export async function initCrypto() {
|
|
9
19
|
if (!sodiumReady) {
|
|
@@ -39,29 +49,91 @@ export function generateSecret() {
|
|
|
39
49
|
const secret = sodium.randombytes_buf(32);
|
|
40
50
|
return base64UrlEncode(secret);
|
|
41
51
|
}
|
|
42
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Derive the root key material from the capability secret. This is the
|
|
54
|
+
* expensive Argon2id step; callers should run it once per connection and
|
|
55
|
+
* reuse the returned `K_raw` for both bootstrap and session key derivation.
|
|
56
|
+
*/
|
|
57
|
+
export async function deriveKeyMaterial(S, saltCap) {
|
|
43
58
|
await initCrypto();
|
|
44
59
|
const secretBytes = typeof S === 'string' ? base64UrlDecode(S) : S;
|
|
45
|
-
|
|
46
|
-
|
|
60
|
+
return sodium.crypto_pwhash(32, secretBytes, saltCap, sodium.crypto_pwhash_OPSLIMIT_INTERACTIVE, sodium.crypto_pwhash_MEMLIMIT_INTERACTIVE, sodium.crypto_pwhash_ALG_ARGON2ID13);
|
|
61
|
+
}
|
|
62
|
+
function hkdfKeys(K_raw, salt, info) {
|
|
63
|
+
const derived = hkdf(sha256, K_raw, salt, new TextEncoder().encode(info), 64);
|
|
47
64
|
return {
|
|
48
65
|
K_enc: derived.slice(0, 32),
|
|
49
66
|
K_auth: derived.slice(32, 64),
|
|
50
67
|
};
|
|
51
68
|
}
|
|
52
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Bootstrap keys — derived purely from the capability secret, identical for
|
|
71
|
+
* every session. Used ONLY to authenticate AUTH1 and to protect the AUTH2
|
|
72
|
+
* handshake message that carries the fresh session nonces. Never used for
|
|
73
|
+
* command data.
|
|
74
|
+
*/
|
|
75
|
+
export function deriveBootstrapKeys(K_raw) {
|
|
76
|
+
return hkdfKeys(K_raw, new Uint8Array(0), 'entangle-capability');
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Per-session keys — bound to the fresh handshake nonces (nonceB from the
|
|
80
|
+
* client, nonceC from the agent). Because both nonces are random per
|
|
81
|
+
* connection, every session gets distinct K_enc/K_auth, so ciphertext
|
|
82
|
+
* captured from one session cannot be replayed into another (each side's
|
|
83
|
+
* counters also reset per session). This is what actually defeats the
|
|
84
|
+
* cross-session replay / stale-output-injection attack.
|
|
85
|
+
*/
|
|
86
|
+
export function deriveSessionKeys(K_raw, nonceB, nonceC) {
|
|
87
|
+
const salt = new TextEncoder().encode(`${nonceB}|${nonceC}`);
|
|
88
|
+
return hkdfKeys(K_raw, salt, 'entangle-session-v2');
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Convenience: bootstrap keys directly from the secret. Kept for callers that
|
|
92
|
+
* only need the capability-static keys (e.g. AUTH1 HMAC before nonces exist).
|
|
93
|
+
*/
|
|
94
|
+
export async function deriveKeys(S, saltCap) {
|
|
95
|
+
const K_raw = await deriveKeyMaterial(S, saltCap);
|
|
96
|
+
return deriveBootstrapKeys(K_raw);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Canonical AAD for a frame: binds both the frame type and the direction so
|
|
100
|
+
* a peer can never accept its own ciphertext reflected back.
|
|
101
|
+
*/
|
|
102
|
+
export function frameAad(type, dir) {
|
|
103
|
+
return encode({ type, dir });
|
|
104
|
+
}
|
|
105
|
+
export function aeadEncrypt(K_enc, type, ctr, plaintext, dir) {
|
|
53
106
|
const nonce = sodium.randombytes_buf(CRYPTO_PARAMS.NONCE_BYTES);
|
|
54
|
-
const aad =
|
|
107
|
+
const aad = frameAad(type, dir);
|
|
55
108
|
const pt = encode({ ctr, msg: plaintext });
|
|
56
109
|
const cipher = sodium.crypto_aead_xchacha20poly1305_ietf_encrypt(pt, aad, null, nonce, K_enc);
|
|
57
110
|
return { nonce, cipher };
|
|
58
111
|
}
|
|
59
|
-
export function aeadDecrypt(K_enc, type, nonce, cipher) {
|
|
60
|
-
const aad =
|
|
112
|
+
export function aeadDecrypt(K_enc, type, nonce, cipher, dir) {
|
|
113
|
+
const aad = frameAad(type, dir);
|
|
61
114
|
const pt = sodium.crypto_aead_xchacha20poly1305_ietf_decrypt(null, cipher, aad, nonce, K_enc);
|
|
62
115
|
const decoded = decode(pt);
|
|
63
116
|
return decoded;
|
|
64
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* Password hashing for the optional second-factor. Uses Argon2id with a
|
|
120
|
+
* random salt (via libsodium's crypto_pwhash_str), so the stored value is not
|
|
121
|
+
* a password-equivalent secret and cracking a leaked value is expensive.
|
|
122
|
+
*/
|
|
123
|
+
export async function hashPassword(password) {
|
|
124
|
+
await initCrypto();
|
|
125
|
+
return sodium.crypto_pwhash_str(password, sodium.crypto_pwhash_OPSLIMIT_INTERACTIVE, sodium.crypto_pwhash_MEMLIMIT_INTERACTIVE);
|
|
126
|
+
}
|
|
127
|
+
/** Constant-time verification of a password against a stored Argon2id hash. */
|
|
128
|
+
export async function verifyPassword(storedHash, password) {
|
|
129
|
+
await initCrypto();
|
|
130
|
+
try {
|
|
131
|
+
return sodium.crypto_pwhash_str_verify(storedHash, password);
|
|
132
|
+
}
|
|
133
|
+
catch {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
65
137
|
export function computeHmac(K_auth, data) {
|
|
66
138
|
return hmac(sha256, K_auth, data);
|
|
67
139
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAO9D,IAAI,WAAW,GAAG,KAAK,C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AC,GAAW;IACzC,IAAI,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACvD,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,GAAG,CAAC;IAChB,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QACvE,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;IACvD,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5B,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,MAAW;IACpC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IAC/B,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAC7B,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC;AAED,cAAc,oBAAoB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thenewlabs/entangle-crypto",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@noble/hashes": "^1.8.0",
|
|
14
|
-
"@thenewlabs/entangle-protocol": "^
|
|
14
|
+
"@thenewlabs/entangle-protocol": "^2.0.0",
|
|
15
15
|
"cborg": "^4.5.8",
|
|
16
16
|
"libsodium-wrappers-sumo": "^0.8.4"
|
|
17
17
|
},
|