🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@arelay/core

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

@arelay/core

Isomorphic end-to-end encryption envelope format shared by Agent Relay's delivery SDK, reader, and portal.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

@arelay/core

Isomorphic end-to-end encryption envelope format for Agent Relay.

This package is the single source of truth for the wire format shared by the delivery SDK (@arelay/cli), the reader (@arelay/client), and the portal: per-envelope P-256 ECDH against the recipient's public key with AES-256-GCM for the content. It runs anywhere Web Crypto plus atob/btoa are available — Node 20+ and browsers both qualify — and ships no Buffer dependency.

It deliberately contains only the envelope crypto. Account-level key management (recovery key, passkey/WebAuthn PRF unlock) is browser-only and lives in @arelay/client.

import { encryptString, decryptString } from '@arelay/core';

const envelope = await encryptString('Quarterly report ready', recipientPublicKeyJwk);
const text = await decryptString(envelope, recipientPrivateKey); // recipient's browser only

API

ExportPurpose
encryptBytes / encryptStringEncrypt to a recipient's public JWK → EncryptedEnvelope
decryptBytes / decryptStringDecrypt an envelope with the recipient's private key
decryptPayloadBytesDecrypt from payload metadata + raw ciphertext bytes
envelopeToPayload / payloadToEnvelopeSplit/recombine metadata and ciphertext (bytes travel separately)
bytesToBase64Url / base64UrlToBytesUnpadded base64url helpers

Types: EncryptedEnvelope, EncryptedPayload, JsonWebKeyEnvelope, JsonWebKey, CryptoKey.

License

MIT

Keywords

agent

FAQs

Package last updated on 24 Jun 2026

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