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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@eliza-dot-aes/ed25519-aes

v1.0.4

Published

AES encryption with Ed25519/X25519 cryptographic backend

Downloads

204

Readme

@eliza-dot-aes/ed25519-aes

AES encryption implementation using Ed25519/X25519 for key exchange.

Features

  • Ed25519 key generation with X25519 key exchange
  • AES-CBC encryption with HMAC-SHA512
  • Secure message padding and random prefix generation
  • TypeScript support with full type definitions

Installation

pnpm add @eliza-dot-aes/ed25519-aes

Usage

Here's a complete example showing how to encrypt and decrypt messages between two parties:

import { ED25519AES } from '@eliza-dot-aes/ed25519-aes';

async function main() {
    // Initialize Alice and Bob with their private keys
    const alice = await ED25519AES.build(
        "0x9d61b19deffd5020afb5b1a7877f2e1e0a4f5c5e0a4f5c5e0a4f5c5e0a4f5c5e"
    );
    const bob = await ED25519AES.build(
        "0x9d61b19deffd5020afb5b1a7877f2e1e0a4f5c5e0a4f5c5e0a4f5c5e0a4f5c5d"
    );

    // Wait for initialization (key generation)
    // await new Promise(resolve => setTimeout(resolve, 100));

    // Alice encrypts a message for Bob
    const message = "Hello Bob! This is a secret message from Alice.";
    const encryptedMessage = await alice.encryptMessage(message, bob.publicKey);
    console.log("Encrypted:", encryptedMessage);

    // Bob decrypts Alice's message
    const decryptedMessage = await bob.decryptMessage(encryptedMessage);
    console.log("Decrypted:", decryptedMessage);

    // Bob sends a reply to Alice
    const reply = "Hi Alice! Got your message, here's my secret reply.";
    const encryptedReply = await bob.encryptMessage(reply, alice.publicKey);
    console.log("Encrypted Reply:", encryptedReply);

    // Alice decrypts Bob's reply
    const decryptedReply = await alice.decryptMessage(encryptedReply);
    console.log("Decrypted Reply:", decryptedReply);
}

main().catch(console.error);

API

ED25519AES

Main class for handling encrypted message operations.

Constructor

constructor(seedOrprivateKey: string)
  • seedOrprivateKey: Hexadecimal string of seed for Ed25519 key generation

Methods

// Encrypt a message
async encryptMessage(message: string, toPublicKey: Uint8Array): Promise<string>

// Decrypt a message
async decryptMessage(message: string): Promise<string>

Technical Details

  1. Key Generation:

    • Uses Ed25519 for initial key generation
    • Converts Ed25519 keys to X25519 format for Diffie-Hellman
    • Public keys are automatically converted to Montgomery form
  2. Key Exchange:

    • Uses X25519 for Diffie-Hellman key exchange
    • Automatically handles conversion between Ed25519 and X25519 formats
    • Generates shared secrets using Montgomery ladder

Security Features

  • Uses Ed25519/X25519 for secure key exchange
  • AES-256-CBC for symmetric encryption
  • HMAC-SHA512 for message authentication
  • Random padding for message length obfuscation
  • Secure key derivation from shared secrets
  • Automatic key format conversion

License

Apache License 2.0