mcps-crypto

Crates.iomcps-crypto
lib.rsmcps-crypto
version0.1.0
created_at2025-06-15 09:18:47.023832+00
updated_at2025-06-15 09:18:47.023832+00
descriptionCryptographic primitives for MCPS protocol
homepagehttps://github.com/SamDuchaine/mpcs
repositoryhttps://github.com/SamDuchaine/mpcs
max_upload_size
id1713099
size12,829
SamDuchaine (SamDuchaine)

documentation

README

MCPS Crypto

Cryptographic primitives for MCPS protocol

Crates.io Documentation License

MCPS (Model Context Protocol Secure) is "The HTTPS of MCP" - providing enterprise-grade security, encryption, and authentication for Model Context Protocol communications.

Overview

The mcps-crypto crate provides the cryptographic foundation for MCPS, including:

  • 🔒 Modern Encryption - ChaCha20-Poly1305 authenticated encryption
  • 🔑 Key Exchange - X25519 Elliptic Curve Diffie-Hellman
  • 🛡️ Digital Signatures - Ed25519 signature verification
  • 📊 Hashing - BLAKE3 high-performance cryptographic hash
  • 🔐 Key Derivation - HKDF and PBKDF2 key derivation functions

Features

  • Memory Safe: Pure Rust implementation with no C dependencies
  • High Performance: Optimized for speed and security
  • Constant Time: Timing-attack resistant implementations
  • Well Tested: Comprehensive test suite and fuzzing
  • Standards Compliant: Following RFC specifications

Quick Start

use mcps_crypto::{KeyPair, encrypt, decrypt};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Generate key pair
    let keypair = KeyPair::generate();
    
    // Encrypt message
    let message = b"Hello, secure world!";
    let encrypted = encrypt(message, &keypair.public_key())?;
    
    // Decrypt message
    let decrypted = decrypt(&encrypted, &keypair.private_key())?;
    assert_eq!(message, &decrypted[..]);
    
    println!("Encryption successful!");
    Ok(())
}

Cryptographic Primitives

This crate provides:

  • Symmetric Encryption: ChaCha20-Poly1305 AEAD
  • Asymmetric Encryption: X25519 key exchange
  • Digital Signatures: Ed25519 signature scheme
  • Hash Functions: BLAKE3 and SHA-256
  • Key Derivation: HKDF-SHA256 and PBKDF2
  • Random Generation: Cryptographically secure RNG

Documentation

Related Crates

License

Licensed under the Apache License, Version 2.0. See LICENSE for details.

Security

For security vulnerabilities, please see our Security Policy and report issues to security@kindly.dev.

Commit count: 0

cargo fmt