Quick Start

Get up and running with cryptographer.js in just a few minutes.

Basic Usage

1. Hash Functions

import crypto from 'cryptographer.js';

// SHA-256 hash
const hash = crypto.sha.sha256('Hello World');
console.log(hash); // 'a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e'

// SHA-512 hash
const hash512 = crypto.sha.sha512('Hello World');

// BLAKE3 hash (faster than SHA-256)
const blake3Hash = crypto.sha.blake3('Hello World');

// Different output formats
const hexHash = crypto.sha.sha256('Hello World', { outputFormat: 'hex' });
const base64Hash = crypto.sha.sha256('Hello World', { outputFormat: 'base64' });
const bufferHash = crypto.sha.sha256('Hello World', { outputFormat: 'buffer' });

2. HMAC (Hash-based Message Authentication Code)

3. Symmetric Encryption (AES, ChaCha20, DES/3DES)

4. Key Derivation Functions

5. Public-Key & Key Exchange

6. Zero-Knowledge (Groth16) — synchronous

Advanced Usage

Streaming Hash Operations

File Encryption

Password Management System

Performance Tips

1. Reuse Hash Instances

2. Use Appropriate Algorithms

3. Optimize Buffer Operations

Error Handling

6. Zero-Knowledge Proofs (ZK)

Next Steps

Last updated