@session.js/keypair
v1.0.8
Published
Session messenger & Session.js keypairs utilities.
Readme
@session.js/keypair
Session messenger & Session.js keypairs utilities.
type SessionKeys
SessionKeys is two KeyPairs: x25519 (curve25519) and ed25519
type SessionKeys = {
x25519: KeyPair
ed25519: KeyPair
}Session ID consists of x25519's public key prepended with 05.
Ed25519 keypairs are used mainly for messages encryption.
getKeysFromSeed
Converts seed hex to Session keys (x25519 & ed25519 keypairs):
import { getKeysFromSeed } from '@session.js/keypair'
const keys = getKeysFromSeed('39038c8988db02c1af44e8c847bd9713')
console.log(keys.x25519.publicKey) // => 0548054830367d369d94605247999a375dbd0a0f65fdec5de1535612bcb6d4de452c69generateSeedHex
Generates random seed and converts it to hex. Under the hood it uses CSPRNG from @noble/curves.
import { generateSeedHex } from '@session.js/keypair'
const seed = await generateSeedHex()
console.log(seed) // => 39038c8988db02c1af44e8c847bd9713Made for Session.js
Use Session messenger programmatically with Session.js: Session bots, custom Session clients, and more.
Donate
hloth.dev/donate · Tor: hlothdevzkti6suoksy7lcy7hmpxnr3msu5waokzaslsi2mnx5ouu4qd.onion/donate
