Skip to contents

Hashing

Digests and keyed digests over raw vectors. This is what most callers want, and crypt_hash() with its default is the right answer unless something external requires otherwise.

crypt_hash()
Compute a Message Digest
crypt_hmac()
Compute an HMAC
crypt_hex()
Encode Bytes as Hexadecimal

Comparison and information

Comparing a secret without leaking how much of it you guessed, and finding out what this build contains.

crypt_equal()
Compare Two Raw Vectors Without Leaking Timing Information
crypt_info()
Report What This Build of 'zucrypt' Contains

Randomness

Random bytes from the operating system, for keys, initialisation vectors, nonces and salts. R’s random number generator is never involved.

crypt_rand_bytes()
Cryptographically Secure Random Bytes

Authenticated encryption and key derivation

AES-GCM, which encrypts and authenticates together, and PBKDF2, which derives a key from a password.

crypt_aes_gcm_encrypt() crypt_aes_gcm_decrypt()
AES-GCM Authenticated Encryption
crypt_pbkdf2()
Derive a Key from a Password with PBKDF2

Public keys and signatures (openssl-style)

RSA and elliptic-curve keys, signatures, RSA encryption and key agreement, with openssl’s names and arguments under a crypt_ prefix, and the openssl-style digests they take.

Ciphers (advanced)

Unauthenticated AES-CBC, for reading and writing formats that specify it. No padding is added or removed and nothing is authenticated: ciphertext produced here can be altered undetectably, and detecting that is the caller’s job. These are interoperability tools, not a way to encrypt something of your own.

crypt_aes_cbc_encrypt_nopad() crypt_aes_cbc_decrypt_nopad()
AES-CBC Without Padding or Authentication

C API

Consuming zucrypt from another package’s C code, through the registered function table or the static archive.

zucrypt_c_api zucrypt-c-api
Using 'zucrypt' from C

Package

zucrypt zucrypt-package
zucrypt: Cryptography Without System Dependencies