Getting Started with MetaMUI Crypto Primitives
Welcome to MetaMUI Crypto Primitives! This guide will help you get started with our cross-platform cryptographic library supporting 33 algorithms across 6 platforms.
Choose Your Platform
Python
metamui-crypto
Rust
metamui-crypto
TypeScript
@metamui/crypto
Swift
MetaMUICrypto
Kotlin
id.metamui.crypto
WASM
@metamui/crypto-wasm
Quick Example
Hereβs a simple example using Ed25519 signatures across different platforms:
Python
from metamui_crypto import Ed25519
# Generate a key pair
keypair = Ed25519.generate_keypair()
# Sign a message
message = b"Hello, MetaMUI!"
signature = Ed25519.sign(message, keypair.private_key)
# Verify the signature
is_valid = Ed25519.verify(signature, message, keypair.public_key)
print(f"Signature valid: {is_valid}")
Rust
use metamui_crypto::ed25519::{Ed25519, KeyPair};
// Generate a key pair
let keypair = KeyPair::generate();
// Sign a message
let message = b"Hello, MetaMUI!";
let signature = keypair.sign(message);
// Verify the signature
let is_valid = keypair.public_key().verify(&signature, message);
println!("Signature valid: {}", is_valid);
TypeScript
import { Ed25519 } from '@metamui/crypto';
// Generate a key pair
const keypair = Ed25519.generateKeypair();
// Sign a message
const message = new TextEncoder().encode("Hello, MetaMUI!");
const signature = Ed25519.sign(message, keypair.privateKey);
// Verify the signature
const isValid = Ed25519.verify(signature, message, keypair.publicKey);
console.log(`Signature valid: ${isValid}`);
Core Concepts
1. Pure Implementations
All algorithms are implemented from scratch without external cryptographic dependencies, ensuring:
- Consistent behavior across platforms
- No supply chain vulnerabilities
- Complete control over security properties
- Easier auditing and verification
2. Security First
Every implementation prioritizes security:
- Constant-time operations to prevent timing attacks
- Secure memory handling with automatic clearing
- Comprehensive input validation
- Side-channel resistant implementations
3. Cross-Platform Compatibility
All 33 algorithms work identically across all 6 platforms:
- Same API structure
- Identical test vectors
- Consistent error handling
- Compatible serialization formats
Common Use Cases
Quantum-Resistant Encryption
from metamui_crypto import MLKem768, AES256
# Generate ML-KEM keypair
kem_keypair = MLKem768.generate_keypair()
# Encapsulate to create shared secret
ciphertext, shared_secret = MLKem768.encapsulate(kem_keypair.public_key)
# Use shared secret for AES encryption
aes_key = shared_secret[:32]
encrypted_data = AES256.encrypt(data, aes_key)
Password Hashing
from metamui_crypto import Argon2
# Hash a password with Argon2
password = "user_password"
salt = Argon2.generate_salt()
hash = Argon2.hash(password, salt, memory=256*1024, iterations=4)
# Verify password
is_valid = Argon2.verify(password, hash)
Digital Signatures
from metamui_crypto import Dilithium
# Generate post-quantum signature keypair
keypair = Dilithium.generate_keypair()
# Sign a document
document = b"Important document"
signature = Dilithium.sign(document, keypair.private_key)
# Verify signature
is_valid = Dilithium.verify(signature, document, keypair.public_key)
Next Steps
- Installation Guide - Detailed installation instructions
- Platform Guides - Platform-specific documentation
- API Reference - Complete API documentation
- Security Best Practices - Security guidelines
- Algorithm Details - In-depth algorithm information
- Integration Examples - Real-world usage examples
Getting Help
- Documentation: Browse our comprehensive documentation
- Examples: Check out integration examples
- Issues: Report issues on GitHub
- Commercial Support: Contact license@metamui.id
Ready to build quantum-resistant applications? Letβs get started!