Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@stablelib/ed25519

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stablelib/ed25519

Ed25519 public-key signature (EdDSA with Curve25519)

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
381K
decreased by-0.35%
Maintainers
1
Weekly downloads
 
Created

What is @stablelib/ed25519?

@stablelib/ed25519 is a JavaScript library for Ed25519 public-key signature system. It provides functionalities for key generation, signing messages, and verifying signatures. The library is part of the StableLib collection, which is known for its focus on security and performance.

What are @stablelib/ed25519's main functionalities?

Key Generation

This feature allows you to generate a new Ed25519 key pair. The `generateKeyPair` function returns an object containing a `publicKey` and a `secretKey`.

const { generateKeyPair } = require('@stablelib/ed25519');
const keyPair = generateKeyPair();
console.log('Public Key:', keyPair.publicKey);
console.log('Secret Key:', keyPair.secretKey);

Signing Messages

This feature allows you to sign a message using a secret key. The `sign` function takes a secret key and a message, and returns the signature.

const { sign } = require('@stablelib/ed25519');
const message = new Uint8Array([1, 2, 3, 4, 5]);
const signature = sign(keyPair.secretKey, message);
console.log('Signature:', signature);

Verifying Signatures

This feature allows you to verify a signature using a public key. The `verify` function takes a public key, a message, and a signature, and returns a boolean indicating whether the signature is valid.

const { verify } = require('@stablelib/ed25519');
const isValid = verify(keyPair.publicKey, message, signature);
console.log('Is the signature valid?', isValid);

Other packages similar to @stablelib/ed25519

FAQs

Package last updated on 10 Feb 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc