internxt-crypto 0.0.13 → 1.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/README.md +44 -72
- package/dist/aes-B8TA-JKq.mjs +49 -0
- package/dist/aes-B8TA-JKq.mjs.map +1 -0
- package/dist/aes-CuW_SPl-.js +67 -0
- package/dist/aes-CuW_SPl-.js.map +1 -0
- package/dist/asymmetric-crypto.d.mts +8 -31
- package/dist/asymmetric-crypto.d.mts.map +1 -1
- package/dist/asymmetric-crypto.d.ts +8 -31
- package/dist/asymmetric-crypto.d.ts.map +1 -1
- package/dist/asymmetric-crypto.js +30 -7
- package/dist/asymmetric-crypto.js.map +1 -0
- package/dist/asymmetric-crypto.mjs +28 -2
- package/dist/asymmetric-crypto.mjs.map +1 -0
- package/dist/constants.d.mts +7 -14
- package/dist/constants.d.mts.map +1 -1
- package/dist/constants.d.ts +7 -14
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +11 -25
- package/dist/constants.js.map +1 -1
- package/dist/constants.mjs +7 -14
- package/dist/constants.mjs.map +1 -1
- package/dist/core-Bj26rNdA.js +227 -0
- package/dist/core-Bj26rNdA.js.map +1 -0
- package/dist/core-pEGygy6S.mjs +173 -0
- package/dist/core-pEGygy6S.mjs.map +1 -0
- package/dist/derive-key.d.mts +1 -74
- package/dist/derive-key.d.mts.map +1 -1
- package/dist/derive-key.d.ts +1 -74
- package/dist/derive-key.d.ts.map +1 -1
- package/dist/derive-key.js +3 -11
- package/dist/derive-key.mjs +2 -2
- package/dist/derive-password.d.mts +22 -0
- package/dist/derive-password.d.mts.map +1 -0
- package/dist/derive-password.d.ts +22 -0
- package/dist/derive-password.d.ts.map +1 -0
- package/dist/derive-password.js +5 -0
- package/dist/derive-password.mjs +3 -0
- package/dist/deriveKeysFromKey-C4McqO6_.js +47 -0
- package/dist/deriveKeysFromKey-C4McqO6_.js.map +1 -0
- package/dist/deriveKeysFromKey-DPU_h7wr.mjs +35 -0
- package/dist/deriveKeysFromKey-DPU_h7wr.mjs.map +1 -0
- package/dist/{deriveKeysFromPassword-Ko7NxkHM.js → deriveKeysFromPassword-C7xAGGsh.js} +5 -177
- package/dist/deriveKeysFromPassword-C7xAGGsh.js.map +1 -0
- package/dist/{deriveKeysFromPassword-DJRWZ8Rw.mjs → deriveKeysFromPassword-DXgSvTNC.mjs} +7 -131
- package/dist/deriveKeysFromPassword-DXgSvTNC.mjs.map +1 -0
- package/dist/email-crypto.d.mts +24 -46
- package/dist/email-crypto.d.mts.map +1 -1
- package/dist/email-crypto.d.ts +24 -46
- package/dist/email-crypto.d.ts.map +1 -1
- package/dist/email-crypto.js +121 -12
- package/dist/email-crypto.js.map +1 -0
- package/dist/email-crypto.mjs +115 -2
- package/dist/email-crypto.mjs.map +1 -0
- package/dist/email-search.d.mts +18 -18
- package/dist/email-search.d.mts.map +1 -1
- package/dist/email-search.d.ts +18 -18
- package/dist/email-search.d.ts.map +1 -1
- package/dist/email-search.js +25 -597
- package/dist/email-search.mjs +2 -573
- package/dist/{emailEncryptionKey-27mIHh18.mjs → emailEncryptionKey-BtSPYd9M.mjs} +23 -46
- package/dist/emailEncryptionKey-BtSPYd9M.mjs.map +1 -0
- package/dist/{emailEncryptionKey-DbaDAdoW.js → emailEncryptionKey-C4X1Bwy4.js} +22 -45
- package/dist/emailEncryptionKey-C4X1Bwy4.js.map +1 -0
- package/dist/{genID-3Er5IowC.mjs → genID-D08K7JPr.mjs} +4 -40
- package/dist/genID-D08K7JPr.mjs.map +1 -0
- package/dist/{genID-YJSl3YhL.js → genID-cWOPmspk.js} +2 -50
- package/dist/genID-cWOPmspk.js.map +1 -0
- package/dist/hash.d.mts +24 -36
- package/dist/hash.d.mts.map +1 -1
- package/dist/hash.d.ts +24 -36
- package/dist/hash.d.ts.map +1 -1
- package/dist/hash.js +88 -10
- package/dist/hash.js.map +1 -0
- package/dist/hash.mjs +82 -2
- package/dist/hash.mjs.map +1 -0
- package/dist/index.d.mts +17 -16
- package/dist/index.d.mts.map +1 -1
- package/dist/index.d.ts +17 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +60 -83
- package/dist/index.mjs +13 -11
- package/dist/keystore-crypto.d.mts +6 -6
- package/dist/keystore-crypto.d.mts.map +1 -1
- package/dist/keystore-crypto.d.ts +6 -6
- package/dist/keystore-crypto.d.ts.map +1 -1
- package/dist/keystore-crypto.js +1 -1
- package/dist/keystore-crypto.mjs +1 -1
- package/dist/post-quantum-crypto.d.mts +5 -41
- package/dist/post-quantum-crypto.d.mts.map +1 -1
- package/dist/post-quantum-crypto.d.ts +5 -41
- package/dist/post-quantum-crypto.d.ts.map +1 -1
- package/dist/post-quantum-crypto.js +49 -16
- package/dist/post-quantum-crypto.js.map +1 -0
- package/dist/post-quantum-crypto.mjs +46 -2
- package/dist/post-quantum-crypto.mjs.map +1 -0
- package/dist/search-B9YM3XAA.mjs +587 -0
- package/dist/search-B9YM3XAA.mjs.map +1 -0
- package/dist/search-DUTm4-rN.js +731 -0
- package/dist/search-DUTm4-rN.js.map +1 -0
- package/dist/symmetric-crypto.d.mts +13 -42
- package/dist/symmetric-crypto.d.mts.map +1 -1
- package/dist/symmetric-crypto.d.ts +13 -42
- package/dist/symmetric-crypto.d.ts.map +1 -1
- package/dist/symmetric-crypto.js +2 -6
- package/dist/symmetric-crypto.mjs +2 -2
- package/dist/types.d.mts +16 -39
- package/dist/types.d.mts.map +1 -1
- package/dist/types.d.ts +16 -39
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/dist/utils.d.mts +1 -19
- package/dist/utils.d.mts.map +1 -1
- package/dist/utils.d.ts +1 -19
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -3
- package/dist/utils.mjs +2 -2
- package/dist/xwing-CQmQX6hn.mjs +16 -0
- package/dist/xwing-CQmQX6hn.mjs.map +1 -0
- package/dist/xwing-iRWVRtNE.js +34 -0
- package/dist/xwing-iRWVRtNE.js.map +1 -0
- package/package.json +4 -2
- package/dist/aes-DSDxP8uF.mjs +0 -184
- package/dist/aes-DSDxP8uF.mjs.map +0 -1
- package/dist/aes-bOrKZuUC.js +0 -226
- package/dist/aes-bOrKZuUC.js.map +0 -1
- package/dist/deriveKeysFromPassword-DJRWZ8Rw.mjs.map +0 -1
- package/dist/deriveKeysFromPassword-Ko7NxkHM.js.map +0 -1
- package/dist/email-search.js.map +0 -1
- package/dist/email-search.mjs.map +0 -1
- package/dist/emailEncryptionKey-27mIHh18.mjs.map +0 -1
- package/dist/emailEncryptionKey-DbaDAdoW.js.map +0 -1
- package/dist/emailKeys-BJGdkLrg.js +0 -593
- package/dist/emailKeys-BJGdkLrg.js.map +0 -1
- package/dist/emailKeys-Fp9WR3wl.mjs +0 -509
- package/dist/emailKeys-Fp9WR3wl.mjs.map +0 -1
- package/dist/genID-3Er5IowC.mjs.map +0 -1
- package/dist/genID-YJSl3YhL.js.map +0 -1
- package/dist/keys-BfcaiAOv.mjs +0 -90
- package/dist/keys-BfcaiAOv.mjs.map +0 -1
- package/dist/keys-CinT7kEY.js +0 -125
- package/dist/keys-CinT7kEY.js.map +0 -1
- package/dist/kyber1024-PpwE1rki.mjs +0 -144
- package/dist/kyber1024-PpwE1rki.mjs.map +0 -1
- package/dist/kyber1024-jeKS8CXf.js +0 -173
- package/dist/kyber1024-jeKS8CXf.js.map +0 -1
- package/dist/kyber768-DGBB_RS7.d.ts +0 -32
- package/dist/kyber768-DGBB_RS7.d.ts.map +0 -1
- package/dist/kyber768-DzIcGg1i.d.mts +0 -32
- package/dist/kyber768-DzIcGg1i.d.mts.map +0 -1
- package/dist/mac-BMb1F0dN.js +0 -170
- package/dist/mac-BMb1F0dN.js.map +0 -1
- package/dist/mac-ZpRlx8Fs.mjs +0 -116
- package/dist/mac-ZpRlx8Fs.mjs.map +0 -1
package/dist/derive-key.d.mts
CHANGED
|
@@ -8,15 +8,6 @@
|
|
|
8
8
|
* @returns The derived secret key
|
|
9
9
|
*/
|
|
10
10
|
declare function deriveSymmetricKeyFromContext(context: string, baseKey: Uint8Array): Uint8Array;
|
|
11
|
-
/**
|
|
12
|
-
* Derives a symmetric CryptoKey from the base key and context string
|
|
13
|
-
*
|
|
14
|
-
* @param context - The context string.
|
|
15
|
-
* The context string should be hardcoded, globally unique, and application-specific.
|
|
16
|
-
* @param baseKey - The base key (NOT PASSWORD!)
|
|
17
|
-
* @returns The derived secret CryptoKey
|
|
18
|
-
*/
|
|
19
|
-
declare function deriveSymmetricCryptoKeyFromContext(context: string, baseKey: Uint8Array): Promise<CryptoKey>;
|
|
20
11
|
/**
|
|
21
12
|
* Derives a symmetric key from two keys
|
|
22
13
|
*
|
|
@@ -25,70 +16,6 @@ declare function deriveSymmetricCryptoKeyFromContext(context: string, baseKey: U
|
|
|
25
16
|
* @returns The derived secret key
|
|
26
17
|
*/
|
|
27
18
|
declare function deriveSymmetricKeyFromTwoKeys(key1: Uint8Array, key2: Uint8Array): Uint8Array;
|
|
28
|
-
/**
|
|
29
|
-
* Derives a symmetric CryptoKey from two keys
|
|
30
|
-
*
|
|
31
|
-
* @param key1 - The 32-bytes key
|
|
32
|
-
* @param key2 - The 32-bytes key
|
|
33
|
-
* @returns The derived secret CryptoKey
|
|
34
|
-
*/
|
|
35
|
-
declare function deriveSymmetricCryptoKeyFromTwoKeys(key1: Uint8Array, key2: Uint8Array): Promise<CryptoKey>;
|
|
36
|
-
/**
|
|
37
|
-
* Derives a symmetric key from two keys and context
|
|
38
|
-
*
|
|
39
|
-
* @param key1 - The 32-bytes key
|
|
40
|
-
* @param key2 - The 32-bytes key
|
|
41
|
-
* @param context - The context string
|
|
42
|
-
* @returns The derived symmetric key
|
|
43
|
-
*/
|
|
44
|
-
declare function deriveSymmetricKeyFromTwoKeysAndContext(key1: Uint8Array, key2: Uint8Array, context: string): Uint8Array;
|
|
45
|
-
//#endregion
|
|
46
|
-
//#region src/derive-key/deriveKeysFromPassword.d.ts
|
|
47
|
-
/**
|
|
48
|
-
* Derives a symmetric key from a user's password with a randomly sampled salt
|
|
49
|
-
*
|
|
50
|
-
* @param password - The user's password
|
|
51
|
-
* @returns The derived secret key and randomly sampled salt
|
|
52
|
-
*/
|
|
53
|
-
declare function getKeyFromPassword(password: string): Promise<{
|
|
54
|
-
key: Uint8Array;
|
|
55
|
-
salt: Uint8Array;
|
|
56
|
-
}>;
|
|
57
|
-
/**
|
|
58
|
-
* Derives a symmetric key from a user's password and salt
|
|
59
|
-
*
|
|
60
|
-
* @param password - The user's password
|
|
61
|
-
* @param salt - The given salt
|
|
62
|
-
* @returns The derived secret key
|
|
63
|
-
*/
|
|
64
|
-
declare function getKeyFromPasswordAndSalt(password: string, salt: Uint8Array): Promise<Uint8Array>;
|
|
65
|
-
/**
|
|
66
|
-
* Derives a HEX symmetric key from a user's password with a randomly sampled salt
|
|
67
|
-
*
|
|
68
|
-
* @param password - The user's password
|
|
69
|
-
* @returns The derived HEX secret key and randomly sampled HEX salt
|
|
70
|
-
*/
|
|
71
|
-
declare function getKeyFromPasswordHex(password: string): Promise<{
|
|
72
|
-
keyHex: string;
|
|
73
|
-
saltHex: string;
|
|
74
|
-
}>;
|
|
75
|
-
/**
|
|
76
|
-
* Derives a HEX symmetric key from a user's password and salt
|
|
77
|
-
*
|
|
78
|
-
* @param password - The user's password
|
|
79
|
-
* @param saltHex - The given HEX salt
|
|
80
|
-
* @returns The derived HEX secret key
|
|
81
|
-
*/
|
|
82
|
-
declare function getKeyFromPasswordAndSaltHex(password: string, saltHex: string): Promise<string>;
|
|
83
|
-
/**
|
|
84
|
-
* Verifies the derived key
|
|
85
|
-
*
|
|
86
|
-
* @param password - The user's password
|
|
87
|
-
* @param saltHex - The given HEX salt
|
|
88
|
-
* @param keyHex - The derived HEX key
|
|
89
|
-
* @returns The result of the key verification
|
|
90
|
-
*/
|
|
91
|
-
declare function verifyKeyFromPasswordHex(password: string, saltHex: string, keyHex: string): Promise<boolean>;
|
|
92
19
|
//#endregion
|
|
93
|
-
export {
|
|
20
|
+
export { deriveSymmetricKeyFromContext, deriveSymmetricKeyFromTwoKeys };
|
|
94
21
|
//# sourceMappingURL=derive-key.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derive-key.d.mts","names":[],"sources":["../src/derive-key/deriveKeysFromKey.ts"
|
|
1
|
+
{"version":3,"file":"derive-key.d.mts","names":[],"sources":["../src/derive-key/deriveKeysFromKey.ts"],"mappings":";;AAYA;;;;;;;iBAAgB,6BAAA,CAA8B,OAAA,UAAiB,OAAA,EAAS,UAAA,GAAa,UAAA;;;AAWrF;;;;;iBAAgB,6BAAA,CAA8B,IAAA,EAAM,UAAA,EAAY,IAAA,EAAM,UAAA,GAAa,UAAA"}
|
package/dist/derive-key.d.ts
CHANGED
|
@@ -8,15 +8,6 @@
|
|
|
8
8
|
* @returns The derived secret key
|
|
9
9
|
*/
|
|
10
10
|
declare function deriveSymmetricKeyFromContext(context: string, baseKey: Uint8Array): Uint8Array;
|
|
11
|
-
/**
|
|
12
|
-
* Derives a symmetric CryptoKey from the base key and context string
|
|
13
|
-
*
|
|
14
|
-
* @param context - The context string.
|
|
15
|
-
* The context string should be hardcoded, globally unique, and application-specific.
|
|
16
|
-
* @param baseKey - The base key (NOT PASSWORD!)
|
|
17
|
-
* @returns The derived secret CryptoKey
|
|
18
|
-
*/
|
|
19
|
-
declare function deriveSymmetricCryptoKeyFromContext(context: string, baseKey: Uint8Array): Promise<CryptoKey>;
|
|
20
11
|
/**
|
|
21
12
|
* Derives a symmetric key from two keys
|
|
22
13
|
*
|
|
@@ -25,70 +16,6 @@ declare function deriveSymmetricCryptoKeyFromContext(context: string, baseKey: U
|
|
|
25
16
|
* @returns The derived secret key
|
|
26
17
|
*/
|
|
27
18
|
declare function deriveSymmetricKeyFromTwoKeys(key1: Uint8Array, key2: Uint8Array): Uint8Array;
|
|
28
|
-
/**
|
|
29
|
-
* Derives a symmetric CryptoKey from two keys
|
|
30
|
-
*
|
|
31
|
-
* @param key1 - The 32-bytes key
|
|
32
|
-
* @param key2 - The 32-bytes key
|
|
33
|
-
* @returns The derived secret CryptoKey
|
|
34
|
-
*/
|
|
35
|
-
declare function deriveSymmetricCryptoKeyFromTwoKeys(key1: Uint8Array, key2: Uint8Array): Promise<CryptoKey>;
|
|
36
|
-
/**
|
|
37
|
-
* Derives a symmetric key from two keys and context
|
|
38
|
-
*
|
|
39
|
-
* @param key1 - The 32-bytes key
|
|
40
|
-
* @param key2 - The 32-bytes key
|
|
41
|
-
* @param context - The context string
|
|
42
|
-
* @returns The derived symmetric key
|
|
43
|
-
*/
|
|
44
|
-
declare function deriveSymmetricKeyFromTwoKeysAndContext(key1: Uint8Array, key2: Uint8Array, context: string): Uint8Array;
|
|
45
|
-
//#endregion
|
|
46
|
-
//#region src/derive-key/deriveKeysFromPassword.d.ts
|
|
47
|
-
/**
|
|
48
|
-
* Derives a symmetric key from a user's password with a randomly sampled salt
|
|
49
|
-
*
|
|
50
|
-
* @param password - The user's password
|
|
51
|
-
* @returns The derived secret key and randomly sampled salt
|
|
52
|
-
*/
|
|
53
|
-
declare function getKeyFromPassword(password: string): Promise<{
|
|
54
|
-
key: Uint8Array;
|
|
55
|
-
salt: Uint8Array;
|
|
56
|
-
}>;
|
|
57
|
-
/**
|
|
58
|
-
* Derives a symmetric key from a user's password and salt
|
|
59
|
-
*
|
|
60
|
-
* @param password - The user's password
|
|
61
|
-
* @param salt - The given salt
|
|
62
|
-
* @returns The derived secret key
|
|
63
|
-
*/
|
|
64
|
-
declare function getKeyFromPasswordAndSalt(password: string, salt: Uint8Array): Promise<Uint8Array>;
|
|
65
|
-
/**
|
|
66
|
-
* Derives a HEX symmetric key from a user's password with a randomly sampled salt
|
|
67
|
-
*
|
|
68
|
-
* @param password - The user's password
|
|
69
|
-
* @returns The derived HEX secret key and randomly sampled HEX salt
|
|
70
|
-
*/
|
|
71
|
-
declare function getKeyFromPasswordHex(password: string): Promise<{
|
|
72
|
-
keyHex: string;
|
|
73
|
-
saltHex: string;
|
|
74
|
-
}>;
|
|
75
|
-
/**
|
|
76
|
-
* Derives a HEX symmetric key from a user's password and salt
|
|
77
|
-
*
|
|
78
|
-
* @param password - The user's password
|
|
79
|
-
* @param saltHex - The given HEX salt
|
|
80
|
-
* @returns The derived HEX secret key
|
|
81
|
-
*/
|
|
82
|
-
declare function getKeyFromPasswordAndSaltHex(password: string, saltHex: string): Promise<string>;
|
|
83
|
-
/**
|
|
84
|
-
* Verifies the derived key
|
|
85
|
-
*
|
|
86
|
-
* @param password - The user's password
|
|
87
|
-
* @param saltHex - The given HEX salt
|
|
88
|
-
* @param keyHex - The derived HEX key
|
|
89
|
-
* @returns The result of the key verification
|
|
90
|
-
*/
|
|
91
|
-
declare function verifyKeyFromPasswordHex(password: string, saltHex: string, keyHex: string): Promise<boolean>;
|
|
92
19
|
//#endregion
|
|
93
|
-
export {
|
|
20
|
+
export { deriveSymmetricKeyFromContext, deriveSymmetricKeyFromTwoKeys };
|
|
94
21
|
//# sourceMappingURL=derive-key.d.ts.map
|
package/dist/derive-key.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derive-key.d.ts","names":[],"sources":["../src/derive-key/deriveKeysFromKey.ts"
|
|
1
|
+
{"version":3,"file":"derive-key.d.ts","names":[],"sources":["../src/derive-key/deriveKeysFromKey.ts"],"mappings":";;AAYA;;;;;;;iBAAgB,6BAAA,CAA8B,OAAA,UAAiB,OAAA,EAAS,UAAA,GAAa,UAAA;;;AAWrF;;;;;iBAAgB,6BAAA,CAA8B,IAAA,EAAM,UAAA,EAAY,IAAA,EAAM,UAAA,GAAa,UAAA"}
|
package/dist/derive-key.js
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
2
|
+
const require_deriveKeysFromKey = require('./deriveKeysFromKey-C4McqO6_.js');
|
|
3
3
|
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
6
|
-
exports.deriveSymmetricKeyFromContext = require_deriveKeysFromPassword.deriveSymmetricKeyFromContext;
|
|
7
|
-
exports.deriveSymmetricKeyFromTwoKeys = require_deriveKeysFromPassword.deriveSymmetricKeyFromTwoKeys;
|
|
8
|
-
exports.deriveSymmetricKeyFromTwoKeysAndContext = require_deriveKeysFromPassword.deriveSymmetricKeyFromTwoKeysAndContext;
|
|
9
|
-
exports.getKeyFromPassword = require_deriveKeysFromPassword.getKeyFromPassword;
|
|
10
|
-
exports.getKeyFromPasswordAndSalt = require_deriveKeysFromPassword.getKeyFromPasswordAndSalt;
|
|
11
|
-
exports.getKeyFromPasswordAndSaltHex = require_deriveKeysFromPassword.getKeyFromPasswordAndSaltHex;
|
|
12
|
-
exports.getKeyFromPasswordHex = require_deriveKeysFromPassword.getKeyFromPasswordHex;
|
|
13
|
-
exports.verifyKeyFromPasswordHex = require_deriveKeysFromPassword.verifyKeyFromPasswordHex;
|
|
4
|
+
exports.deriveSymmetricKeyFromContext = require_deriveKeysFromKey.deriveSymmetricKeyFromContext;
|
|
5
|
+
exports.deriveSymmetricKeyFromTwoKeys = require_deriveKeysFromKey.deriveSymmetricKeyFromTwoKeys;
|
package/dist/derive-key.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as deriveSymmetricKeyFromTwoKeys, t as deriveSymmetricKeyFromContext } from "./deriveKeysFromKey-DPU_h7wr.mjs";
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { deriveSymmetricKeyFromContext, deriveSymmetricKeyFromTwoKeys };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/derive-password/deriveKeysFromPassword.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Derives a symmetric key from a user's password with a randomly sampled salt
|
|
4
|
+
*
|
|
5
|
+
* @param password - The user's password
|
|
6
|
+
* @returns The derived secret key and randomly sampled salt
|
|
7
|
+
*/
|
|
8
|
+
declare function getKeyFromPassword(password: string): Promise<{
|
|
9
|
+
key: Uint8Array;
|
|
10
|
+
salt: Uint8Array;
|
|
11
|
+
}>;
|
|
12
|
+
/**
|
|
13
|
+
* Derives a symmetric key from a user's password and salt
|
|
14
|
+
*
|
|
15
|
+
* @param password - The user's password
|
|
16
|
+
* @param salt - The given salt
|
|
17
|
+
* @returns The derived secret key
|
|
18
|
+
*/
|
|
19
|
+
declare function getKeyFromPasswordAndSalt(password: string, salt: Uint8Array): Promise<Uint8Array>;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { getKeyFromPassword, getKeyFromPasswordAndSalt };
|
|
22
|
+
//# sourceMappingURL=derive-password.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derive-password.d.mts","names":[],"sources":["../src/derive-password/deriveKeysFromPassword.ts"],"mappings":";;AAQA;;;;;iBAAsB,kBAAA,CAAmB,QAAA,WAAmB,OAAA;EAAU,GAAA,EAAK,UAAA;EAAY,IAAA,EAAM,UAAA;AAAA;;;;;;;;iBAiBvE,yBAAA,CAA0B,QAAA,UAAkB,IAAA,EAAM,UAAA,GAAa,OAAA,CAAQ,UAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/derive-password/deriveKeysFromPassword.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Derives a symmetric key from a user's password with a randomly sampled salt
|
|
4
|
+
*
|
|
5
|
+
* @param password - The user's password
|
|
6
|
+
* @returns The derived secret key and randomly sampled salt
|
|
7
|
+
*/
|
|
8
|
+
declare function getKeyFromPassword(password: string): Promise<{
|
|
9
|
+
key: Uint8Array;
|
|
10
|
+
salt: Uint8Array;
|
|
11
|
+
}>;
|
|
12
|
+
/**
|
|
13
|
+
* Derives a symmetric key from a user's password and salt
|
|
14
|
+
*
|
|
15
|
+
* @param password - The user's password
|
|
16
|
+
* @param salt - The given salt
|
|
17
|
+
* @returns The derived secret key
|
|
18
|
+
*/
|
|
19
|
+
declare function getKeyFromPasswordAndSalt(password: string, salt: Uint8Array): Promise<Uint8Array>;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { getKeyFromPassword, getKeyFromPasswordAndSalt };
|
|
22
|
+
//# sourceMappingURL=derive-password.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derive-password.d.ts","names":[],"sources":["../src/derive-password/deriveKeysFromPassword.ts"],"mappings":";;AAQA;;;;;iBAAsB,kBAAA,CAAmB,QAAA,WAAmB,OAAA;EAAU,GAAA,EAAK,UAAA;EAAY,IAAA,EAAM,UAAA;AAAA;;;;;;;;iBAiBvE,yBAAA,CAA0B,QAAA,UAAkB,IAAA,EAAM,UAAA,GAAa,OAAA,CAAQ,UAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_deriveKeysFromPassword = require('./deriveKeysFromPassword-C7xAGGsh.js');
|
|
3
|
+
|
|
4
|
+
exports.getKeyFromPassword = require_deriveKeysFromPassword.getKeyFromPassword;
|
|
5
|
+
exports.getKeyFromPasswordAndSalt = require_deriveKeysFromPassword.getKeyFromPasswordAndSalt;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-EbLFQX5m.js');
|
|
2
|
+
const require_constants = require('./constants.js');
|
|
3
|
+
const require_genID = require('./genID-cWOPmspk.js');
|
|
4
|
+
let _noble_hashes_blake3_js = require("@noble/hashes/blake3.js");
|
|
5
|
+
|
|
6
|
+
//#region src/derive-key/deriveKeysFromKey.ts
|
|
7
|
+
/**
|
|
8
|
+
* Derives a symmetric key from the base key and context string
|
|
9
|
+
*
|
|
10
|
+
* @param context - The context string.
|
|
11
|
+
* The context string should be hardcoded, globally unique, and application-specific.
|
|
12
|
+
* @param baseKey - The base key (NOT PASSWORD!)
|
|
13
|
+
* @returns The derived secret key
|
|
14
|
+
*/
|
|
15
|
+
function deriveSymmetricKeyFromContext(context, baseKey) {
|
|
16
|
+
return (0, _noble_hashes_blake3_js.blake3)(baseKey, { context: require_genID.UTF8ToUint8(context) });
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Derives a symmetric key from two keys
|
|
20
|
+
*
|
|
21
|
+
* @param key1 - The 32-bytes key
|
|
22
|
+
* @param key2 - The 32-bytes key
|
|
23
|
+
* @returns The derived secret key
|
|
24
|
+
*/
|
|
25
|
+
function deriveSymmetricKeyFromTwoKeys(key1, key2) {
|
|
26
|
+
try {
|
|
27
|
+
if (key2.length != require_constants.AES_KEY_BYTE_LENGTH || key1.length != require_constants.AES_KEY_BYTE_LENGTH) throw new Error(`Input key length must be exactly ${require_constants.AES_KEY_BYTE_LENGTH} bytes`);
|
|
28
|
+
return deriveSymmetricKeyFromContext(require_constants.CONTEXT_DERIVE, (0, _noble_hashes_blake3_js.blake3)(key1, { key: key2 }));
|
|
29
|
+
} catch (error) {
|
|
30
|
+
throw new Error("Failed to derive symmetric key from two keys and context", { cause: error });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
Object.defineProperty(exports, 'deriveSymmetricKeyFromContext', {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: function () {
|
|
38
|
+
return deriveSymmetricKeyFromContext;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
Object.defineProperty(exports, 'deriveSymmetricKeyFromTwoKeys', {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function () {
|
|
44
|
+
return deriveSymmetricKeyFromTwoKeys;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=deriveKeysFromKey-C4McqO6_.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deriveKeysFromKey-C4McqO6_.js","names":["UTF8ToUint8","AES_KEY_BYTE_LENGTH","CONTEXT_DERIVE"],"sources":["../src/derive-key/deriveKeysFromKey.ts"],"sourcesContent":["import { blake3 } from '@noble/hashes/blake3.js';\nimport { AES_KEY_BYTE_LENGTH, CONTEXT_DERIVE } from '../constants';\nimport { UTF8ToUint8 } from '../utils';\n\n/**\n * Derives a symmetric key from the base key and context string\n *\n * @param context - The context string.\n * The context string should be hardcoded, globally unique, and application-specific.\n * @param baseKey - The base key (NOT PASSWORD!)\n * @returns The derived secret key\n */\nexport function deriveSymmetricKeyFromContext(context: string, baseKey: Uint8Array): Uint8Array {\n return blake3(baseKey, { context: UTF8ToUint8(context) });\n}\n\n/**\n * Derives a symmetric key from two keys\n *\n * @param key1 - The 32-bytes key\n * @param key2 - The 32-bytes key\n * @returns The derived secret key\n */\nexport function deriveSymmetricKeyFromTwoKeys(key1: Uint8Array, key2: Uint8Array): Uint8Array {\n try {\n if (key2.length != AES_KEY_BYTE_LENGTH || key1.length != AES_KEY_BYTE_LENGTH) {\n throw new Error(`Input key length must be exactly ${AES_KEY_BYTE_LENGTH} bytes`);\n }\n const key = blake3(key1, { key: key2 });\n return deriveSymmetricKeyFromContext(CONTEXT_DERIVE, key);\n } catch (error) {\n throw new Error('Failed to derive symmetric key from two keys and context', { cause: error });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAYA,SAAgB,8BAA8B,SAAiB,SAAiC;AAC9F,4CAAc,SAAS,EAAE,SAASA,0BAAY,QAAQ,EAAE,CAAC;;;;;;;;;AAU3D,SAAgB,8BAA8B,MAAkB,MAA8B;AAC5F,KAAI;AACF,MAAI,KAAK,UAAUC,yCAAuB,KAAK,UAAUA,sCACvD,OAAM,IAAI,MAAM,oCAAoCA,sCAAoB,QAAQ;AAGlF,SAAO,8BAA8BC,sEADlB,MAAM,EAAE,KAAK,MAAM,CAAC,CACkB;UAClD,OAAO;AACd,QAAM,IAAI,MAAM,4DAA4D,EAAE,OAAO,OAAO,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { AES_KEY_BYTE_LENGTH, CONTEXT_DERIVE } from "./constants.mjs";
|
|
2
|
+
import { s as UTF8ToUint8 } from "./genID-D08K7JPr.mjs";
|
|
3
|
+
import { blake3 } from "@noble/hashes/blake3.js";
|
|
4
|
+
|
|
5
|
+
//#region src/derive-key/deriveKeysFromKey.ts
|
|
6
|
+
/**
|
|
7
|
+
* Derives a symmetric key from the base key and context string
|
|
8
|
+
*
|
|
9
|
+
* @param context - The context string.
|
|
10
|
+
* The context string should be hardcoded, globally unique, and application-specific.
|
|
11
|
+
* @param baseKey - The base key (NOT PASSWORD!)
|
|
12
|
+
* @returns The derived secret key
|
|
13
|
+
*/
|
|
14
|
+
function deriveSymmetricKeyFromContext(context, baseKey) {
|
|
15
|
+
return blake3(baseKey, { context: UTF8ToUint8(context) });
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Derives a symmetric key from two keys
|
|
19
|
+
*
|
|
20
|
+
* @param key1 - The 32-bytes key
|
|
21
|
+
* @param key2 - The 32-bytes key
|
|
22
|
+
* @returns The derived secret key
|
|
23
|
+
*/
|
|
24
|
+
function deriveSymmetricKeyFromTwoKeys(key1, key2) {
|
|
25
|
+
try {
|
|
26
|
+
if (key2.length != AES_KEY_BYTE_LENGTH || key1.length != AES_KEY_BYTE_LENGTH) throw new Error(`Input key length must be exactly ${AES_KEY_BYTE_LENGTH} bytes`);
|
|
27
|
+
return deriveSymmetricKeyFromContext(CONTEXT_DERIVE, blake3(key1, { key: key2 }));
|
|
28
|
+
} catch (error) {
|
|
29
|
+
throw new Error("Failed to derive symmetric key from two keys and context", { cause: error });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
export { deriveSymmetricKeyFromTwoKeys as n, deriveSymmetricKeyFromContext as t };
|
|
35
|
+
//# sourceMappingURL=deriveKeysFromKey-DPU_h7wr.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deriveKeysFromKey-DPU_h7wr.mjs","names":[],"sources":["../src/derive-key/deriveKeysFromKey.ts"],"sourcesContent":["import { blake3 } from '@noble/hashes/blake3.js';\nimport { AES_KEY_BYTE_LENGTH, CONTEXT_DERIVE } from '../constants';\nimport { UTF8ToUint8 } from '../utils';\n\n/**\n * Derives a symmetric key from the base key and context string\n *\n * @param context - The context string.\n * The context string should be hardcoded, globally unique, and application-specific.\n * @param baseKey - The base key (NOT PASSWORD!)\n * @returns The derived secret key\n */\nexport function deriveSymmetricKeyFromContext(context: string, baseKey: Uint8Array): Uint8Array {\n return blake3(baseKey, { context: UTF8ToUint8(context) });\n}\n\n/**\n * Derives a symmetric key from two keys\n *\n * @param key1 - The 32-bytes key\n * @param key2 - The 32-bytes key\n * @returns The derived secret key\n */\nexport function deriveSymmetricKeyFromTwoKeys(key1: Uint8Array, key2: Uint8Array): Uint8Array {\n try {\n if (key2.length != AES_KEY_BYTE_LENGTH || key1.length != AES_KEY_BYTE_LENGTH) {\n throw new Error(`Input key length must be exactly ${AES_KEY_BYTE_LENGTH} bytes`);\n }\n const key = blake3(key1, { key: key2 });\n return deriveSymmetricKeyFromContext(CONTEXT_DERIVE, key);\n } catch (error) {\n throw new Error('Failed to derive symmetric key from two keys and context', { cause: error });\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAYA,SAAgB,8BAA8B,SAAiB,SAAiC;AAC9F,QAAO,OAAO,SAAS,EAAE,SAAS,YAAY,QAAQ,EAAE,CAAC;;;;;;;;;AAU3D,SAAgB,8BAA8B,MAAkB,MAA8B;AAC5F,KAAI;AACF,MAAI,KAAK,UAAU,uBAAuB,KAAK,UAAU,oBACvD,OAAM,IAAI,MAAM,oCAAoC,oBAAoB,QAAQ;AAGlF,SAAO,8BAA8B,gBADzB,OAAO,MAAM,EAAE,KAAK,MAAM,CAAC,CACkB;UAClD,OAAO;AACd,QAAM,IAAI,MAAM,4DAA4D,EAAE,OAAO,OAAO,CAAC"}
|
|
@@ -1,80 +1,7 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-EbLFQX5m.js');
|
|
2
2
|
const require_constants = require('./constants.js');
|
|
3
|
-
|
|
4
|
-
const require_aes = require('./aes-bOrKZuUC.js');
|
|
5
|
-
let _noble_hashes_blake3_js = require("@noble/hashes/blake3.js");
|
|
3
|
+
let _noble_hashes_utils_js = require("@noble/hashes/utils.js");
|
|
6
4
|
|
|
7
|
-
//#region src/derive-key/deriveKeysFromKey.ts
|
|
8
|
-
/**
|
|
9
|
-
* Derives a symmetric key from the base key and context string
|
|
10
|
-
*
|
|
11
|
-
* @param context - The context string.
|
|
12
|
-
* The context string should be hardcoded, globally unique, and application-specific.
|
|
13
|
-
* @param baseKey - The base key (NOT PASSWORD!)
|
|
14
|
-
* @returns The derived secret key
|
|
15
|
-
*/
|
|
16
|
-
function deriveSymmetricKeyFromContext(context, baseKey) {
|
|
17
|
-
return (0, _noble_hashes_blake3_js.blake3)(baseKey, { context: require_genID.UTF8ToUint8(context) });
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Derives a symmetric CryptoKey from the base key and context string
|
|
21
|
-
*
|
|
22
|
-
* @param context - The context string.
|
|
23
|
-
* The context string should be hardcoded, globally unique, and application-specific.
|
|
24
|
-
* @param baseKey - The base key (NOT PASSWORD!)
|
|
25
|
-
* @returns The derived secret CryptoKey
|
|
26
|
-
*/
|
|
27
|
-
async function deriveSymmetricCryptoKeyFromContext(context, baseKey) {
|
|
28
|
-
try {
|
|
29
|
-
if (baseKey.length != require_constants.AES_KEY_BIT_LENGTH / 8) throw new Error(`Base key length must be exactly ${require_constants.AES_KEY_BIT_LENGTH / 8} bytes`);
|
|
30
|
-
if (!context) throw new Error("Context is empry");
|
|
31
|
-
return await require_aes.importSymmetricCryptoKey(deriveSymmetricKeyFromContext(context, baseKey));
|
|
32
|
-
} catch (error) {
|
|
33
|
-
throw new Error("Failed to derive CryptoKey from base key and context", { cause: error });
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Derives a symmetric key from two keys
|
|
38
|
-
*
|
|
39
|
-
* @param key1 - The 32-bytes key
|
|
40
|
-
* @param key2 - The 32-bytes key
|
|
41
|
-
* @returns The derived secret key
|
|
42
|
-
*/
|
|
43
|
-
function deriveSymmetricKeyFromTwoKeys(key1, key2) {
|
|
44
|
-
return deriveSymmetricKeyFromTwoKeysAndContext(key1, key2, require_constants.CONTEXT_DERIVE);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Derives a symmetric CryptoKey from two keys
|
|
48
|
-
*
|
|
49
|
-
* @param key1 - The 32-bytes key
|
|
50
|
-
* @param key2 - The 32-bytes key
|
|
51
|
-
* @returns The derived secret CryptoKey
|
|
52
|
-
*/
|
|
53
|
-
async function deriveSymmetricCryptoKeyFromTwoKeys(key1, key2) {
|
|
54
|
-
try {
|
|
55
|
-
return await require_aes.importSymmetricCryptoKey(deriveSymmetricKeyFromTwoKeys(key1, key2));
|
|
56
|
-
} catch (error) {
|
|
57
|
-
throw new Error("Failed to derive symmetric CryptoKey from two keys", { cause: error });
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Derives a symmetric key from two keys and context
|
|
62
|
-
*
|
|
63
|
-
* @param key1 - The 32-bytes key
|
|
64
|
-
* @param key2 - The 32-bytes key
|
|
65
|
-
* @param context - The context string
|
|
66
|
-
* @returns The derived symmetric key
|
|
67
|
-
*/
|
|
68
|
-
function deriveSymmetricKeyFromTwoKeysAndContext(key1, key2, context) {
|
|
69
|
-
try {
|
|
70
|
-
if (key2.length != require_constants.AES_KEY_BIT_LENGTH / 8 || key1.length != require_constants.AES_KEY_BIT_LENGTH / 8) throw new Error(`Input key length must be exactly ${require_constants.AES_KEY_BIT_LENGTH / 8} bytes`);
|
|
71
|
-
return (0, _noble_hashes_blake3_js.blake3)((0, _noble_hashes_blake3_js.blake3)(key1, { key: key2 }), { context: require_genID.UTF8ToUint8(context) });
|
|
72
|
-
} catch (error) {
|
|
73
|
-
throw new Error("Failed to derive symmetric key from two keys and context", { cause: error });
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
//#endregion
|
|
78
5
|
//#region node_modules/hash-wasm/dist/index.umd.js
|
|
79
6
|
var require_index_umd = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
80
7
|
/*!
|
|
@@ -2310,7 +2237,7 @@ var require_index_umd = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, m
|
|
|
2310
2237
|
}));
|
|
2311
2238
|
|
|
2312
2239
|
//#endregion
|
|
2313
|
-
//#region src/derive-
|
|
2240
|
+
//#region src/derive-password/core.ts
|
|
2314
2241
|
var import_index_umd = require_index_umd();
|
|
2315
2242
|
/**
|
|
2316
2243
|
* Calculates hash using the argon2id password-hashing function
|
|
@@ -2340,17 +2267,11 @@ async function argon2(password, salt, parallelism = require_constants.ARGON2ID_P
|
|
|
2340
2267
|
* @returns The salt
|
|
2341
2268
|
*/
|
|
2342
2269
|
function sampleSalt() {
|
|
2343
|
-
|
|
2344
|
-
const salt = new Uint8Array(require_constants.ARGON2ID_SALT_BYTE_LENGTH);
|
|
2345
|
-
crypto.getRandomValues(salt);
|
|
2346
|
-
return salt;
|
|
2347
|
-
} catch (error) {
|
|
2348
|
-
throw new Error("Failed to sample salt", { cause: error });
|
|
2349
|
-
}
|
|
2270
|
+
return (0, _noble_hashes_utils_js.randomBytes)(require_constants.ARGON2ID_SALT_BYTE_LENGTH);
|
|
2350
2271
|
}
|
|
2351
2272
|
|
|
2352
2273
|
//#endregion
|
|
2353
|
-
//#region src/derive-
|
|
2274
|
+
//#region src/derive-password/deriveKeysFromPassword.ts
|
|
2354
2275
|
/**
|
|
2355
2276
|
* Derives a symmetric key from a user's password with a randomly sampled salt
|
|
2356
2277
|
*
|
|
@@ -2359,7 +2280,6 @@ function sampleSalt() {
|
|
|
2359
2280
|
*/
|
|
2360
2281
|
async function getKeyFromPassword(password) {
|
|
2361
2282
|
try {
|
|
2362
|
-
if (!password) throw new Error("No password given");
|
|
2363
2283
|
const salt = sampleSalt();
|
|
2364
2284
|
return {
|
|
2365
2285
|
key: await argon2(password, salt),
|
|
@@ -2378,87 +2298,13 @@ async function getKeyFromPassword(password) {
|
|
|
2378
2298
|
*/
|
|
2379
2299
|
async function getKeyFromPasswordAndSalt(password, salt) {
|
|
2380
2300
|
try {
|
|
2381
|
-
if (!salt.length) throw new Error("No salt given");
|
|
2382
|
-
if (!password) throw new Error("No password given");
|
|
2383
2301
|
return await argon2(password, salt);
|
|
2384
2302
|
} catch (error) {
|
|
2385
2303
|
throw new Error("Failed to derive key from password and salt", { cause: error });
|
|
2386
2304
|
}
|
|
2387
2305
|
}
|
|
2388
|
-
/**
|
|
2389
|
-
* Derives a HEX symmetric key from a user's password with a randomly sampled salt
|
|
2390
|
-
*
|
|
2391
|
-
* @param password - The user's password
|
|
2392
|
-
* @returns The derived HEX secret key and randomly sampled HEX salt
|
|
2393
|
-
*/
|
|
2394
|
-
async function getKeyFromPasswordHex(password) {
|
|
2395
|
-
try {
|
|
2396
|
-
const { key, salt } = await getKeyFromPassword(password);
|
|
2397
|
-
return {
|
|
2398
|
-
keyHex: require_genID.uint8ArrayToHex(key),
|
|
2399
|
-
saltHex: require_genID.uint8ArrayToHex(salt)
|
|
2400
|
-
};
|
|
2401
|
-
} catch (error) {
|
|
2402
|
-
throw new Error("Failed to derive key from password", { cause: error });
|
|
2403
|
-
}
|
|
2404
|
-
}
|
|
2405
|
-
/**
|
|
2406
|
-
* Derives a HEX symmetric key from a user's password and salt
|
|
2407
|
-
*
|
|
2408
|
-
* @param password - The user's password
|
|
2409
|
-
* @param saltHex - The given HEX salt
|
|
2410
|
-
* @returns The derived HEX secret key
|
|
2411
|
-
*/
|
|
2412
|
-
async function getKeyFromPasswordAndSaltHex(password, saltHex) {
|
|
2413
|
-
try {
|
|
2414
|
-
return require_genID.uint8ArrayToHex(await getKeyFromPasswordAndSalt(password, require_genID.hexToUint8Array(saltHex)));
|
|
2415
|
-
} catch (error) {
|
|
2416
|
-
throw new Error("Failed to derive key from password and salt", { cause: error });
|
|
2417
|
-
}
|
|
2418
|
-
}
|
|
2419
|
-
/**
|
|
2420
|
-
* Verifies the derived key
|
|
2421
|
-
*
|
|
2422
|
-
* @param password - The user's password
|
|
2423
|
-
* @param saltHex - The given HEX salt
|
|
2424
|
-
* @param keyHex - The derived HEX key
|
|
2425
|
-
* @returns The result of the key verification
|
|
2426
|
-
*/
|
|
2427
|
-
async function verifyKeyFromPasswordHex(password, saltHex, keyHex) {
|
|
2428
|
-
return keyHex === await getKeyFromPasswordAndSaltHex(password, saltHex);
|
|
2429
|
-
}
|
|
2430
2306
|
|
|
2431
2307
|
//#endregion
|
|
2432
|
-
Object.defineProperty(exports, 'deriveSymmetricCryptoKeyFromContext', {
|
|
2433
|
-
enumerable: true,
|
|
2434
|
-
get: function () {
|
|
2435
|
-
return deriveSymmetricCryptoKeyFromContext;
|
|
2436
|
-
}
|
|
2437
|
-
});
|
|
2438
|
-
Object.defineProperty(exports, 'deriveSymmetricCryptoKeyFromTwoKeys', {
|
|
2439
|
-
enumerable: true,
|
|
2440
|
-
get: function () {
|
|
2441
|
-
return deriveSymmetricCryptoKeyFromTwoKeys;
|
|
2442
|
-
}
|
|
2443
|
-
});
|
|
2444
|
-
Object.defineProperty(exports, 'deriveSymmetricKeyFromContext', {
|
|
2445
|
-
enumerable: true,
|
|
2446
|
-
get: function () {
|
|
2447
|
-
return deriveSymmetricKeyFromContext;
|
|
2448
|
-
}
|
|
2449
|
-
});
|
|
2450
|
-
Object.defineProperty(exports, 'deriveSymmetricKeyFromTwoKeys', {
|
|
2451
|
-
enumerable: true,
|
|
2452
|
-
get: function () {
|
|
2453
|
-
return deriveSymmetricKeyFromTwoKeys;
|
|
2454
|
-
}
|
|
2455
|
-
});
|
|
2456
|
-
Object.defineProperty(exports, 'deriveSymmetricKeyFromTwoKeysAndContext', {
|
|
2457
|
-
enumerable: true,
|
|
2458
|
-
get: function () {
|
|
2459
|
-
return deriveSymmetricKeyFromTwoKeysAndContext;
|
|
2460
|
-
}
|
|
2461
|
-
});
|
|
2462
2308
|
Object.defineProperty(exports, 'getKeyFromPassword', {
|
|
2463
2309
|
enumerable: true,
|
|
2464
2310
|
get: function () {
|
|
@@ -2471,22 +2317,4 @@ Object.defineProperty(exports, 'getKeyFromPasswordAndSalt', {
|
|
|
2471
2317
|
return getKeyFromPasswordAndSalt;
|
|
2472
2318
|
}
|
|
2473
2319
|
});
|
|
2474
|
-
|
|
2475
|
-
enumerable: true,
|
|
2476
|
-
get: function () {
|
|
2477
|
-
return getKeyFromPasswordAndSaltHex;
|
|
2478
|
-
}
|
|
2479
|
-
});
|
|
2480
|
-
Object.defineProperty(exports, 'getKeyFromPasswordHex', {
|
|
2481
|
-
enumerable: true,
|
|
2482
|
-
get: function () {
|
|
2483
|
-
return getKeyFromPasswordHex;
|
|
2484
|
-
}
|
|
2485
|
-
});
|
|
2486
|
-
Object.defineProperty(exports, 'verifyKeyFromPasswordHex', {
|
|
2487
|
-
enumerable: true,
|
|
2488
|
-
get: function () {
|
|
2489
|
-
return verifyKeyFromPasswordHex;
|
|
2490
|
-
}
|
|
2491
|
-
});
|
|
2492
|
-
//# sourceMappingURL=deriveKeysFromPassword-Ko7NxkHM.js.map
|
|
2320
|
+
//# sourceMappingURL=deriveKeysFromPassword-C7xAGGsh.js.map
|