Skip to content

Commit ad30db5

Browse files
committed
Add ECIES operations
1 parent ed2e380 commit ad30db5

File tree

88 files changed

+983
-322
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+983
-322
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# TKeeper
2-
![](assets/gitkeeper.png)
1+
![](assets/tkeeper-github.png)
32

4-
**TKeeper** is a threshold signature service that provides a simple REST API for distributed signing using **GG20 (Threshold ECDSA)** and **FROST (Threshold Schnorr)** protocols. The service abstracts the complexity of multiparty computation: to sign a message or generate a key, a client just needs to send a single HTTP request.
5-
Powered by [tss4j](https://github.com/exploit-org/tss4j) - our threshold cryptography library.
3+
**TKeeper** is a threshold cryptographic engine that provides a simple REST API for:
4+
- Distributed signing using **GG20 (Threshold ECDSA)** and **FROST (Threshold Schnorr)** protocols.
5+
- Distributed encryption using **ECIES** (Elliptic Curve Integrated Encryption Scheme).
6+
7+
The service abstracts the complexity of multiparty computation: to sign a message or generate a key, a client just needs to send a single HTTP request. Powered by [tss4j](https://github.com/exploit-org/tss4j) - our threshold cryptography library.
68

79
It is suitable for custody systems, MPC-based wallets, and backend services that require distributed key management and signing without exposing private keys to any single participant.
810

@@ -27,4 +29,4 @@ See [docs](docs) for detailed documentation, or visit [docs.exploit.org/tkeeper]
2729
user-friendly view.
2830

2931
## License
30-
Finja is licensed under the [Apache License, Version 2.0](LICENSE.md)
32+
TKeeper is licensed under the [Apache License, Version 2.0](LICENSE.md)

assets/gitkeeper.png

-247 KB
Binary file not shown.

assets/tkeeper-github.png

517 KB
Loading

build.gradle

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ repositories {
1010
}
1111

1212
dependencies {
13+
implementation 'org.msgpack:jackson-dataformat-msgpack:0.9.10'
1314
implementation 'io.quarkiverse.loggingsentry:quarkus-logging-sentry:2.1.3'
1415
implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")
1516
implementation("io.quarkus:quarkus-hibernate-validator")
@@ -27,14 +28,15 @@ dependencies {
2728

2829
implementation 'com.fasterxml.jackson.module:jackson-module-kotlin:2.18.3'
2930

30-
implementation 'org.exploit:gg20:0.0.1'
31-
implementation 'org.exploit:frost:0.0.1'
32-
33-
implementation 'org.exploit:ed25519:0.0.1'
34-
implementation 'org.exploit:secp256k1:0.0.1'
35-
36-
implementation 'org.exploit:tss4j:0.0.1'
37-
implementation 'org.exploit:crypto:1.0.0'
31+
implementation 'org.exploit:bigint:0.0.2'
32+
implementation 'org.exploit:ed25519:0.0.2'
33+
implementation 'org.exploit:secp256k1:0.0.2'
34+
implementation 'org.exploit:sodium:0.0.2'
35+
implementation 'org.exploit:tss4j:0.0.2'
36+
implementation 'org.exploit:frost:0.0.2'
37+
implementation 'org.exploit:gg20:0.0.2'
38+
implementation 'org.exploit:ecies:0.0.2'
39+
implementation 'org.exploit:crypto:1.0.2'
3840

3941
implementation("org.exploit:tss4j-natives:1.0.0:linux-amd64@jar")
4042
implementation("org.exploit:tss4j-natives:1.0.0:macos-aarch64@jar")
@@ -51,12 +53,13 @@ dependencies {
5153
implementation 'software.amazon.awssdk:kms:2.31.33'
5254
implementation 'com.google.cloud:google-cloud-kms:2.63.0'
5355
implementation 'com.oracle.oci.sdk:oci-java-sdk-keymanagement:3.63.3'
56+
implementation 'io.github.jopenlibs:vault-java-driver:6.2.0'
5457

5558
testImplementation 'io.quarkus:quarkus-junit5'
5659
}
5760

5861
group 'org.exploit'
59-
version '1.0.0-BETA'
62+
version '1.0.0-RC1'
6063

6164
java {
6265
sourceCompatibility = JavaVersion.VERSION_17

docs/API.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,14 @@ Deletes the distributed key from **all peers**. The initiating node contacts eve
158158

159159
---
160160

161+
## 7. ECIES (Encryption/Decryption)
162+
### `POST /ecies/encrypt`
163+
Encrypts data using ECIES with the specified key ID and cipher.
164+
- See: [Encryption & Decryption](ecies.md)
165+
### `POST /ecies/decrypt`
166+
Decrypts data using ECIES with the specified key ID and cipher.
167+
- See: [Encryption & Decryption](ecies.md)
168+
161169
## Permissions Overview
162170

163171
Each endpoint requires a specific permission token.

docs/INDEX.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
# TKeeper Overview
22

3-
TKeeper is a secure threshold signature service built on top of multiparty computation (MPC). It allows multiple participants to cooperatively sign messages without ever reconstructing the private key in full.
3+
TKeeper is a secure threshold cryptography engine built on top of multiparty computation (MPC). It allows multiple participants to cooperatively sign or encrypt messages without ever reconstructing the private key in full.
44

55
At its core, TKeeper implements two well-established threshold signature schemes:
66

7+
## Distributed signing
78
- **GG20** – for threshold ECDSA signatures
89
- **FROST** – for threshold Schnorr signatures
910

1011
These protocols allow distributed signing using elliptic curves (`SECP256K1` and `ED25519`), ensuring strong cryptographic guarantees while maintaining flexibility across use cases.
1112

13+
## Distributed encryption
14+
* **ECIES** – EC ElGamal KEM + AEAD, backed by DLEQ proofs. Perfect forward secrecy with per-message HKDF.
15+
1216
To protect key material at rest, TKeeper includes a configurable **seal & unseal mechanism**. Depending on configuration, the local key share is either manually unsealed using Shamir shares, or automatically decrypted using cloud KMS providers like AWS or Google Cloud.
1317

1418
All access to signing, key generation, or configuration is protected by a strict **permission-based authorization model**, enforced via JWT tokens. Each request must include the necessary scope in its `permissions` field to be accepted.

docs/SIGN.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ Performs a threshold signature over one or more messages.
4747
```json
4848
{
4949
"keyId": "my-key-id",
50-
"curve": "SECP256K1",
5150
"type": "GG20",
5251
"operations": {
5352
"message1": "base64-encoded data",
@@ -59,7 +58,6 @@ Performs a threshold signature over one or more messages.
5958
#### Fields
6059

6160
- `keyId`: identifier of the key to sign with
62-
- `curve`: elliptic curve (`SECP256K1` or `ED25519`)
6361
- `type`: session type (`GG20` or `FROST`)
6462
- `operations`: map of operation ID → base64-encoded message
6563

@@ -84,8 +82,6 @@ Verifies a signature against a key.
8482

8583
```json
8684
{
87-
"sigType": "SCHNORR",
88-
"curve": "SECP256K1",
8985
"keyId": "my-key-id",
9086
"data64": "base64-encoded message",
9187
"signature64": "base64-encoded signature"
@@ -94,17 +90,10 @@ Verifies a signature against a key.
9490

9591
#### Fields
9692

97-
- `sigType`: optional; can be `ECDSA` or `SCHNORR`
98-
- `curve`: elliptic curve used
9993
- `keyId`: key to verify against
10094
- `data64`: base64-encoded original message
10195
- `signature64`: base64-encoded signature
10296

103-
If `sigType` is not provided, it falls back to:
104-
105-
- `SECP256K1``ECDSA`
106-
- `ED25519``SCHNORR`
107-
10897
#### Response
10998

11099
```json
File renamed without changes.

docs/CONFIG.md renamed to docs/config.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ seal:
129129

130130
> Unseal is automatic at startup.
131131

132-
See [SEAL.md](SEAL.md) for more details on sealing and unsealing.
132+
See [seal.md](seal.md) for more details on sealing and unsealing.
133133

134134
---
135135

@@ -152,7 +152,7 @@ keeper:
152152
- `jwt.jwks-location`: URL of the JWKS endpoint for public key retrieval.
153153
- `jwt.refresh`: optional refresh interval for reloading the JWKS.
154154

155-
See [SEAL.md](AUTH.md) for authentication options and JWT integration.
155+
See [auth.md](auth.md) for authentication options and JWT integration.
156156

157157
---
158158

docs/ecies.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Encrypting / Decrypting with ECIES
2+
3+
TKeeper provides threshold ECIES encryption/decryption.
4+
Encryption is done with the public key and is stateless; decryption is MPC-based — the private key is never reconstructed.
5+
6+
## Supported curves
7+
Currently only Weierstrass curves are supported (e.g `SECP256K1`) to be used for ECIES.
8+
9+
## Supported ciphers
10+
- `AES_GCM`: AES-256 in Galois/Counter Mode (GCM)
11+
12+
## API
13+
14+
### Encryption
15+
#### Endpoint
16+
**POST** `/v1/keeper/ecies/encrypt`
17+
```json
18+
{
19+
"keyId": "my-key-id",
20+
"cipher": "AES_GCM",
21+
"plaintext64": "base64-encoded data"
22+
}
23+
```
24+
25+
Sample response:
26+
```json
27+
{
28+
"ciphertext64": "base64-encoded-ciphertext"
29+
}
30+
```
31+
32+
### Decryption
33+
#### Endpoint
34+
**POST** `/v1/keeper/ecies/decrypt`
35+
```json
36+
{
37+
"keyId": "my-key-id",
38+
"cipher": "AES_GCM",
39+
"ciphertext64": "base64-encoded-ciphertext"
40+
}
41+
```
42+
Sample response:
43+
```json
44+
{
45+
"plaintext64": "base64-encoded-plaintext"
46+
}
47+
```

0 commit comments

Comments
 (0)