New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

cordsid-message

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordsid-message

A library for creating and verifying signed messages

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

cordsid-message

A library for creating and verifying signed messages.

Installation

npm install cordsid-message
# or
yarn add cordsid-message
# or
pnpm add cordsid-message

Usage

import { 
  createMessageKeypair, 
  signMessage, 
  verifyMessage 
} from 'cordsid-message';

// Create a message keypair
const keypairResult = await createMessageKeypair(
  walletSignFunction,  // Your wallet sign function
  walletAddress,       // Wallet address
  30                   // Expiration days
);

// Sign a message
const message = { content: "Hello world" };
const signedMessage = signMessage(
  message,
  walletAddress,
  new Date().toISOString(),
  keypairResult.messageKeypairPrivateKey,
  keypairResult.authSignature,
  keypairResult.issuedAt,
  keypairResult.expiresAt
);

// Verify a message
const verification = verifyMessage(signedMessage);
if (verification.valid) {
  console.log("Message verified successfully");
} else {
  console.error("Message verification failed:", verification.error);
}

API Reference

See the TypeScript definitions for detailed API documentation.

License

ISC

Keywords

crypto

FAQs

Package last updated on 12 Apr 2025

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