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

react-native-privyx-crypto

v0.1.1

Published

Post-quantum hybrid cryptography for React Native (X25519 + ML-KEM-768 + AES-256-GCM)

Downloads

13

Readme

react-native-privyx-crypto

Post-quantum hybrid cryptography for React Native.

Combines X25519 (ECDH) + ML-KEM-768 (post-quantum KEM) with AES-256-GCM encryption. Uses prebuilt native binaries — no Rust toolchain required.

Installation

npm install react-native-privyx-crypto

For iOS, after installing:

cd ios && pod install

Usage

import {
  generateX25519KeyPair,
  generateMlKemKeyPair,
  x25519DeriveSecret,
  mlKemEncapsulate,
  mlKemDecapsulate,
  deriveHybridSecret,
  encrypt,
  decrypt,
  generateIV,
} from 'react-native-privyx-crypto';

Key Generation

// Generate X25519 (ECDH) key pair
const x25519 = await generateX25519KeyPair();
// { publicKey: 'base64...', privateKey: 'base64...' }

// Generate ML-KEM-768 (post-quantum) key pair
const mlkem = await generateMlKemKeyPair();
// { publicKey: 'base64...', privateKey: 'base64...' }

Key Exchange (Initiator)

// Alice derives shared secret using her private key + Bob's public keys
const x25519Secret = await x25519DeriveSecret(alice.privateKey, bob.x25519PublicKey);

const mlkemEnc = await mlKemEncapsulate(bob.mlkemPublicKey);
// { sharedSecret: 'base64...', ciphertext: 'base64...' }

const hybridSecret = await deriveHybridSecret(x25519Secret, mlkemEnc.sharedSecret);

Key Exchange (Responder)

// Bob derives shared secret using his private key + Alice's ciphertext
const x25519Secret = await x25519DeriveSecret(bob.privateKey, alice.x25519PublicKey);

const mlkemSecret = await mlKemDecapsulate(bob.mlkemPrivateKey, mlkemCiphertext);

const hybridSecret = await deriveHybridSecret(x25519Secret, mlkemSecret);

Both parties arrive at the same hybridSecret.

Encrypt / Decrypt

const iv = await generateIV();
const ciphertext = await encrypt('Hello, post-quantum world!', hybridSecret, iv);

const plaintext = await decrypt(ciphertext, iv, hybridSecret);

API

All functions return Promise. All keys and ciphertexts are base64-encoded strings.

| Function | Returns | |---|---| | generateX25519KeyPair() | { publicKey, privateKey } | | generateMlKemKeyPair() | { publicKey, privateKey } | | x25519DeriveSecret(privateKey, publicKey) | string (shared secret) | | mlKemEncapsulate(publicKey) | { sharedSecret, ciphertext } | | mlKemDecapsulate(privateKey, ciphertext) | string (shared secret) | | deriveHybridSecret(x25519Secret, mlkemSecret) | string (SHA-256 hybrid) | | encrypt(plaintext, sharedSecret, iv) | string (base64 ciphertext) | | decrypt(ciphertext, iv, sharedSecret) | string (plaintext) | | generateIV() | string (base64 12-byte IV) |

Supported Platforms

| Platform | Architectures | |---|---| | Android | arm64-v8a, armeabi-v7a, x86_64 | | iOS (device) | arm64 | | iOS (simulator) | arm64-sim, x86_64-sim |

Requirements

  • React Native >= 0.71
  • Android minSdk 24+
  • iOS 15.1+

License

MIT