Skip to content

eka-care/abdm-ecdh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

abdm-ecdh

ABDM (Ayushman Bharat Digital Mission) ECDH encryption/decryption for secure health data exchange.

What this does

ABDM's HIE-CM specification requires a specific encryption scheme for exchanging health records between parties. This library implements that scheme.

The overall pattern — ECDH key agreement → HKDF key derivation → AES-GCM encryption — is standard. Two things make it ABDM-specific:

1. Weierstrass Curve25519 ABDM's reference implementation is in Java using BouncyCastle, which represents Curve25519 in short Weierstrass form (y² = x³ + Ax + B) rather than the standard Montgomery form used by X25519. Standard crypto libraries don't expose this form, so the elliptic curve math is implemented directly.

2. Dual-nonce IV derivation Both parties generate and exchange a random nonce. The sender and requester nonces are XOR'd together to produce the AES-GCM IV (last 12 bytes) and HKDF salt (first 20 bytes). This ensures both parties contribute entropy to the session.

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)

CI Status

CI — Go CI — Python CI — Java

Packages

Language Docs Install
Go go/ go get github.com/eka-care/abdm-ecdh/go@v1.0.0
Python python/ pip install abdm-ecdh
Java java/ com.github.eka-care:abdm-ecdh:java/v1.0.0 (JitPack)

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors