ilusm.dev

cry

crypto: digests, HMAC, CSPRNG, AEAD (AES-GCM + ChaCha20-Poly1305), PBKDF2, wire envelopes.

Load with: use cry

Quick example

use cry

result = crys2("value")
prn(result)

Functions

Functions

crys2(s)

Performs the operation. Takes s.

crymd(s)

Performs the operation. Takes s.

cryhm(key, msg)

Performs the operation. Takes key, msg.

AEAD algorithm identifiers

cryag()

Performs the operation.

cryac()

Performs the operation.

AEAD key/nonce lengths

crykl(alg)

Performs the operation. Takes alg.

crynl(alg)

Performs the operation. Takes alg.

CSPRNG

cryrc()

Performs the operation.

cryrn(n)

Performs the operation. Takes n.

AEAD seal / open

crysl(key, nonce, aad, pt, alg)

Performs the operation. Takes key, nonce, aad, pt, alg.

cryop(key, nonce, aad, sealed, alg)

Opens a connection or resource. Takes key, nonce, aad, sealed, alg.

Constant-time compare

cryct(a, b)

Performs the operation. Takes a, b.

PBKDF2

crypb(pw, salt, it, dklen)

Performs the operation. Takes pw, salt, it, dklen.

crypbi()

Performs the operation.

Key derivation shorthand

crykd(pw, salt, it)

Performs the operation. Takes pw, salt, it.

Envelope: seal + random nonce

cryev(key, aad, pt, alg)

Performs the operation. Takes key, aad, pt, alg.

Envelope: open

cryeo(key, aad, env)

Performs the operation. Takes key, aad, env.

Envelope wire format

cryew(env)

Performs the operation. Takes env.

cryeu(row)

Performs the operation. Takes row.

Fingerprints

cryfq(a, b)

Performs the operation. Takes a, b.

cryfm(s)

Performs the operation. Takes s.

cryfp(s)

Performs the operation. Takes s.

Notes

  • Cryptographic primitives - hashing, HMAC, random bytes.
  • For asymmetric crypto see crya and cryx.