@digitaldefiance/node-ecies-lib 4.4.23 → 4.5.17

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 (321) hide show
  1. package/package.json +14 -2
  2. package/src/builders/ecies-builder.d.ts +0 -11
  3. package/src/builders/ecies-builder.d.ts.map +0 -1
  4. package/src/builders/ecies-builder.js +0 -26
  5. package/src/builders/ecies-builder.js.map +0 -1
  6. package/src/builders/index.d.ts +0 -3
  7. package/src/builders/index.d.ts.map +0 -1
  8. package/src/builders/index.js +0 -6
  9. package/src/builders/index.js.map +0 -1
  10. package/src/builders/member-builder.d.ts +0 -47
  11. package/src/builders/member-builder.d.ts.map +0 -1
  12. package/src/builders/member-builder.js +0 -99
  13. package/src/builders/member-builder.js.map +0 -1
  14. package/src/constants.d.ts +0 -38
  15. package/src/constants.d.ts.map +0 -1
  16. package/src/constants.js +0 -191
  17. package/src/constants.js.map +0 -1
  18. package/src/core/errors/crypto-error.d.ts +0 -6
  19. package/src/core/errors/crypto-error.d.ts.map +0 -1
  20. package/src/core/errors/crypto-error.js +0 -15
  21. package/src/core/errors/crypto-error.js.map +0 -1
  22. package/src/core/index.d.ts +0 -3
  23. package/src/core/index.d.ts.map +0 -1
  24. package/src/core/index.js +0 -6
  25. package/src/core/index.js.map +0 -1
  26. package/src/core/types/result.d.ts +0 -8
  27. package/src/core/types/result.d.ts.map +0 -1
  28. package/src/core/types/result.js +0 -3
  29. package/src/core/types/result.js.map +0 -1
  30. package/src/enumerations/index.d.ts +0 -2
  31. package/src/enumerations/index.d.ts.map +0 -1
  32. package/src/enumerations/index.js +0 -5
  33. package/src/enumerations/index.js.map +0 -1
  34. package/src/enumerations/pbkdf2-profile.d.ts +0 -9
  35. package/src/enumerations/pbkdf2-profile.d.ts.map +0 -1
  36. package/src/enumerations/pbkdf2-profile.js +0 -13
  37. package/src/enumerations/pbkdf2-profile.js.map +0 -1
  38. package/src/i18n/ecies-i18n-factory.d.ts +0 -28
  39. package/src/i18n/ecies-i18n-factory.d.ts.map +0 -1
  40. package/src/i18n/ecies-i18n-factory.js +0 -90
  41. package/src/i18n/ecies-i18n-factory.js.map +0 -1
  42. package/src/i18n/index.d.ts +0 -3
  43. package/src/i18n/index.d.ts.map +0 -1
  44. package/src/i18n/index.js +0 -8
  45. package/src/i18n/index.js.map +0 -1
  46. package/src/i18n/node-ecies-i18n-setup.d.ts +0 -5
  47. package/src/i18n/node-ecies-i18n-setup.d.ts.map +0 -1
  48. package/src/i18n/node-ecies-i18n-setup.js +0 -48
  49. package/src/i18n/node-ecies-i18n-setup.js.map +0 -1
  50. package/src/i18n/node-keys.d.ts +0 -57
  51. package/src/i18n/node-keys.d.ts.map +0 -1
  52. package/src/i18n/node-keys.js +0 -67
  53. package/src/i18n/node-keys.js.map +0 -1
  54. package/src/i18n/translations/de.d.ts +0 -3
  55. package/src/i18n/translations/de.d.ts.map +0 -1
  56. package/src/i18n/translations/de.js +0 -57
  57. package/src/i18n/translations/de.js.map +0 -1
  58. package/src/i18n/translations/en-GB.d.ts +0 -3
  59. package/src/i18n/translations/en-GB.d.ts.map +0 -1
  60. package/src/i18n/translations/en-GB.js +0 -61
  61. package/src/i18n/translations/en-GB.js.map +0 -1
  62. package/src/i18n/translations/en-US.d.ts +0 -6
  63. package/src/i18n/translations/en-US.d.ts.map +0 -1
  64. package/src/i18n/translations/en-US.js +0 -65
  65. package/src/i18n/translations/en-US.js.map +0 -1
  66. package/src/i18n/translations/es.d.ts +0 -3
  67. package/src/i18n/translations/es.d.ts.map +0 -1
  68. package/src/i18n/translations/es.js +0 -57
  69. package/src/i18n/translations/es.js.map +0 -1
  70. package/src/i18n/translations/fr.d.ts +0 -3
  71. package/src/i18n/translations/fr.d.ts.map +0 -1
  72. package/src/i18n/translations/fr.js +0 -57
  73. package/src/i18n/translations/fr.js.map +0 -1
  74. package/src/i18n/translations/index.d.ts +0 -9
  75. package/src/i18n/translations/index.d.ts.map +0 -1
  76. package/src/i18n/translations/index.js +0 -20
  77. package/src/i18n/translations/index.js.map +0 -1
  78. package/src/i18n/translations/ja.d.ts +0 -3
  79. package/src/i18n/translations/ja.d.ts.map +0 -1
  80. package/src/i18n/translations/ja.js +0 -57
  81. package/src/i18n/translations/ja.js.map +0 -1
  82. package/src/i18n/translations/uk.d.ts +0 -3
  83. package/src/i18n/translations/uk.d.ts.map +0 -1
  84. package/src/i18n/translations/uk.js +0 -57
  85. package/src/i18n/translations/uk.js.map +0 -1
  86. package/src/i18n/translations/zh-cn.d.ts +0 -3
  87. package/src/i18n/translations/zh-cn.d.ts.map +0 -1
  88. package/src/i18n/translations/zh-cn.js +0 -57
  89. package/src/i18n/translations/zh-cn.js.map +0 -1
  90. package/src/index.d.ts +0 -17
  91. package/src/index.d.ts.map +0 -1
  92. package/src/index.js +0 -30
  93. package/src/index.js.map +0 -1
  94. package/src/interfaces/authenticated-cipher.d.ts +0 -12
  95. package/src/interfaces/authenticated-cipher.d.ts.map +0 -1
  96. package/src/interfaces/authenticated-cipher.js +0 -3
  97. package/src/interfaces/authenticated-cipher.js.map +0 -1
  98. package/src/interfaces/authenticated-decipher.d.ts +0 -11
  99. package/src/interfaces/authenticated-decipher.d.ts.map +0 -1
  100. package/src/interfaces/authenticated-decipher.js +0 -3
  101. package/src/interfaces/authenticated-decipher.js.map +0 -1
  102. package/src/interfaces/backend-member-operational.d.ts +0 -48
  103. package/src/interfaces/backend-member-operational.d.ts.map +0 -1
  104. package/src/interfaces/backend-member-operational.js +0 -3
  105. package/src/interfaces/backend-member-operational.js.map +0 -1
  106. package/src/interfaces/checksum-config.d.ts +0 -5
  107. package/src/interfaces/checksum-config.d.ts.map +0 -1
  108. package/src/interfaces/checksum-config.js +0 -3
  109. package/src/interfaces/checksum-config.js.map +0 -1
  110. package/src/interfaces/checksum-consts.d.ts +0 -11
  111. package/src/interfaces/checksum-consts.d.ts.map +0 -1
  112. package/src/interfaces/checksum-consts.js +0 -3
  113. package/src/interfaces/checksum-consts.js.map +0 -1
  114. package/src/interfaces/constants.d.ts +0 -52
  115. package/src/interfaces/constants.d.ts.map +0 -1
  116. package/src/interfaces/constants.js +0 -3
  117. package/src/interfaces/constants.js.map +0 -1
  118. package/src/interfaces/ecies-consts.d.ts +0 -88
  119. package/src/interfaces/ecies-consts.d.ts.map +0 -1
  120. package/src/interfaces/ecies-consts.js +0 -3
  121. package/src/interfaces/ecies-consts.js.map +0 -1
  122. package/src/interfaces/encrypted-chunk.d.ts +0 -12
  123. package/src/interfaces/encrypted-chunk.d.ts.map +0 -1
  124. package/src/interfaces/encrypted-chunk.js +0 -3
  125. package/src/interfaces/encrypted-chunk.js.map +0 -1
  126. package/src/interfaces/encryption-consts.d.ts +0 -11
  127. package/src/interfaces/encryption-consts.d.ts.map +0 -1
  128. package/src/interfaces/encryption-consts.js +0 -3
  129. package/src/interfaces/encryption-consts.js.map +0 -1
  130. package/src/interfaces/index.d.ts +0 -29
  131. package/src/interfaces/index.d.ts.map +0 -1
  132. package/src/interfaces/index.js +0 -30
  133. package/src/interfaces/index.js.map +0 -1
  134. package/src/interfaces/keypair-buffer-with-un-encrypted-private-key.d.ts +0 -6
  135. package/src/interfaces/keypair-buffer-with-un-encrypted-private-key.d.ts.map +0 -1
  136. package/src/interfaces/keypair-buffer-with-un-encrypted-private-key.js +0 -3
  137. package/src/interfaces/keypair-buffer-with-un-encrypted-private-key.js.map +0 -1
  138. package/src/interfaces/keyring-consts.d.ts +0 -6
  139. package/src/interfaces/keyring-consts.d.ts.map +0 -1
  140. package/src/interfaces/keyring-consts.js +0 -3
  141. package/src/interfaces/keyring-consts.js.map +0 -1
  142. package/src/interfaces/member-with-mnemonic.d.ts +0 -7
  143. package/src/interfaces/member-with-mnemonic.d.ts.map +0 -1
  144. package/src/interfaces/member-with-mnemonic.js +0 -3
  145. package/src/interfaces/member-with-mnemonic.js.map +0 -1
  146. package/src/interfaces/member.d.ts +0 -47
  147. package/src/interfaces/member.d.ts.map +0 -1
  148. package/src/interfaces/member.js +0 -3
  149. package/src/interfaces/member.js.map +0 -1
  150. package/src/interfaces/multi-encrypted-message.d.ts +0 -8
  151. package/src/interfaces/multi-encrypted-message.d.ts.map +0 -1
  152. package/src/interfaces/multi-encrypted-message.js +0 -3
  153. package/src/interfaces/multi-encrypted-message.js.map +0 -1
  154. package/src/interfaces/multi-encrypted-parsed-header.d.ts +0 -27
  155. package/src/interfaces/multi-encrypted-parsed-header.d.ts.map +0 -1
  156. package/src/interfaces/multi-encrypted-parsed-header.js +0 -3
  157. package/src/interfaces/multi-encrypted-parsed-header.js.map +0 -1
  158. package/src/interfaces/multi-recipient-chunk.d.ts +0 -26
  159. package/src/interfaces/multi-recipient-chunk.d.ts.map +0 -1
  160. package/src/interfaces/multi-recipient-chunk.js +0 -15
  161. package/src/interfaces/multi-recipient-chunk.js.map +0 -1
  162. package/src/interfaces/pbkdf-profiles.d.ts +0 -6
  163. package/src/interfaces/pbkdf-profiles.d.ts.map +0 -1
  164. package/src/interfaces/pbkdf-profiles.js +0 -3
  165. package/src/interfaces/pbkdf-profiles.js.map +0 -1
  166. package/src/interfaces/pbkdf2-result.d.ts +0 -6
  167. package/src/interfaces/pbkdf2-result.d.ts.map +0 -1
  168. package/src/interfaces/pbkdf2-result.js +0 -3
  169. package/src/interfaces/pbkdf2-result.js.map +0 -1
  170. package/src/interfaces/signing-key-private-key-info.d.ts +0 -11
  171. package/src/interfaces/signing-key-private-key-info.d.ts.map +0 -1
  172. package/src/interfaces/signing-key-private-key-info.js +0 -3
  173. package/src/interfaces/signing-key-private-key-info.js.map +0 -1
  174. package/src/interfaces/simple-keypair-buffer.d.ts +0 -6
  175. package/src/interfaces/simple-keypair-buffer.d.ts.map +0 -1
  176. package/src/interfaces/simple-keypair-buffer.js +0 -3
  177. package/src/interfaces/simple-keypair-buffer.js.map +0 -1
  178. package/src/interfaces/simple-keypair.d.ts +0 -6
  179. package/src/interfaces/simple-keypair.d.ts.map +0 -1
  180. package/src/interfaces/simple-keypair.js +0 -3
  181. package/src/interfaces/simple-keypair.js.map +0 -1
  182. package/src/interfaces/simple-public-key-only-buffer.d.ts +0 -4
  183. package/src/interfaces/simple-public-key-only-buffer.d.ts.map +0 -1
  184. package/src/interfaces/simple-public-key-only-buffer.js +0 -3
  185. package/src/interfaces/simple-public-key-only-buffer.js.map +0 -1
  186. package/src/interfaces/simple-public-key-only.d.ts +0 -4
  187. package/src/interfaces/simple-public-key-only.d.ts.map +0 -1
  188. package/src/interfaces/simple-public-key-only.js +0 -3
  189. package/src/interfaces/simple-public-key-only.js.map +0 -1
  190. package/src/interfaces/single-encrypted-parsed-header.d.ts +0 -35
  191. package/src/interfaces/single-encrypted-parsed-header.d.ts.map +0 -1
  192. package/src/interfaces/single-encrypted-parsed-header.js +0 -3
  193. package/src/interfaces/single-encrypted-parsed-header.js.map +0 -1
  194. package/src/interfaces/stream-config.d.ts +0 -6
  195. package/src/interfaces/stream-config.d.ts.map +0 -1
  196. package/src/interfaces/stream-config.js +0 -8
  197. package/src/interfaces/stream-config.js.map +0 -1
  198. package/src/interfaces/stream-progress.d.ts +0 -8
  199. package/src/interfaces/stream-progress.d.ts.map +0 -1
  200. package/src/interfaces/stream-progress.js +0 -3
  201. package/src/interfaces/stream-progress.js.map +0 -1
  202. package/src/interfaces/wallet-seed.d.ts +0 -7
  203. package/src/interfaces/wallet-seed.d.ts.map +0 -1
  204. package/src/interfaces/wallet-seed.js +0 -3
  205. package/src/interfaces/wallet-seed.js.map +0 -1
  206. package/src/interfaces/wrapped-key-consts.d.ts +0 -7
  207. package/src/interfaces/wrapped-key-consts.d.ts.map +0 -1
  208. package/src/interfaces/wrapped-key-consts.js +0 -3
  209. package/src/interfaces/wrapped-key-consts.js.map +0 -1
  210. package/src/lib/crypto-container.d.ts +0 -13
  211. package/src/lib/crypto-container.d.ts.map +0 -1
  212. package/src/lib/crypto-container.js +0 -32
  213. package/src/lib/crypto-container.js.map +0 -1
  214. package/src/lib/index.d.ts +0 -4
  215. package/src/lib/index.d.ts.map +0 -1
  216. package/src/lib/index.js +0 -7
  217. package/src/lib/index.js.map +0 -1
  218. package/src/lib/invariant-validator.d.ts +0 -69
  219. package/src/lib/invariant-validator.d.ts.map +0 -1
  220. package/src/lib/invariant-validator.js +0 -98
  221. package/src/lib/invariant-validator.js.map +0 -1
  222. package/src/lib/invariants/index.d.ts +0 -8
  223. package/src/lib/invariants/index.d.ts.map +0 -1
  224. package/src/lib/invariants/index.js +0 -12
  225. package/src/lib/invariants/index.js.map +0 -1
  226. package/src/lib/invariants/recipient-id-consistency.d.ts +0 -41
  227. package/src/lib/invariants/recipient-id-consistency.d.ts.map +0 -1
  228. package/src/lib/invariants/recipient-id-consistency.js +0 -75
  229. package/src/lib/invariants/recipient-id-consistency.js.map +0 -1
  230. package/src/member.d.ts +0 -81
  231. package/src/member.d.ts.map +0 -1
  232. package/src/member.js +0 -282
  233. package/src/member.js.map +0 -1
  234. package/src/services/aes-gcm.d.ts +0 -66
  235. package/src/services/aes-gcm.d.ts.map +0 -1
  236. package/src/services/aes-gcm.js +0 -161
  237. package/src/services/aes-gcm.js.map +0 -1
  238. package/src/services/chunk-processor.d.ts +0 -15
  239. package/src/services/chunk-processor.d.ts.map +0 -1
  240. package/src/services/chunk-processor.js +0 -36
  241. package/src/services/chunk-processor.js.map +0 -1
  242. package/src/services/ecies/crypto-core.d.ts +0 -104
  243. package/src/services/ecies/crypto-core.d.ts.map +0 -1
  244. package/src/services/ecies/crypto-core.js +0 -234
  245. package/src/services/ecies/crypto-core.js.map +0 -1
  246. package/src/services/ecies/file.d.ts +0 -30
  247. package/src/services/ecies/file.d.ts.map +0 -1
  248. package/src/services/ecies/file.js +0 -112
  249. package/src/services/ecies/file.js.map +0 -1
  250. package/src/services/ecies/index.d.ts +0 -8
  251. package/src/services/ecies/index.d.ts.map +0 -1
  252. package/src/services/ecies/index.js +0 -11
  253. package/src/services/ecies/index.js.map +0 -1
  254. package/src/services/ecies/multi-recipient.d.ts +0 -84
  255. package/src/services/ecies/multi-recipient.d.ts.map +0 -1
  256. package/src/services/ecies/multi-recipient.js +0 -494
  257. package/src/services/ecies/multi-recipient.js.map +0 -1
  258. package/src/services/ecies/service.d.ts +0 -75
  259. package/src/services/ecies/service.d.ts.map +0 -1
  260. package/src/services/ecies/service.js +0 -152
  261. package/src/services/ecies/service.js.map +0 -1
  262. package/src/services/ecies/signature.d.ts +0 -38
  263. package/src/services/ecies/signature.d.ts.map +0 -1
  264. package/src/services/ecies/signature.js +0 -69
  265. package/src/services/ecies/signature.js.map +0 -1
  266. package/src/services/ecies/single-recipient.d.ts +0 -83
  267. package/src/services/ecies/single-recipient.d.ts.map +0 -1
  268. package/src/services/ecies/single-recipient.js +0 -448
  269. package/src/services/ecies/single-recipient.js.map +0 -1
  270. package/src/services/ecies/utilities.d.ts +0 -33
  271. package/src/services/ecies/utilities.d.ts.map +0 -1
  272. package/src/services/ecies/utilities.js +0 -91
  273. package/src/services/ecies/utilities.js.map +0 -1
  274. package/src/services/encryption-stream.d.ts +0 -33
  275. package/src/services/encryption-stream.d.ts.map +0 -1
  276. package/src/services/encryption-stream.js +0 -211
  277. package/src/services/encryption-stream.js.map +0 -1
  278. package/src/services/index.d.ts +0 -8
  279. package/src/services/index.d.ts.map +0 -1
  280. package/src/services/index.js +0 -11
  281. package/src/services/index.js.map +0 -1
  282. package/src/services/multi-recipient-processor.d.ts +0 -72
  283. package/src/services/multi-recipient-processor.d.ts.map +0 -1
  284. package/src/services/multi-recipient-processor.js +0 -321
  285. package/src/services/multi-recipient-processor.js.map +0 -1
  286. package/src/services/pbkdf2.d.ts +0 -105
  287. package/src/services/pbkdf2.d.ts.map +0 -1
  288. package/src/services/pbkdf2.js +0 -191
  289. package/src/services/pbkdf2.js.map +0 -1
  290. package/src/services/progress-tracker.d.ts +0 -9
  291. package/src/services/progress-tracker.d.ts.map +0 -1
  292. package/src/services/progress-tracker.js +0 -41
  293. package/src/services/progress-tracker.js.map +0 -1
  294. package/src/test-mocks/index.d.ts +0 -2
  295. package/src/test-mocks/index.d.ts.map +0 -1
  296. package/src/test-mocks/index.js +0 -5
  297. package/src/test-mocks/index.js.map +0 -1
  298. package/src/test-mocks/mock-backend-member.d.ts +0 -76
  299. package/src/test-mocks/mock-backend-member.d.ts.map +0 -1
  300. package/src/test-mocks/mock-backend-member.js +0 -139
  301. package/src/test-mocks/mock-backend-member.js.map +0 -1
  302. package/src/testing.d.ts +0 -2
  303. package/src/testing.d.ts.map +0 -1
  304. package/src/testing.js +0 -6
  305. package/src/testing.js.map +0 -1
  306. package/src/types/id-guards.d.ts +0 -39
  307. package/src/types/id-guards.d.ts.map +0 -1
  308. package/src/types/id-guards.js +0 -91
  309. package/src/types/id-guards.js.map +0 -1
  310. package/src/types/index.d.ts +0 -2
  311. package/src/types/index.d.ts.map +0 -1
  312. package/src/types/index.js +0 -5
  313. package/src/types/index.js.map +0 -1
  314. package/src/types.d.ts +0 -26
  315. package/src/types.d.ts.map +0 -1
  316. package/src/types.js +0 -6
  317. package/src/types.js.map +0 -1
  318. package/src/utils.d.ts +0 -11
  319. package/src/utils.d.ts.map +0 -1
  320. package/src/utils.js +0 -82
  321. package/src/utils.js.map +0 -1
