internxt-crypto 0.0.9-alpha → 0.0.10-alpha

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.
Files changed (99) hide show
  1. package/dist/asymmetric-crypto.d.mts +41 -0
  2. package/dist/asymmetric-crypto.d.ts +41 -0
  3. package/dist/asymmetric-crypto.js +92 -0
  4. package/dist/asymmetric-crypto.js.map +1 -0
  5. package/dist/asymmetric-crypto.mjs +85 -0
  6. package/dist/asymmetric-crypto.mjs.map +1 -0
  7. package/dist/constants.d.mts +39 -0
  8. package/dist/constants.d.ts +39 -0
  9. package/dist/constants.js +80 -0
  10. package/dist/constants.js.map +1 -0
  11. package/dist/constants.mjs +42 -0
  12. package/dist/constants.mjs.map +1 -0
  13. package/dist/derive-key.d.mts +91 -0
  14. package/dist/derive-key.d.ts +91 -0
  15. package/dist/derive-key.js +795 -0
  16. package/dist/derive-key.js.map +1 -0
  17. package/dist/derive-key.mjs +784 -0
  18. package/dist/derive-key.mjs.map +1 -0
  19. package/dist/email-crypto.d.mts +106 -0
  20. package/dist/email-crypto.d.ts +106 -0
  21. package/dist/email-crypto.js +1409 -0
  22. package/dist/email-crypto.js.map +1 -0
  23. package/dist/email-crypto.mjs +1381 -0
  24. package/dist/email-crypto.mjs.map +1 -0
  25. package/dist/email-search.d.mts +228 -0
  26. package/dist/email-search.d.ts +228 -0
  27. package/dist/email-search.js +605 -0
  28. package/dist/email-search.js.map +1 -0
  29. package/dist/email-search.mjs +580 -0
  30. package/dist/email-search.mjs.map +1 -0
  31. package/dist/email-service.d.mts +38 -0
  32. package/dist/email-service.d.ts +38 -0
  33. package/dist/email-service.js +154 -0
  34. package/dist/email-service.js.map +1 -0
  35. package/dist/email-service.mjs +147 -0
  36. package/dist/email-service.mjs.map +1 -0
  37. package/dist/hash.d.mts +59 -0
  38. package/dist/hash.d.ts +59 -0
  39. package/dist/hash.js +95 -0
  40. package/dist/hash.js.map +1 -0
  41. package/dist/hash.mjs +85 -0
  42. package/dist/hash.mjs.map +1 -0
  43. package/dist/index.d.mts +35 -0
  44. package/dist/index.d.ts +35 -0
  45. package/dist/index.js +2697 -2054
  46. package/dist/index.js.map +1 -1
  47. package/dist/index.mjs +2073 -8247
  48. package/dist/index.mjs.map +1 -1
  49. package/dist/keystore-crypto.d.mts +66 -0
  50. package/dist/keystore-crypto.d.ts +66 -0
  51. package/dist/keystore-crypto.js +530 -0
  52. package/dist/keystore-crypto.js.map +1 -0
  53. package/dist/keystore-crypto.mjs +501 -0
  54. package/dist/keystore-crypto.mjs.map +1 -0
  55. package/dist/keystore-service.d.mts +82 -0
  56. package/dist/keystore-service.d.ts +82 -0
  57. package/dist/keystore-service.js +349 -0
  58. package/dist/keystore-service.js.map +1 -0
  59. package/dist/keystore-service.mjs +342 -0
  60. package/dist/keystore-service.mjs.map +1 -0
  61. package/dist/kyber768-B87rMQ7u.d.mts +30 -0
  62. package/dist/kyber768-B87rMQ7u.d.ts +30 -0
  63. package/dist/post-quantum-crypto.d.mts +72 -0
  64. package/dist/post-quantum-crypto.d.ts +72 -0
  65. package/dist/post-quantum-crypto.js +96 -0
  66. package/dist/post-quantum-crypto.js.map +1 -0
  67. package/dist/post-quantum-crypto.mjs +90 -0
  68. package/dist/post-quantum-crypto.mjs.map +1 -0
  69. package/dist/storage-service.d.mts +53 -0
  70. package/dist/storage-service.d.ts +53 -0
  71. package/dist/storage-service.js +70 -0
  72. package/dist/storage-service.js.map +1 -0
  73. package/dist/storage-service.mjs +67 -0
  74. package/dist/storage-service.mjs.map +1 -0
  75. package/dist/symmetric-crypto.d.mts +56 -0
  76. package/dist/symmetric-crypto.d.ts +56 -0
  77. package/dist/symmetric-crypto.js +142 -0
  78. package/dist/symmetric-crypto.js.map +1 -0
  79. package/dist/symmetric-crypto.mjs +134 -0
  80. package/dist/symmetric-crypto.mjs.map +1 -0
  81. package/dist/types.d.mts +102 -0
  82. package/dist/types.d.ts +102 -0
  83. package/dist/types.js +14 -0
  84. package/dist/types.js.map +1 -0
  85. package/dist/types.mjs +12 -0
  86. package/dist/types.mjs.map +1 -0
  87. package/dist/utils-BDaK_d6T.d.ts +114 -0
  88. package/dist/utils-v34IRTIx.d.mts +114 -0
  89. package/dist/utils.d.mts +140 -0
  90. package/dist/utils.d.ts +140 -0
  91. package/dist/utils.js +313 -0
  92. package/dist/utils.js.map +1 -0
  93. package/dist/utils.mjs +273 -0
  94. package/dist/utils.mjs.map +1 -0
  95. package/package.json +83 -7
  96. package/dist/__vite-browser-external-Dyvby5gX.js +0 -2
  97. package/dist/__vite-browser-external-Dyvby5gX.js.map +0 -1
  98. package/dist/__vite-browser-external-l0sNRNKZ.mjs +0 -2
  99. package/dist/__vite-browser-external-l0sNRNKZ.mjs.map +0 -1
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Derives a symmetric key from the base key and context string
3
+ *
4
+ * @param context - The context string.
5
+ * The context string should be hardcoded, globally unique, and application-specific.
6
+ * @param baseKey - The base key (NOT PASSWORD!)
7
+ * @returns The derived secret key
8
+ */
9
+ declare function deriveSymmetricKeyFromContext(context: string, baseKey: Uint8Array): Uint8Array;
10
+ /**
11
+ * Derives a symmetric CryptoKey from the base key and context string
12
+ *
13
+ * @param context - The context string.
14
+ * The context string should be hardcoded, globally unique, and application-specific.
15
+ * @param baseKey - The base key (NOT PASSWORD!)
16
+ * @returns The derived secret CryptoKey
17
+ */
18
+ declare function deriveSymmetricCryptoKeyFromContext(context: string, baseKey: Uint8Array): Promise<CryptoKey>;
19
+ /**
20
+ * Derives a symmetric key from two keys
21
+ *
22
+ * @param key1 - The 32-bytes key
23
+ * @param key2 - The 32-bytes key
24
+ * @returns The derived secret key
25
+ */
26
+ declare function deriveSymmetricKeyFromTwoKeys(key1: Uint8Array, key2: Uint8Array): Uint8Array;
27
+ /**
28
+ * Derives a symmetric CryptoKey from two keys
29
+ *
30
+ * @param key1 - The 32-bytes key
31
+ * @param key2 - The 32-bytes key
32
+ * @returns The derived secret CryptoKey
33
+ */
34
+ declare function deriveSymmetricCryptoKeyFromTwoKeys(key1: Uint8Array, key2: Uint8Array): Promise<CryptoKey>;
35
+ /**
36
+ * Derives a symmetric key from two keys and context
37
+ *
38
+ * @param key1 - The 32-bytes key
39
+ * @param key2 - The 32-bytes key
40
+ * @param context - The context string
41
+ * @returns The derived symmetric key
42
+ */
43
+ declare function deriveKeyFromTwoKeysAndContext(key1: Uint8Array, key2: Uint8Array, context: string): Uint8Array;
44
+
45
+ /**
46
+ * Derives a symmetric key from a user's password with a randomly sampled salt
47
+ *
48
+ * @param password - The user's password
49
+ * @returns The derived secret key and randomly sampled salt
50
+ */
51
+ declare function getKeyFromPassword(password: string): Promise<{
52
+ key: Uint8Array;
53
+ salt: Uint8Array;
54
+ }>;
55
+ /**
56
+ * Derives a symmetric key from a user's password and salt
57
+ *
58
+ * @param password - The user's password
59
+ * @param salt - The given salt
60
+ * @returns The derived secret key
61
+ */
62
+ declare function getKeyFromPasswordAndSalt(password: string, salt: Uint8Array): Promise<Uint8Array>;
63
+ /**
64
+ * Derives a HEX symmetric key from a user's password with a randomly sampled salt
65
+ *
66
+ * @param password - The user's password
67
+ * @returns The derived HEX secret key and randomly sampled HEX salt
68
+ */
69
+ declare function getKeyFromPasswordHex(password: string): Promise<{
70
+ keyHex: string;
71
+ saltHex: string;
72
+ }>;
73
+ /**
74
+ * Derives a HEX symmetric key from a user's password and salt
75
+ *
76
+ * @param password - The user's password
77
+ * @param saltHex - The given HEX salt
78
+ * @returns The derived HEX secret key
79
+ */
80
+ declare function getKeyFromPasswordAndSaltHex(password: string, saltHex: string): Promise<string>;
81
+ /**
82
+ * Verifies the derived key
83
+ *
84
+ * @param password - The user's password
85
+ * @param saltHex - The given HEX salt
86
+ * @param keyHex - The derived HEX key
87
+ * @returns The result of the key verification
88
+ */
89
+ declare function verifyKeyFromPasswordHex(password: string, saltHex: string, keyHex: string): Promise<boolean>;
90
+
91
+ export { deriveKeyFromTwoKeysAndContext, deriveSymmetricCryptoKeyFromContext, deriveSymmetricCryptoKeyFromTwoKeys, deriveSymmetricKeyFromContext, deriveSymmetricKeyFromTwoKeys, getKeyFromPassword, getKeyFromPasswordAndSalt, getKeyFromPasswordAndSaltHex, getKeyFromPasswordHex, verifyKeyFromPasswordHex };