Skip to main content

@hex-di ecosystem

Crypto

Cryptographic Operations for TypeScript

Get Started
npm install @hex-di/crypto

:: features

Why Crypto?

Type-Safe Hashing

SHA-256, SHA-512, HMAC with typed inputs and outputs. No raw buffer juggling.

Encryption

AES-GCM, ChaCha20 with key management through the DI graph.

Digital Signatures

Ed25519, RSA-PSS signing and verification with type-safe key pairs.

Key Derivation

PBKDF2, scrypt, Argon2 with configurable parameters and safe defaults.

Port-Based

Crypto is a port. Swap between Node.js crypto, WebCrypto, or a test stub.

Constant-Time

Timing-safe comparison functions. No side-channel vulnerabilities.

:: ecosystem

Part of the HexDI Stack

Crypto integrates seamlessly with the HexDI dependency injection ecosystem. Use it standalone or compose it with other libraries.

Explore HexDI