ABDM’s HIE-CM specification requires a specific ECDH-based encryption scheme for exchanging health records between parties. Use the open-source eka-care/abdm-ecdh library to perform all cryptographic operations.Documentation Index
Fetch the complete documentation index at: https://developer.eka.care/llms.txt
Use this file to discover all available pages before exploring further.
The library implements ECDH key agreement on Curve25519 (Weierstrass form) — matching Java/BouncyCastle — with HKDF-SHA256 key derivation and AES-256-GCM encryption. This is the same algorithm required by ABDM.
Installation
Usage
Key Material
GenerateKeyMaterial / generate_key_material returns:
| Field | Description |
|---|---|
privateKey / private_key | Base64-encoded private scalar |
publicKey / public_key | Base64-encoded uncompressed EC point (65 bytes) |
x509PublicKey / x509_public_key | Base64-encoded X.509 SubjectPublicKeyInfo DER — share with the counterparty |
nonce / nonce | Base64-encoded 32-byte random nonce — share with the counterparty |
Cryptographic Details
| Step | Algorithm |
|---|---|
| Key agreement | ECDH on Curve25519 (Weierstrass form) |
| Key derivation | HKDF-SHA256 (salt = first 20 bytes of XOR’d nonces) |
| Encryption | AES-256-GCM (IV = last 12 bytes of XOR’d nonces) |
| Key encoding | X.509 SubjectPublicKeyInfo DER (BouncyCastle explicit params) |

