@waku/message-encryption
TypeScript icon, indicating that this package has built-in type declarations

0.0.31 • Public • Published

@waku/message-encryption

Provide Waku Message Version 1 payload encryption as defined in 26/WAKU2-PAYLOAD.

Symmetric Encryption

Symmetric encryption uses a unique key to encrypt and decrypt messages.

import {
  createDecoder,
  createEncoder,
  generateSymmetricKey
} from "@waku/message-encryption/symmetric";

// Generate a random key
const key = generateSymmetricKey();

// To send messages, create an encoder
const encoder = createEncoder(contentTopic, key);

// For example
waku.lightPush.push(encoder, { payload });

// To receive messages, create a decoder
const decoder = createDecoder(contentTopic, key);

// For example
await waku.store.queryOrderedCallback([decoder], (msg) => {
  // ...
});

ECIES Encryption

ECIES encryption enables encryption for a public key and decryption using a private key.

import {
  createDecoder,
  createEncoder,
  generatePrivateKey,
  getPublicKey
} from "@waku/message-encryption/ecies";

// Generate a random private key
const privateKey = generatePrivateKey();

// Keep the private key secure, provide the public key to the sender
const publicKey = getPublicKey(privateKey);

// To send messages, create an encoder
const encoder = createEncoder(contentTopic, publicKey);

// For example
waku.lightPush.push(encoder, { payload });

// To receive messages, create a decoder
const decoder = createDecoder(contentTopic, privateKey);

// For example
await waku.store.queryOrderedCallback([decoder], (msg) => {
  // ...
});

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.32-5674b0e.03next
0.0.312latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.32-5674b0e.03
0.0.32-9f1d8ca.01
0.0.32-66cf711.01
0.0.32-b6339f7.00
0.0.312
0.0.31-649943b.00
0.0.31-426bfa4.00
0.0.31-98208d5.00
0.0.31-11bf1c1.00
0.0.31-de10ff4.00
0.0.31-b7bdb60.00
0.0.31-e84eb62.00
0.0.31-535a20f.00
0.0.31-c9fdfb3.00
0.0.31-252ec59.00
0.0.31-a89e69f.00
0.0.31-09028e7.00
0.0.31-b93134a.00
0.0.31-00c3261.00
0.0.31-d3301ff.00
0.0.31-338250a.01
0.0.31-f599932.00
0.0.31-c50088a.01
0.0.31-aeb05cd.00
0.0.31-acef1ac.00
0.0.31-45523ca.00
0.0.31-6a2d787.01
0.0.31-2fe9875.00
0.0.300
0.0.30-5459f48.00
0.0.30-3687d81.01
0.0.29-f387f59.00
0.0.290
0.0.29-514ce36.00
0.0.29-39f8920.00
0.0.29-c33844e.00
0.0.29-77b2cdd.00
0.0.29-409642d.00
0.0.29-15400a5.00
0.0.29-88a29c3.00
0.0.29-08fc2d1.00
0.0.29-1887f4f.01
0.0.29-04bd518.01
0.0.29-ce62600.00
0.0.282
0.0.28-4db508b.00
0.0.28-42126a6.00
0.0.28-16e9116.00
0.0.28-d8ed83f.00
0.0.28-ab6f7ef.01
0.0.28-00c77c6.00
0.0.28-e49e728.00
0.0.27-3ec2344.00
0.0.28-682cc66.00
0.0.2732
0.0.27-5b03709.00
0.0.27-73d4f19.00
0.0.27-ea43068.00
0.0.27-fd60cc2.00
0.0.27-a7bf4fd.00
0.0.27-e5e8cd5.00
0.0.260
0.0.26-070b625.00
0.0.26-17a8640.00
0.0.26-9bf5716.00
0.0.26-efe9b8d.00
0.0.26-b5e8b17.00
0.0.26-434be7b.00
0.0.250
0.0.242
0.0.24-7eb3375.00
0.0.24-678635e.00
0.0.24-4c5a8a9.00
0.0.230
0.0.24-34a25c2.00
0.0.23-a42b7be.00
0.0.220
0.0.210
0.0.200
0.0.190
0.0.180
0.0.170
0.0.160
0.0.150
0.0.140
0.0.130
0.0.120
0.0.110
0.0.100
0.0.90
0.0.80
0.0.70
0.0.60
0.0.50
0.0.40
0.0.30
0.0.20
0.0.10

Package Sidebar

Install

npm i @waku/message-encryption

Weekly Downloads

50

Version

0.0.31

License

MIT OR Apache-2.0

Unpacked Size

441 kB

Total Files

53

Last publish

Collaborators

  • weboko
  • richard-ramos
  • royerfranck