
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
@peac/crypto
Advanced tools
Ed25519 JWS signing and verification for PEAC protocol receipts.
pnpm add @peac/crypto
@peac/crypto is Layer 2 of the PEAC protocol stack. It provides Ed25519 key generation, JWS compact serialization (signing and verification), SHA-256 hashing, base64url encoding, JWK thumbprint computation, and JSON Canonicalization (RFC 8785). All primitives are runtime-agnostic and work in Node.js, browsers, and edge workers.
import { generateKeypair, sign } from '@peac/crypto';
const { privateKey, publicKey } = await generateKeypair();
const payload = { iss: 'https://example.com', kind: 'evidence', type: 'org.example/flow' };
const jws = await sign(payload, privateKey, 'key-1');
console.log(jws); // compact JWS string
import { verify, decode } from '@peac/crypto';
// Cryptographic verification (requires public key)
const result = await verify(jws, publicKey);
console.log(result.header.kid); // 'key-1'
console.log(result.payload); // { iss: 'https://example.com', ... }
// Decode without verification (for inspection only)
const { header, payload } = decode(jws);
import { sha256Hex, sha256Bytes, sha256Base64url } from '@peac/crypto';
const hex = await sha256Hex('hello'); // 64-char lowercase hex
const bytes = await sha256Bytes('hello'); // 32-byte Uint8Array
const b64u = await sha256Base64url('hello'); // 43-char base64url
import { computeJwkThumbprint, jwkToPublicKeyBytes } from '@peac/crypto';
const jwk = { kty: 'OKP', crv: 'Ed25519', x: '<base64url-public-key>' };
const thumbprint = await computeJwkThumbprint(jwk); // base64url SHA-256
const keyBytes = jwkToPublicKeyBytes(jwk); // 32-byte Uint8Array
import {
ed25519RandomSecretKey,
ed25519GetPublicKey,
ed25519Sign,
ed25519Verify,
} from '@peac/crypto';
const secretKey = ed25519RandomSecretKey();
const publicKey = await ed25519GetPublicKey(secretKey);
const signature = await ed25519Sign(new TextEncoder().encode('data'), secretKey);
const valid = await ed25519Verify(signature, new TextEncoder().encode('data'), publicKey);
@peac/kernel (Layer 0): Wire format constants and error codes@peac/schema (Layer 1): Zod validators for receipt claims@peac/protocol (Layer 3): High-level issuance and verification built on this packageIf you are building an AI agent or MCP server that needs signed interaction receipts:
@peac/mcp-server for a ready-to-use MCP tool server@peac/protocol for programmatic receipt issuance and verification; it re-exports the most common crypto utilities so you rarely need to import @peac/crypto directlyApache-2.0
PEAC Protocol is an open source project stewarded by Originary and community contributors.
FAQs
Ed25519 JWS signing and verification for PEAC protocol
The npm package @peac/crypto receives a total of 88 weekly downloads. As such, @peac/crypto popularity was classified as not popular.
We found that @peac/crypto demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.