@digitaldefiance/ecies-lib 4.17.0 → 4.17.2
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 +38 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@digitaldefiance/ecies-lib)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
|
-
[](https://github.com/Digital-Defiance/ecies-lib)
|
|
6
6
|
|
|
7
7
|
Production-ready, browser-compatible ECIES (Elliptic Curve Integrated Encryption Scheme) library for TypeScript. Built on Web Crypto API and @noble/curves with comprehensive encryption, key management, and authentication services. Binary compatible with @digitaldefiance/node-ecies-lib for seamless cross-platform operations.
|
|
8
8
|
|
|
@@ -23,6 +23,8 @@ This library implements a modern, enterprise-grade ECIES protocol (v4.0) featuri
|
|
|
23
23
|
- **Curve**: `secp256k1` for ECDH key exchange and ECDSA signatures.
|
|
24
24
|
- **Symmetric**: `AES-256-GCM` for authenticated symmetric encryption.
|
|
25
25
|
- **Hashing**: `SHA-256` and `SHA-512`.
|
|
26
|
+
- **Key Derivation**: `PBKDF2` with configurable profiles (Fast, Standard, Secure, Maximum).
|
|
27
|
+
- **Checksums**: `CRC8`, `CRC16-CCITT`, `CRC32` for data integrity.
|
|
26
28
|
- **Modes**:
|
|
27
29
|
- **Basic**: Minimal overhead (no length prefix) - Use for fixed-size data or when size is known
|
|
28
30
|
- **WithLength**: Includes data length prefix - Use for variable-size data or streaming
|
|
@@ -53,7 +55,8 @@ This library implements a modern, enterprise-grade ECIES protocol (v4.0) featuri
|
|
|
53
55
|
|
|
54
56
|
### 🚀 Advanced Capabilities
|
|
55
57
|
|
|
56
|
-
- **Streaming Encryption**: Memory-efficient processing for large files (<10MB RAM usage for any file size)
|
|
58
|
+
- **Streaming Encryption**: Memory-efficient processing for large files (<10MB RAM usage for any file size) with Web Streams API transforms
|
|
59
|
+
- **Fluent Builders**: Type-safe configuration with `ECIESBuilder` and `MemberBuilder` for clean, chainable APIs
|
|
57
60
|
- **Internationalization (i18n)**: Automatic error translation in 8 languages (en-US, en-GB, fr, es, de, zh-CN, ja, uk)
|
|
58
61
|
- **Runtime Configuration**: Injectable configuration profiles via `ConstantsRegistry` for dependency injection and testing
|
|
59
62
|
- **Cross-Platform**: Fully compatible with Node.js 18+ and modern browsers (Chrome, Edge, Firefox, Safari)
|
|
@@ -1046,6 +1049,19 @@ class MemberService {
|
|
|
1046
1049
|
- **`EciesMultiRecipient`**: Specialized service for handling multi-recipient messages.
|
|
1047
1050
|
- **`EciesFileService`**: Helper for chunked file encryption.
|
|
1048
1051
|
- **`PasswordLoginService`**: Secure authentication using PBKDF2 and encrypted key bundles.
|
|
1052
|
+
- **`AESGCMService`**: Instance-based AES-256-GCM encryption with JSON support.
|
|
1053
|
+
- **Methods**: `encrypt()`, `decrypt()`, `encryptJson()`, `decryptJson()`, `combineEncryptedDataAndTag()`
|
|
1054
|
+
- Supports authenticated encryption with optional AAD
|
|
1055
|
+
- **`Pbkdf2Service`**: Password-based key derivation (PBKDF2).
|
|
1056
|
+
- **Methods**: `deriveKeyFromPasswordAsync()`, `deriveKeyFromPasswordWithProfileAsync()`, `getProfileConfig()`
|
|
1057
|
+
- **Profiles**: Fast, Standard, Secure, Maximum
|
|
1058
|
+
- **`CrcService`**: CRC checksum computation and verification.
|
|
1059
|
+
- **Algorithms**: CRC8, CRC16-CCITT, CRC32
|
|
1060
|
+
- **Methods**: `crc8()`, `crc16()`, `crc32()`, `verifyCrc8()`, `verifyCrc16()`, `verifyCrc32()`
|
|
1061
|
+
- Supports async stream processing with `crc8Async()`, `crc16Async()`, `crc32Async()`
|
|
1062
|
+
- **`XorService`**: Simple XOR cipher for memory obfuscation.
|
|
1063
|
+
- **Static Methods**: `xor()`, `generateKey()`, `stringToBytes()`, `bytesToString()`
|
|
1064
|
+
- Used internally by `SecureString` and `SecureBuffer`
|
|
1049
1065
|
|
|
1050
1066
|
### Voting System Services
|
|
1051
1067
|
|
|
@@ -1095,6 +1111,25 @@ class MemberService {
|
|
|
1095
1111
|
- `fromJson(json, eciesService)`: Deserialize from JSON (uses ID provider)
|
|
1096
1112
|
- `newMember(...)`: Static factory method
|
|
1097
1113
|
- `fromMnemonic(...)`: Create from BIP39 mnemonic
|
|
1114
|
+
- **`MemberBuilder`**: Fluent builder for creating Member instances
|
|
1115
|
+
- **Methods**: `withId()`, `withName()`, `withEmail()`, `withPhone()`, `withType()`, `withKeys()`, `build()`
|
|
1116
|
+
- Provides type-safe member construction with validation
|
|
1117
|
+
|
|
1118
|
+
### Builders
|
|
1119
|
+
|
|
1120
|
+
- **`ECIESBuilder`**: Fluent builder for ECIESService configuration
|
|
1121
|
+
- **Methods**: `create()`, `withServiceConfig()`, `withConstants()`, `withI18n()`, `build()`
|
|
1122
|
+
- Simplifies service initialization with method chaining
|
|
1123
|
+
|
|
1124
|
+
### Stream Transforms
|
|
1125
|
+
|
|
1126
|
+
- **`EciesEncryptTransform`**: Web Streams API transform for ECIES encryption
|
|
1127
|
+
- **`EciesDecryptTransform`**: Web Streams API transform for ECIES decryption
|
|
1128
|
+
- **`ChecksumTransform`**: Stream transform for CRC checksum computation
|
|
1129
|
+
- **`XorTransform`**: Stream transform for XOR cipher operations
|
|
1130
|
+
- **`XorMultipleTransform`**: Stream transform for multiple XOR operations
|
|
1131
|
+
|
|
1132
|
+
All transforms implement the standard `Transformer<I, O>` interface for use with `TransformStream`.
|
|
1098
1133
|
|
|
1099
1134
|
### Voting System Types & Enumerations
|
|
1100
1135
|
|
|
@@ -1336,7 +1371,7 @@ fi
|
|
|
1336
1371
|
```bash
|
|
1337
1372
|
yarn install # Install dependencies
|
|
1338
1373
|
yarn build # Compile TypeScript
|
|
1339
|
-
yarn test # Run all tests (
|
|
1374
|
+
yarn test # Run all tests (2429 specs)
|
|
1340
1375
|
yarn lint # ESLint check
|
|
1341
1376
|
yarn format # Fix all (prettier + lint)
|
|
1342
1377
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digitaldefiance/ecies-lib",
|
|
3
|
-
"version": "4.17.
|
|
3
|
+
"version": "4.17.2",
|
|
4
4
|
"description": "Digital Defiance ECIES Library",
|
|
5
5
|
"homepage": "https://github.com/Digital-Defiance/ecies-lib",
|
|
6
6
|
"repository": {
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"license": "MIT",
|
|
63
63
|
"packageManager": "yarn@4.11.0",
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@digitaldefiance/i18n-lib": "4.3.
|
|
65
|
+
"@digitaldefiance/i18n-lib": "4.3.2",
|
|
66
66
|
"@ethereumjs/wallet": "^2.0.4",
|
|
67
67
|
"@noble/curves": "^1.4.2",
|
|
68
68
|
"@noble/hashes": "^1.4.0",
|