lazyxchacha
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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);

Readme

Keywords

Package Sidebar

Install

npm i lazyxchacha

Weekly Downloads

30

Version

1.0.1

License

MIT

Unpacked Size

15.5 kB

Total Files

9

Last publish

Collaborators

  • prongbang