Liking cljdoc? Tell your friends :D
Clojure only.

pocketenv-io.crypto

Client-side encryption matching libsodium's crypto_box_seal (anonymous sealed box).

Algorithm:

  1. Generate ephemeral Curve25519 (X25519) keypair
  2. Derive nonce = BLAKE2b-24(eph_pk || recipient_pk) — matches libsodium exactly
  3. Encrypt with NaCl crypto_box(message, nonce, eph_sk, recipient_pk)
  4. Output = eph_pk (32 bytes) || ciphertext
  5. Base64url-encode without padding

The server's public key is resolved in order from:

  1. POCKETENV_PUBLIC_KEY environment variable
  2. The default production key
Client-side encryption matching libsodium's crypto_box_seal (anonymous sealed box).

Algorithm:
  1. Generate ephemeral Curve25519 (X25519) keypair
  2. Derive nonce = BLAKE2b-24(eph_pk || recipient_pk) — matches libsodium exactly
  3. Encrypt with NaCl crypto_box(message, nonce, eph_sk, recipient_pk)
  4. Output = eph_pk (32 bytes) || ciphertext
  5. Base64url-encode without padding

The server's public key is resolved in order from:
  1. POCKETENV_PUBLIC_KEY environment variable
  2. The default production key
raw docstring

encryptclj

(encrypt plaintext)

Encrypts plaintext using the server's public key via crypto_box_seal. Returns base64url-encoded ciphertext without padding.

Encrypts plaintext using the server's public key via crypto_box_seal.
Returns base64url-encoded ciphertext without padding.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close