@@ -1,448 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EciesSingleRecipientCore = void 0;
4
- const crypto_1 = require("crypto");
5
- const ecies_lib_1 = require("@digitaldefiance/ecies-lib");
6
- const ecies_i18n_factory_1 = require("../../i18n/ecies-i18n-factory");
7
- const crypto_core_1 = require("./crypto-core");
8
- class EciesSingleRecipientCore {
9
- cryptoCore;
10
- config;
11
- constructor(config) {
12
- this.config = config;
13
- this.cryptoCore = new crypto_core_1.EciesCryptoCore(config);
14
- }
15
- /**
16
- * Get the size of the header for a given encryption type
17
- * @param encryptionType The encryption type (single, simple, etc.)
18
- * @returns
19
- */
20
- getHeaderSize(encryptionType) {
21
- switch (encryptionType) {
22
- case 'simple':
23
- return this.cryptoCore.consts.SIMPLE.FIXED_OVERHEAD_SIZE;
24
- case 'single':
25
- return this.cryptoCore.consts.SINGLE.FIXED_OVERHEAD_SIZE;
26
- default:
27
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.InvalidEncryptionType);
28
- }
29
- }
30
- /**
31
- * Encrypt a message with a public key
32
- * @param encryptSimple Whether to simple encrypt (without crc, length)
33
- * @param receiverPublicKey The public key of the receiver
34
- * @param message The message to encrypt
35
- * @param preamble Optional preamble to prepend to the encrypted message
36
- * @param options Optional encryption options
37
- * @param options.recipientCount The number of recipients for multiple encryption mode
38
- * @returns The encrypted message
39
- */
40
- encrypt(encryptSimple, receiverPublicKey, message, preamble = Buffer.alloc(0)) {
41
- // Security fix 4: Message size validation
42
- if (message.length === 0) {
43
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.CannotEncryptEmptyData);
44
- }
45
- if (message.length > 0x7fffffff) {
46
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.MessageTooLarge);
47
- }
48
- const encryptionType = encryptSimple
49
- ? 'simple'
50
- : 'single';
51
- const encryptionTypeBuffer = Buffer.alloc(1);
52
- encryptionTypeBuffer.writeUint8(ecies_lib_1.EciesEncryptionTypeMap[encryptionType]);
53
- const versionBuffer = Buffer.alloc(1);
54
- versionBuffer.writeUint8(ecies_lib_1.EciesVersionEnum.V1);
55
- const cipherSuiteBuffer = Buffer.alloc(1);
56
- cipherSuiteBuffer.writeUint8(ecies_lib_1.EciesCipherSuiteEnum.Secp256k1_Aes256Gcm_Sha256);
57
- if (message.length > this.cryptoCore.consts.MAX_RAW_DATA_SIZE) {
58
- const pluginEngine = (0, ecies_i18n_factory_1.getEciesPluginI18nEngine)();
59
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.InvalidDataLength, undefined, undefined, {
60
- error: pluginEngine.translate(ecies_i18n_factory_1.NodeEciesComponentId, ecies_i18n_factory_1.NodeEciesStringKey.Error_MessageLengthExceedsMaximumAllowedSize),
61
- maxLength: String(ecies_lib_1.UINT32_MAX),
62
- messageLength: String(message.length),
63
- });
64
- }
65
- // Generate ephemeral ECDH key pair
66
- // Use cryptoCore to generate keys to ensure compatibility with computeSharedSecret
67
- const ephemeralPrivateKey = this.cryptoCore.generatePrivateKey();
68
- const ephemeralPublicKey = this.cryptoCore.getPublicKey(ephemeralPrivateKey);
69
- // Compute shared secret
70
- let sharedSecret;
71
- try {
72
- // Make sure we normalize the receiver's public key
73
- const normalizedReceiverPublicKey = this.cryptoCore.normalizePublicKey(receiverPublicKey);
74
- // Use cryptoCore to compute shared secret (handles compressed keys better)
75
- sharedSecret = this.cryptoCore.computeSharedSecret(ephemeralPrivateKey, normalizedReceiverPublicKey);
76
- }
77
- catch (error) {
78
- if (process.env.NODE_ENV !== 'test') {
79
- console.error('[ERROR][encrypt] Failed to compute shared secret:', error);
80
- }
81
- if (error instanceof Error) {
82
- if ('code' in error &&
83
- error.code ===
84
- 'ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY') {
85
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.InvalidRecipientPublicKey, undefined, undefined, {
86
- nodeError: error.code,
87
- });
88
- }
89
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.SecretComputationFailed, undefined, undefined, {
90
- error: error.message,
91
- });
92
- }
93
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.SecretComputationFailed);
94
- }
95
- // Get the ephemeral public key and ensure it has the 0x04 prefix
96
- // ephemeralPublicKey is already set above and is compressed.
97
- // Generate random IV
98
- const iv = (0, crypto_1.randomBytes)(this.cryptoCore.consts.IV_SIZE);
99
- // Use HKDF to derive the key
100
- const symKey = this.cryptoCore.deriveSharedKey(sharedSecret, Buffer.alloc(0), // No salt
101
- Buffer.from('ecies-v2-key-derivation'), // Info
102
- this.cryptoCore.consts.SYMMETRIC.KEY_SIZE);
103
- // Create cipher with the derived symmetric key
104
- const cipher = (0, crypto_1.createCipheriv)(this.cryptoCore.consts.SYMMETRIC_ALGORITHM_CONFIGURATION, symKey, iv);
105
- // Ensure auto padding is enabled
106
- cipher.setAutoPadding(true);
107
- // Construct AAD
108
- // AAD = Preamble + Version + CipherSuite + EncryptionType + EphemeralPublicKey
109
- // We don't include IV in AAD as it's already authenticated by GCM mechanism
110
- // We don't include Length in AAD because it's variable/optional and might complicate things?
111
- // Actually, let's include what we can.
112
- // For now, let's stick to the metadata that identifies the context.
113
- const aad = Buffer.concat([
114
- preamble,
115
- versionBuffer,
116
- cipherSuiteBuffer,
117
- encryptionTypeBuffer,
118
- ephemeralPublicKey,
119
- ]);
120
- cipher.setAAD(aad);
121
- // Encrypt the message
122
- let encrypted = cipher.update(message);
123
- encrypted = Buffer.concat([encrypted, cipher.final()]);
124
- // Get and explicitly set the authentication tag to max tag length for consistency
125
- const authTag = cipher.getAuthTag();
126
- // Add a length prefix to the encrypted data to ensure we can extract the exact number of bytes during decryption
127
- const lengthBuffer = encryptionType === 'simple' ? Buffer.alloc(0) : Buffer.alloc(ecies_lib_1.UINT64_SIZE);
128
- if (encryptionType === 'single') {
129
- lengthBuffer.writeBigUInt64BE(BigInt(encrypted.length));
130
- }
131
- // Security fix 5: Encrypted size validation
132
- const maxExpectedSize = message.length + 1024;
133
- if (encrypted.length > maxExpectedSize) {
134
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.EncryptedSizeExceedsExpected);
135
- }
136
- // Format: [optional preamble] | version (1) | cipherSuite (1) | type (1) | ephemeralPublicKey (65) | iv (16) | authTag (16) | length (8) | encryptedData
137
- return Buffer.concat([
138
- preamble,
139
- versionBuffer,
140
- cipherSuiteBuffer,
141
- encryptionTypeBuffer,
142
- ephemeralPublicKey,
143
- iv,
144
- authTag,
145
- lengthBuffer,
146
- encrypted,
147
- ]);
148
- }
149
- /**
150
- * Parse the header from encrypted data
151
- * @param encryptionType The type of encryption (single, simple, etc.) or undefined if not known
152
- * @param data The encrypted data
153
- * @param preambleSize The size of the preamble, if any
154
- * @param options Optional parsing options
155
- * @param options.dataLength The expected length of the data
156
- * @returns The parsed header components
157
- */
158
- parseEncryptedMessage(encryptionType, data, preambleSize = 0, options) {
159
- let offset = 0;
160
- const preamble = data.subarray(0, preambleSize);
161
- offset += preambleSize;
162
- // Read Version
163
- const version = data.readUInt8(offset);
164
- offset += this.cryptoCore.consts.VERSION_SIZE;
165
- if (version !== ecies_lib_1.EciesVersionEnum.V1) {
166
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.InvalidVersion, undefined, undefined, { version: String(version) });
167
- }
168
- // Read CipherSuite
169
- const cipherSuite = data.readUInt8(offset);
170
- offset += this.cryptoCore.consts.CIPHER_SUITE_SIZE;
171
- if (cipherSuite !== ecies_lib_1.EciesCipherSuiteEnum.Secp256k1_Aes256Gcm_Sha256) {
172
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.InvalidCipherSuite, undefined, undefined, { cipherSuite: String(cipherSuite) });
173
- }
174
- // read the encryption type from the first byte after the preamble and version/suite
175
- const actualEncryptionTypeEnum = (0, ecies_lib_1.ensureEciesEncryptionTypeEnum)(data.readUInt8(offset));
176
- // if a type is provided, ensure it matches the actual type
177
- if (encryptionType !== undefined &&
178
- actualEncryptionTypeEnum !== encryptionType) {
179
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.InvalidEncryptionType, undefined, undefined, {
180
- expected: (0, ecies_lib_1.encryptionTypeToString)(encryptionType),
181
- actual: (0, ecies_lib_1.encryptionTypeToString)(actualEncryptionTypeEnum),
182
- });
183
- }
184
- if (actualEncryptionTypeEnum === ecies_lib_1.EciesEncryptionTypeEnum.Multiple) {
185
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.InvalidEncryptionType, undefined, undefined, {
186
- expected: 'single or simple',
187
- actual: (0, ecies_lib_1.encryptionTypeToString)(actualEncryptionTypeEnum),
188
- });
189
- }
190
- const includeLengthAndCrc = actualEncryptionTypeEnum === ecies_lib_1.EciesEncryptionTypeEnum.Single;
191
- // Security fix 6: Minimum encrypted data size
192
- const minSize = includeLengthAndCrc
193
- ? this.cryptoCore.consts.SINGLE.FIXED_OVERHEAD_SIZE
194
- : this.cryptoCore.consts.SIMPLE.FIXED_OVERHEAD_SIZE;
195
- if (data.length < minSize) {
196
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.InvalidEncryptedDataLength);
197
- }
198
- // skip the already-read encryption type
199
- offset += 1;
200
- // Extract components from the header
201
- const ephemeralPublicKey = data.subarray(offset, offset + this.cryptoCore.consts.PUBLIC_KEY_LENGTH);
202
- offset += this.cryptoCore.consts.PUBLIC_KEY_LENGTH;
203
- // Make sure we normalize the ephemeral public key
204
- const normalizedKey = this.cryptoCore.normalizePublicKey(ephemeralPublicKey);
205
- const iv = data.subarray(offset, offset + this.cryptoCore.consts.IV_SIZE);
206
- offset += this.cryptoCore.consts.IV_SIZE;
207
- const authTag = data.subarray(offset, offset + this.cryptoCore.consts.AUTH_TAG_SIZE);
208
- offset += this.cryptoCore.consts.AUTH_TAG_SIZE;
209
- // Extract the length prefix (4 bytes) after the header components
210
- const dataLengthBuffer = includeLengthAndCrc
211
- ? data.subarray(offset, offset + this.cryptoCore.consts.SINGLE.DATA_LENGTH_SIZE)
212
- : Buffer.alloc(0);
213
- if (includeLengthAndCrc) {
214
- offset += this.cryptoCore.consts.SINGLE.DATA_LENGTH_SIZE;
215
- }
216
- const dataLength = includeLengthAndCrc
217
- ? Number(dataLengthBuffer.readBigUInt64BE(0))
218
- : (options?.dataLength ?? -1);
219
- if (includeLengthAndCrc &&
220
- options?.dataLength !== undefined &&
221
- dataLength !== options.dataLength) {
222
- const pluginEngine = (0, ecies_i18n_factory_1.getEciesPluginI18nEngine)();
223
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.InvalidEncryptedDataLength, undefined, undefined, {
224
- error: pluginEngine.translate(ecies_i18n_factory_1.NodeEciesComponentId, ecies_i18n_factory_1.NodeEciesStringKey.Error_EncryptedDataLengthMismatch),
225
- expected: String(dataLength),
226
- actual: String(options.dataLength),
227
- });
228
- }
229
- // No CRC in Single encryption (AES-GCM provides authentication)
230
- const encryptedData = dataLength > 0
231
- ? data.subarray(offset, offset + dataLength)
232
- : data.subarray(offset);
233
- if (includeLengthAndCrc) {
234
- offset += dataLength;
235
- }
236
- if (includeLengthAndCrc && encryptedData.length !== dataLength) {
237
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.InvalidEncryptedDataLength, undefined, undefined, {
238
- expected: String(dataLength),
239
- actual: String(encryptedData.length),
240
- });
241
- }
242
- const remainder = includeLengthAndCrc
243
- ? data.subarray(offset)
244
- : Buffer.alloc(0);
245
- // No CRC validation needed (AES-GCM provides authentication)
246
- // Security fix 7: Component extraction validation
247
- if (normalizedKey.length !== this.cryptoCore.consts.PUBLIC_KEY_LENGTH) {
248
- const pluginEngine = (0, ecies_i18n_factory_1.getEciesPluginI18nEngine)();
249
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.InvalidEphemeralPublicKey, undefined, undefined, {
250
- error: pluginEngine.translate(ecies_i18n_factory_1.NodeEciesComponentId, ecies_i18n_factory_1.NodeEciesStringKey.Error_EphemeralPublicKeyLengthMismatch),
251
- expected: String(this.cryptoCore.consts.PUBLIC_KEY_LENGTH),
252
- actual: String(normalizedKey.length),
253
- });
254
- }
255
- if (iv.length !== this.cryptoCore.consts.IV_SIZE) {
256
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.InvalidIVLength, undefined, undefined, {
257
- expected: String(this.cryptoCore.consts.IV_SIZE),
258
- actual: String(iv.length),
259
- });
260
- }
261
- if (authTag.length !== this.cryptoCore.consts.AUTH_TAG_SIZE) {
262
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.InvalidAuthTagLength, undefined, undefined, {
263
- expected: String(this.cryptoCore.consts.AUTH_TAG_SIZE),
264
- actual: String(authTag.length),
265
- });
266
- }
267
- return {
268
- header: {
269
- preamble,
270
- encryptionType: actualEncryptionTypeEnum,
271
- ephemeralPublicKey: normalizedKey,
272
- iv,
273
- authTag,
274
- dataLength,
275
- headerSize: includeLengthAndCrc
276
- ? this.cryptoCore.consts.SINGLE.FIXED_OVERHEAD_SIZE
277
- : this.cryptoCore.consts.SIMPLE.FIXED_OVERHEAD_SIZE,
278
- },
279
- data: encryptedData,
280
- remainder,
281
- };
282
- }
283
- /**
284
- * Decrypts data encrypted with ECIES using a header
285
- * This method maintains backward compatibility with the original implementation
286
- * by returning just the Buffer. For detailed information, use decryptSingleWithHeaderEx
287
- * @param encryptionType The type of encryption (single, simple, etc.)
288
- * @param privateKey The private key to decrypt the data
289
- * @param encryptedData The data to decrypt
290
- * @param preambleSize The size of the preamble, if any
291
- * @param options Optional decryption options
292
- * @param options.dataLength The expected length of the data
293
- * @returns The decrypted data buffer
294
- */
295
- decryptWithHeader(encryptionType, privateKey, encryptedData, preambleSize = 0, options) {
296
- try {
297
- // Call the extended version and return only the decrypted buffer for backward compatibility
298
- const result = this.decryptWithHeaderEx(encryptionType, privateKey, encryptedData, preambleSize, options);
299
- return result.decrypted;
300
- }
301
- catch (error) {
302
- if (error instanceof ecies_lib_1.ECIESError) {
303
- throw error;
304
- }
305
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.DecryptionFailed, undefined, undefined, {
306
- error: error instanceof Error ? error.message : String(error),
307
- });
308
- }
309
- }
310
- /**
311
- * Extended version of decryptSingleWithHeader that provides more detailed information
312
- * @param encryptionType The type of encryption (single, simple, etc.)
313
- * @param privateKey The private key to decrypt the data
314
- * @param encryptedData The data to decrypt
315
- * @param preambleSize The size of the preamble, if any
316
- * @param options Optional decryption options
317
- * @param options.dataLength The expected length of the data
318
- * @returns The decrypted data and the number of bytes consumed from the input buffer
319
- */
320
- decryptWithHeaderEx(encryptionType, privateKey, encryptedData, preambleSize = 0, options) {
321
- try {
322
- const { data, header } = this.parseEncryptedMessage(encryptionType, encryptedData, preambleSize, options);
323
- // Normalize the public key (ensuring 0x04 prefix)
324
- const normalizedKey = this.cryptoCore.normalizePublicKey(header.ephemeralPublicKey);
325
- // Construct AAD
326
- const versionBuffer = Buffer.alloc(1);
327
- versionBuffer.writeUint8(ecies_lib_1.EciesVersionEnum.V1);
328
- const cipherSuiteBuffer = Buffer.alloc(1);
329
- cipherSuiteBuffer.writeUint8(ecies_lib_1.EciesCipherSuiteEnum.Secp256k1_Aes256Gcm_Sha256);
330
- const encryptionTypeBuffer = Buffer.alloc(1);
331
- encryptionTypeBuffer.writeUint8(header.encryptionType);
332
- const aad = Buffer.concat([
333
- header.preamble ?? Buffer.alloc(preambleSize),
334
- versionBuffer,
335
- cipherSuiteBuffer,
336
- encryptionTypeBuffer,
337
- normalizedKey,
338
- ]);
339
- // Decrypt using components with the normalized key
340
- const decrypted = this.decryptWithComponents(privateKey, normalizedKey, header.iv, header.authTag, data, aad);
341
- return {
342
- decrypted,
343
- consumedBytes: header.dataLength + header.headerSize,
344
- };
345
- }
346
- catch (error) {
347
- if (error instanceof ecies_lib_1.ECIESError) {
348
- throw error;
349
- }
350
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.DecryptionFailed, undefined, undefined, {
351
- error: error instanceof Error ? error.message : String(error),
352
- });
353
- }
354
- }
355
- /**
356
- * Decrypts data encrypted with ECIES using components
357
- * @param privateKey The private key to decrypt the data
358
- * @param ephemeralPublicKey The ephemeral public key used to encrypt the data
359
- * @param iv The initialization vector used to encrypt the data
360
- * @param authTag The authentication tag used to encrypt the data
361
- * @param encrypted The encrypted data
362
- * @returns The decrypted data
363
- */
364
- decryptWithComponents(privateKey, ephemeralPublicKey, iv, authTag, encrypted, aad) {
365
- try {
366
- // Ensure the ephemeral public key has the correct format
367
- const normalizedEphemeralKey = this.cryptoCore.normalizePublicKey(ephemeralPublicKey);
368
- // Use cryptoCore to compute shared secret (handles compressed keys better)
369
- let sharedSecret;
370
- try {
371
- sharedSecret = this.cryptoCore.computeSharedSecret(privateKey, normalizedEphemeralKey);
372
- }
373
- catch (err) {
374
- if (process.env.NODE_ENV !== 'test') {
375
- console.error('[ERROR][decrypt] Failed to compute shared secret:', err);
376
- }
377
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.DecryptionFailed, undefined, undefined, {
378
- originalError: err instanceof Error ? err.message : String(err),
379
- stage: 'shared_secret_computation',
380
- });
381
- }
382
- // Use HKDF to derive the key
383
- const symKey = this.cryptoCore.deriveSharedKey(sharedSecret, Buffer.alloc(0), // No salt
384
- Buffer.from('ecies-v2-key-derivation'), // Info
385
- this.cryptoCore.consts.SYMMETRIC.KEY_SIZE);
386
- // Create decipher with shared secret-derived key
387
- const decipher = (0, crypto_1.createDecipheriv)(this.cryptoCore.consts.SYMMETRIC_ALGORITHM_CONFIGURATION, symKey, iv);
388
- // Validate the tag and IV
389
- if (authTag.length !== this.cryptoCore.consts.AUTH_TAG_SIZE) {
390
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.DecryptionFailed, undefined, undefined, {
391
- expected: String(this.cryptoCore.consts.AUTH_TAG_SIZE),
392
- actual: String(authTag.length),
393
- stage: 'auth_tag_validation',
394
- });
395
- }
396
- if (iv.length !== this.cryptoCore.consts.IV_SIZE) {
397
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.DecryptionFailed, undefined, undefined, {
398
- expected: String(this.cryptoCore.consts.IV_SIZE),
399
- actual: String(iv.length),
400
- stage: 'iv_validation',
401
- });
402
- }
403
- // Set the authentication tag for GCM mode
404
- decipher.setAuthTag(authTag);
405
- if (aad) {
406
- decipher.setAAD(aad);
407
- }
408
- // Decrypt the data
409
- try {
410
- // Handle edge case where encrypted data might be empty or malformed
411
- const pluginEngine = (0, ecies_i18n_factory_1.getEciesPluginI18nEngine)();
412
- if (encrypted.length === 0) {
413
- throw new Error(pluginEngine.translate(ecies_i18n_factory_1.NodeEciesComponentId, ecies_i18n_factory_1.NodeEciesStringKey.Error_EncryptedDataIsEmpty));
414
- }
415
- const firstPart = decipher.update(encrypted);
416
- const finalPart = decipher.final();
417
- const result = Buffer.concat([firstPart, finalPart]);
418
- // Security fix 8: Decrypted data validation
419
- if (result.length === 0) {
420
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.DecryptionFailed);
421
- }
422
- return result;
423
- }
424
- catch (err) {
425
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.DecryptionFailed, undefined, undefined, {
426
- error: err instanceof Error ? err.message : String(err),
427
- stage: 'decipher_operation',
428
- });
429
- }
430
- }
431
- catch (error) {
432
- if (error instanceof ecies_lib_1.ECIESError) {
433
- throw error;
434
- }
435
- // Wrap non-EciesError in an EciesError
436
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.DecryptionFailed, undefined, undefined, {
437
- error: error instanceof Error ? error.message : String(error),
438
- privateKeyLength: String(privateKey.length),
439
- ephemeralPublicKeyLength: String(ephemeralPublicKey.length),
440
- ivLength: String(iv.length),
441
- authTagLength: String(authTag.length),
442
- encryptedLength: String(encrypted.length),
443
- });
444
- }
445
- }
446
- }
447
- exports.EciesSingleRecipientCore = EciesSingleRecipientCore;
448
- //# sourceMappingURL=single-recipient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"single-recipient.js","sourceRoot":"","sources":["../../../../../../packages/digitaldefiance-node-ecies-lib/src/services/ecies/single-recipient.ts"],"names":[],"mappings":";;;AAAA,mCAAuE;AAEvE,0DAaoC;AAEpC,sEAIuC;AAKvC,+CAAgD;AAEhD,MAAa,wBAAwB;IAChB,UAAU,CAAkB;IAC5B,MAAM,CAAe;IAExC,YAAY,MAAoB;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC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CAAC;oBACvD,KAAK,EAAE,oBAAoB;iBAC5B,CACF,CAAC;YACJ,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,sBAAU,EAAE,CAAC;gBAChC,MAAM,KAAK,CAAC;YACd,CAAC;YAED,uCAAuC;YACvC,MAAM,IAAI,sBAAU,CAClB,8BAAkB,CAAC,gBAAgB,EACnC,SAAS,EACT,SAAS,EACT;gBACE,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;gBAC7D,gBAAgB,EAAE,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC;gBAC3C,wBAAwB,EAAE,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC;gBAC3D,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC;gBAC3B,aAAa,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;gBACrC,eAAe,EAAE,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC;aAC1C,CACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AA/sBD,4DA+sBC"}
@@ -1,33 +0,0 @@
1
- import { EciesEncryptionType, IConstants as IBaseConstants } from '@digitaldefiance/ecies-lib';
2
- /**
3
- * Utility functions for ECIES operations
4
- */
5
- export declare class EciesUtilities {
6
- /**
7
- * Computes the encrypted length from the data length.
8
- * @param dataLength - The length of the data.
9
- * @param encryptionMode - The encryption mode (simple, single, multiple).
10
- * @param recipientCount - The number of recipients for multiple encryption mode.
11
- * @param constants - The constants to use for calculations.
12
- * @returns The encrypted length details.
13
- */
14
- computeEncryptedLengthFromDataLength(dataLength: number, encryptionMode: EciesEncryptionType, recipientCount?: number, constants?: IBaseConstants): number;
15
- /**
16
- * Calculates the overhead for multiple recipient encryption.
17
- * This is a pure calculation that doesn't require service instantiation.
18
- * Matches the logic in EciesMultiRecipient.calculateECIESMultipleRecipientOverhead.
19
- * @param recipientCount - The number of recipients.
20
- * @param includeMessageOverhead - Whether to include message overhead.
21
- * @param eciesConstants - The ECIES constants to use.
22
- * @returns The overhead in bytes.
23
- */
24
- private calculateMultipleRecipientOverhead;
25
- /**
26
- * Computes the decrypted length from the encrypted data length.
27
- * @param encryptedDataLength - The length of the encrypted data.
28
- * @param padding - Optional padding value.
29
- * @returns The decrypted length.
30
- */
31
- computeDecryptedLengthFromEncryptedDataLength(encryptedDataLength: number, padding?: number, constants?: IBaseConstants): number;
32
- }
33
- //# sourceMappingURL=utilities.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../../../../../packages/digitaldefiance-node-ecies-lib/src/services/ecies/utilities.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAGnB,UAAU,IAAI,cAAc,EAE7B,MAAM,4BAA4B,CAAC;AAIpC;;GAEG;AACH,qBAAa,cAAc;IACzB;;;;;;;OAOG;IACI,oCAAoC,CACzC,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,mBAAmB,EACnC,cAAc,CAAC,EAAE,MAAM,EACvB,SAAS,GAAE,cAA8C,GACxD,MAAM;IA4BT;;;;;;;;OAQG;IACH,OAAO,CAAC,kCAAkC;IA4B1C;;;;;OAKG;IACI,6CAA6C,CAClD,mBAAmB,EAAE,MAAM,EAC3B,OAAO,CAAC,EAAE,MAAM,EAChB,SAAS,GAAE,cAA8C,GACxD,MAAM;CA0BV"}
@@ -1,91 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EciesUtilities = void 0;
4
- const ecies_lib_1 = require("@digitaldefiance/ecies-lib");
5
- const constants_1 = require("../../constants");
6
- /**
7
- * Utility functions for ECIES operations
8
- */
9
- class EciesUtilities {
10
- /**
11
- * Computes the encrypted length from the data length.
12
- * @param dataLength - The length of the data.
13
- * @param encryptionMode - The encryption mode (simple, single, multiple).
14
- * @param recipientCount - The number of recipients for multiple encryption mode.
15
- * @param constants - The constants to use for calculations.
16
- * @returns The encrypted length details.
17
- */
18
- computeEncryptedLengthFromDataLength(dataLength, encryptionMode, recipientCount, constants = (0, constants_1.getNodeRuntimeConfiguration)()) {
19
- if (dataLength < 0) {
20
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.InvalidDataLength);
21
- }
22
- const eciesDefaults = constants.ECIES;
23
- switch (encryptionMode) {
24
- case 'simple':
25
- // type (1) + public key (65) + IV (16) + auth tag (16) = 98
26
- return dataLength + eciesDefaults.SIMPLE.FIXED_OVERHEAD_SIZE;
27
- case 'single':
28
- // type (1) + public key (65) + IV (16) + auth tag (16) + data length (4) + crc16 (2) = 104
29
- return dataLength + eciesDefaults.SINGLE.FIXED_OVERHEAD_SIZE;
30
- case 'multiple':
31
- // Calculate multiple recipient overhead without instantiating service
32
- return (dataLength +
33
- this.calculateMultipleRecipientOverhead(recipientCount ?? 1, true, eciesDefaults));
34
- default:
35
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.InvalidEncryptionType);
36
- }
37
- }
38
- /**
39
- * Calculates the overhead for multiple recipient encryption.
40
- * This is a pure calculation that doesn't require service instantiation.
41
- * Matches the logic in EciesMultiRecipient.calculateECIESMultipleRecipientOverhead.
42
- * @param recipientCount - The number of recipients.
43
- * @param includeMessageOverhead - Whether to include message overhead.
44
- * @param eciesConstants - The ECIES constants to use.
45
- * @returns The overhead in bytes.
46
- */
47
- calculateMultipleRecipientOverhead(recipientCount, includeMessageOverhead, eciesConstants) {
48
- if (recipientCount < 1) {
49
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.InvalidRecipientCount);
50
- }
51
- // Calculate encrypted keys size (default assumption: all keys use Simple encryption type)
52
- const encryptedKeysSize = recipientCount * eciesConstants.MULTIPLE.ENCRYPTED_KEY_SIZE;
53
- // Base overhead calculation
54
- const baseOverhead = eciesConstants.VERSION_SIZE +
55
- eciesConstants.CIPHER_SUITE_SIZE +
56
- eciesConstants.ENCRYPTION_TYPE_SIZE +
57
- eciesConstants.MULTIPLE.DATA_LENGTH_SIZE +
58
- eciesConstants.MULTIPLE.RECIPIENT_COUNT_SIZE +
59
- recipientCount * eciesConstants.MULTIPLE.RECIPIENT_ID_SIZE + // recipient ids (dynamic based on ID provider)
60
- encryptedKeysSize; // actual encrypted keys size
61
- return includeMessageOverhead
62
- ? baseOverhead + eciesConstants.MULTIPLE.FIXED_OVERHEAD_SIZE
63
- : baseOverhead;
64
- }
65
- /**
66
- * Computes the decrypted length from the encrypted data length.
67
- * @param encryptedDataLength - The length of the encrypted data.
68
- * @param padding - Optional padding value.
69
- * @returns The decrypted length.
70
- */
71
- computeDecryptedLengthFromEncryptedDataLength(encryptedDataLength, padding, constants = (0, constants_1.getNodeRuntimeConfiguration)()) {
72
- if (encryptedDataLength < 0) {
73
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.InvalidEncryptedDataLength);
74
- }
75
- const { ECIES: eciesDefaults } = constants;
76
- const overhead = eciesDefaults.SINGLE.FIXED_OVERHEAD_SIZE;
77
- const actualPadding = padding !== undefined ? padding : 0;
78
- const decryptedLength = encryptedDataLength - overhead - actualPadding;
79
- if (decryptedLength < 0) {
80
- throw new ecies_lib_1.ECIESError(ecies_lib_1.ECIESErrorTypeEnum.InvalidEncryptedDataLength, undefined, undefined, {
81
- encryptedDataLength: String(encryptedDataLength),
82
- overhead: String(overhead),
83
- padding: String(actualPadding),
84
- computedLength: String(decryptedLength),
85
- });
86
- }
87
- return decryptedLength;
88
- }
89
- }
90
- exports.EciesUtilities = EciesUtilities;
91
- //# sourceMappingURL=utilities.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utilities.js","sourceRoot":"","sources":["../../../../../../packages/digitaldefiance-node-ecies-lib/src/services/ecies/utilities.ts"],"names":[],"mappings":";;;AAAA,0DAMoC;AAEpC,+CAA8D;AAE9D;;GAEG;AACH,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-recipient-chunk';
3
- import { IStreamConfig } from '../interfaces/stream-config';
4
- import { IStreamProgress } from '../interfaces/stream-progress';
5
- import { ChunkProcessor } from './chunk-processor';
6
- import { ECIESService } from './ecies/service';
7
- import { MultiRecipientProcessor } from './multi-recipient-processor';
8
- export interface IEncryptStreamOptions {
9
- chunkSize?: number;
10
- signal?: AbortSignal;
11
- includeChecksums?: boolean;
12
- onProgress?: (progress: IStreamProgress) => void;
13
- }
14
- export interface IDecryptStreamOptions {
15
- signal?: AbortSignal;
16
- onProgress?: (progress: IStreamProgress) => void;
17
- }
18
- export declare class EncryptionStream {
19
- private readonly ecies;
20
- private readonly config;
21
- private readonly processor;
22
- private readonly multiRecipientProcessor;
23
- private readonly engine;
24
- constructor(ecies: ECIESService, config?: IStreamConfig, processor?: ChunkProcessor, multiRecipientProcessor?: MultiRecipientProcessor);
25
- encryptStream(source: AsyncIterable<Buffer>, publicKey: Buffer, options?: IEncryptStreamOptions): AsyncGenerator<IEncryptedChunk, void, unknown>;
26
- encryptStreamMultiple(source: AsyncIterable<Buffer>, recipients: Array<{
27
- id: Buffer;
28
- publicKey: Buffer;
29
- }>, options?: IEncryptStreamOptions): AsyncGenerator<IMultiRecipientChunk, void, unknown>;
30
- decryptStream(source: AsyncIterable<Buffer>, privateKey: Buffer, options?: IDecryptStreamOptions): AsyncGenerator<Buffer, void, unknown>;
31
- decryptStreamMultiple(source: AsyncIterable<Buffer>, recipientId: Buffer, privateKey: Buffer, options?: IDecryptStreamOptions): AsyncGenerator<Buffer, void, unknown>;
32
- }
33
- //# sourceMappingURL=encryption-stream.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"encryption-stream.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/services/encryption-stream.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,E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