Development & Integration Guides

Comprehensive guides for developing with and integrating MetaMUI Crypto Primitives into your applications.

Overview

This section provides practical guides for developers working with MetaMUI Crypto Primitives, covering everything from basic usage to advanced integration scenarios.

Guide Categories

🚀 Getting Started

💻 Development Guides

🔄 Migration Guides

🔧 Implementation Guides

Classical Algorithms

Post-Quantum Algorithms

📦 Package Management

🔒 Security Guides

Quick Reference Guides

Common Tasks

Integration Patterns

Code Examples

Basic Encryption (TypeScript)

import { AES256GCM } from '@metamui/aes-256-gcm';

// Generate a key
const key = AES256GCM.generateKey();

// Encrypt data
const plaintext = new TextEncoder().encode('Hello, World!');
const { ciphertext, nonce, tag } = await AES256GCM.encrypt(key, plaintext);

// Decrypt data
const decrypted = await AES256GCM.decrypt(key, ciphertext, nonce, tag);

Post-Quantum Key Exchange

import { MLKEM768 } from '@metamui/mlkem768';

// Generate keypair
const { publicKey, secretKey } = await MLKEM768.keypair();

// Encapsulation (sender)
const { ciphertext, sharedSecret } = await MLKEM768.encapsulate(publicKey);

// Decapsulation (receiver)
const receivedSecret = await MLKEM768.decapsulate(ciphertext, secretKey);

Best Practices

  1. Algorithm Selection
    • Use post-quantum algorithms for long-term security
    • Consider hybrid approaches for transition periods
    • Match algorithm strength to data sensitivity
  2. Key Management
    • Never hard-code keys
    • Use secure key derivation functions
    • Implement proper key rotation
  3. Error Handling
    • Handle cryptographic errors securely
    • Avoid leaking information through error messages
    • Implement proper logging without exposing sensitive data