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

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:

2. Security First

Every implementation prioritizes security:

3. Cross-Platform Compatibility

All 33 algorithms work identically across all 6 platforms:

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

  1. Installation Guide - Detailed installation instructions
  2. Platform Guides - Platform-specific documentation
  3. API Reference - Complete API documentation
  4. Security Best Practices - Security guidelines
  5. Algorithm Details - In-depth algorithm information
  6. Integration Examples - Real-world usage examples

Getting Help


Ready to build quantum-resistant applications? Let’s get started!