Skip to content

Commit

Permalink
Bump dependencies (#739)
Browse files Browse the repository at this point in the history
  • Loading branch information
kigawas committed Sep 15, 2023
1 parent bac9aaa commit 6212e7f
Show file tree
Hide file tree
Showing 5 changed files with 349 additions and 328 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Run the code below with `npx ts-node`.
> import { encrypt, decrypt, PrivateKey } from 'eciesjs'
> const sk = new PrivateKey()
> const data = Buffer.from('hello world🌍')
> decrypt(sk.toHex(), encrypt(sk.publicKey.toHex(), data)).toString()
> decrypt(sk.secret, encrypt(sk.publicKey.toHex(), data)).toString()
'hello world🌍'
```

Expand Down Expand Up @@ -123,23 +123,23 @@ export const ECIES_CONFIG = new Config();

### Elliptic curve configuration

If you set `ellipticCurve = "x25519"` or `ellipticCurve = "ed25519"`, x25519 (key exchange function on curve25519) or ed25519 (signature algorithm on curve25519) will be used for key exchange instead of secp256k1.
On `ellipticCurve = "x25519"` or `ellipticCurve = "ed25519"`, x25519 (key exchange function on curve25519) or ed25519 (signature algorithm on curve25519) will be used for key exchange instead of secp256k1.

In this case, the payload would always be: `32 Bytes + AES` regardless of `isEphemeralKeyCompressed`.
In this case, the payload would always be: `32 Bytes + Ciphered` regardless of `isEphemeralKeyCompressed`.

> If you don't know how to choose between x25519 and ed25519, just use x25519 for efficiency.
> If you don't know how to choose between x25519 and ed25519, just use the dedicated key exchange function x25519 for efficiency.
### Secp256k1-specific configuration

If you set `isEphemeralKeyCompressed = true`, the payload would be: `33 Bytes + AES` instead of `65 Bytes + AES`.
On `isEphemeralKeyCompressed = true`, the payload would be: `33 Bytes + Ciphered` instead of `65 Bytes + Ciphered`.

If you set `isHkdfKeyCompressed = true`, the hkdf key would be derived from `ephemeral public key (compressed) + shared public key (compressed)` instead of `ephemeral public key (uncompressed) + shared public key (uncompressed)`.
On `isHkdfKeyCompressed = true`, the hkdf key would be derived from `ephemeral public key (compressed) + shared public key (compressed)` instead of `ephemeral public key (uncompressed) + shared public key (uncompressed)`.

### Symmetric cipher configuration

If you set `symmetricAlgorithm = "xchacha20"`, plaintext data would be encrypted with XChaCha20-Poly1305.
On `symmetricAlgorithm = "xchacha20"`, plaintext data would be encrypted with XChaCha20-Poly1305.

If you set `symmetricNonceLength = 12`, the nonce of AES-256-GCM would be 12 bytes. XChaCha20-Poly1305's nonce is always 24 bytes regardless of `symmetricNonceLength`.
On `symmetricNonceLength = 12`, the nonce of AES-256-GCM would be 12 bytes. XChaCha20-Poly1305's nonce is always 24 bytes regardless of `symmetricNonceLength`.

## Security Audit

Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eciesjs",
"description": "Elliptic Curve Integrated Encryption Scheme for secp256k1",
"description": "Elliptic Curve Integrated Encryption Scheme for secp256k1/curve25519",
"license": "MIT",
"author": {
"name": "Weiliang Li",
Expand All @@ -17,6 +17,7 @@
},
"keywords": [
"secp256k1",
"curve25519",
"crypto",
"elliptic curves",
"ecies",
Expand All @@ -40,10 +41,10 @@
},
"devDependencies": {
"@types/jest": "^29.5.4",
"@types/node": "^20.5.9",
"@types/node-fetch": "^2.6.4",
"@types/node": "^20.6.0",
"@types/node-fetch": "^2.6.5",
"https-proxy-agent": "^7.0.2",
"jest": "^29.6.4",
"jest": "^29.7.0",
"node-fetch": "^2.7.0",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
Expand Down
Loading

0 comments on commit 6212e7f

Please sign in to comment.