ilusm.dev

crya

Advanced cryptography: symmetric/asymmetric config, KDF, cert gen, random, password hashing.

Load with: use crya

Quick example

use crya

result = crysi("value", 10)
prn(result)

Functions

Symmetric config

crysc()

Performs the operation.

crysi(alg, ks)

Performs the operation. Takes alg, ks.

crysdk(cfg, pw)

Performs the operation. Takes cfg, pw.

crysen(cfg, pt, key)

Encodes. Takes cfg, pt, key.

crysde(cfg, env, key)

Decodes. Takes cfg, env, key.

Asymmetric config

cryac()

Performs the operation.

cryai(alg, ks)

Performs the operation. Takes alg, ks.

cryagn(cfg)

Performs the operation. Takes cfg.

cryaen(cfg, pt)

Encodes. Takes cfg, pt.

cryade(cfg, ct)

Decodes. Takes cfg, ct.

cryasg(cfg, msg)

Performs the operation. Takes cfg, msg.

cryavf(cfg, msg, sig)

Performs the operation. Takes cfg, msg, sig.

Hash dispatch

cryhd(data, alg)

Performs the operation. Takes data, alg.

cryhm(data, key, alg)

Performs the operation. Takes data, key, alg.

Key derivation

crykdc()

Performs the operation.

crykdr(pw, salt, alg, it, kl)

Performs the operation. Takes pw, salt, alg, it, kl.

Digital signatures config

crydsc()

Performs the operation.

crydsi(alg, ha)

Performs the operation. Takes alg, ha.

crydsg(cfg)

Performs the operation. Takes cfg.

crydss(cfg, msg)

Performs the operation. Takes cfg, msg.

crydvf(cfg, msg, sig)

Performs the operation. Takes cfg, msg, sig.

Certificate generation (self-signed, simplified)

crycrt(subj, iss)

Performs the operation. Takes subj, iss.

crycvf(cert, sig)

Performs the operation. Takes cert, sig.

Random helpers

cryrnb(ln)

Performs the operation. Takes ln.

cryrni(mn, mx)

Performs the operation. Takes mn, mx.

cryrnf(mn, mx)

Performs the operation. Takes mn, mx.

cryrns(ln, cs)

Performs the operation. Takes ln, cs.

Password hashing config

crypwc()

Performs the operation.

crypwi(alg, cost)

Performs the operation. Takes alg, cost.

crypwh(cfg, pw)

Performs the operation. Takes cfg, pw.

crypwv(cfg, pw, hpw)

Performs the operation. Takes cfg, pw, hpw.

Stream cipher config

crystc()

Performs the operation.

crysti(alg)

Performs the operation. Takes alg.

crysti(st, key, nonce)

Performs the operation. Takes st, key, nonce.

cryste(st, pt)

Performs the operation. Takes st, pt.

crystd(st, ct)

Performs the operation. Takes st, ct.

Key exchange config

cryxcc()

Performs the operation.

cryxcg(cfg)

Performs the operation. Takes cfg.

cryxcd(cfg, other_pub)

Performs the operation. Takes cfg, other_pub.

Quick helpers

cryqen(alg, pt, pw)

Encodes. Takes alg, pt, pw.

cryqde(alg, env, pw, salt)

Decodes. Takes alg, env, pw, salt.

cryqhash(data, alg)

Performs the operation. Takes data, alg.

cryqhmac(data, key, alg)

Performs the operation. Takes data, key, alg.

cryqpwh(pw, alg, cost)

Performs the operation. Takes pw, alg, cost.

cryqrnd(ln)

Performs the operation. Takes ln.

cryqrns(ln, cs)

Performs the operation. Takes ln, cs.

Notes

  • Asymmetric cryptography - RSA, ECDSA, key generation, sign/verify.