Skip to content

prongbang/lazyxchacha-web

Repository files navigation

lazyxchacha

Lazy XChaCha20-Poly1305 in JS base on stablelib: XChaCha20Poly1305.

"Buy Me A Coffee"

Algorithm details

  • Key exchange: X25519
  • Encryption: XChaCha20
  • Authentication: Poly1305
import * as xChaCha from 'lazyxchacha'

const clientKp = xChaCha.generateKeyPair();
const serverKp = xChaCha.generateKeyPair();
const clientSharedKey = xChaCha.sharedKey(clientKp.sk, serverKp.pk);
const serverSharedKey = xChaCha.sharedKey(serverKp.sk, clientKp.pk);

const message = 'Hello';
const ciphertext = xChaCha.encrypt(message, clientSharedKey);
const plaintext = xChaCha.decrypt(ciphertext, serverSharedKey);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published