npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

megacrypt

v1.0.3

Published

A robust cryptographic session engine with domain separation and tamper detection.

Readme

MegaCrypt SDK

Crates.io npm CI License

Enterprise Cross-Platform End-to-End Encryption Engine

MegaCrypt is a high-performance cryptographic SDK written in Rust and designed for secure application infrastructure.

It provides a unified encryption layer across:

  • Native Rust applications
  • Backend services
  • Node.js environments
  • Browser applications through WebAssembly
  • Cross-platform secure communication systems

MegaCrypt focuses on:

  • authenticated encryption
  • secure key derivation
  • encrypted packet transport
  • portable cryptographic workflows
  • memory-safe implementation

The project is designed for applications requiring strong confidentiality guarantees, including:

  • secure messaging platforms
  • encrypted APIs
  • file protection systems
  • WebRTC signaling layers
  • confidential application data pipelines

Security Model

MegaCrypt follows a zero-trust encryption architecture.

The library does not implement custom cryptographic algorithms. Instead, it combines established cryptographic primitives through controlled APIs.

Cryptographic Components

| Component | Algorithm | Purpose | | ------------------------ | ----------------- | --------------------------------------------- | | Authenticated Encryption | ChaCha20-Poly1305 | Encrypt and authenticate application data | | Password Key Derivation | Argon2id | Derive encryption keys from user secrets | | Hash Derivation | BLAKE3 | Fast cryptographic hashing and key derivation | | Random Generation | OS CSPRNG | Secure nonce and salt generation |


Architecture Overview

            Application Layer

┌─────────────────────────────────┐
│ Chat • API • Storage • Media    │
└───────────────┬─────────────────┘
                │

┌───────────────┴─────────────────┐
│          MegaCrypt API           │
│                                  │
│  Rust API      WASM API          │
└───────────────┬─────────────────┘
                │

┌───────────────┴─────────────────┐
│        Crypto Engine             │
│                                  │
│ Key Management                   │
│ Encryption Contexts              │
│ Packet Processing                │
└───────────────┬─────────────────┘
                │

┌───────────────┴─────────────────┐
│     ChaCha20-Poly1305 AEAD       │
└─────────────────────────────────┘

Features

Core Cryptography

  • Authenticated encryption
  • Secure key derivation
  • Random nonce generation
  • Tamper detection
  • Portable encrypted packets

Rust Native Support

  • Zero-cost abstractions
  • Memory safety guarantees
  • Async-compatible integration
  • Server-side deployment support

JavaScript Support

  • WebAssembly bindings
  • Node.js compatibility
  • TypeScript definitions
  • Browser-ready encryption APIs

Installation

Rust

Add MegaCrypt to your Cargo.toml:

[dependencies]
megacrypt = "1.0.0"

Then:

cargo build

Node.js / TypeScript

Install using npm:

npm install megacrypt

or:

pnpm add megacrypt

Quick Start

Rust Example

use megacrypt::{ CryptoEngine, derive_password_key };
use megacrypt::api::ApiCrypto;
use megacrypt::types::Salt;
use megacrypt::kdf::KdfParams;

fn main() {
    // 1. Create a valid 16-byte salt type
    let salt = Salt::new(*b"megacryptsalt16b");

    // 2. Supply the missing KdfParams argument (using default parameters)
    let key = derive_password_key(b"password", &salt, KdfParams::default()).expect(
        "Failed to derive password key"
    );

    let engine = CryptoEngine::new(key);

    let message = b"confidential message";

    // 3. Encrypt and wrap using the API layer
    let packet = ApiCrypto::encrypt_request(&engine, message);

    // This is what you send to frontend / API
    println!("WEB RESPONSE: {}", packet.data);

    // 4. Decrypt back
    let decrypted = ApiCrypto::decrypt_request(&engine, packet);

    println!("DECRYPTED: {}", String::from_utf8_lossy(&decrypted));
}

JavaScript / TypeScript Example

import { WasmApiCrypto } from "megacrypt";

const crypto = new WasmApiCrypto("application-secret");

const encoder = new TextEncoder();

const payload = encoder.encode("confidential message");

const encrypted = crypto.encrypt_request(payload);

console.log(encrypted);

const decrypted = crypto.decrypt_request(encrypted);

console.log(new TextDecoder().decode(decrypted));