This is a simple wrapper around the Monocypher library to provide both low-level access to the cryptographic primitives and a higher-level API for common use cases like password hashing, authenticated encryption, and key exchange.
The high-level API is designed to be easy to use for typical E2EE applications, while the low-level API expose a C-like interface for those who need more control.
The library includes:
- Password hashing and verification using Argon2id
- Key derivation from passwords
- AEAD encryption and decryption using crypto_aead_lock/unlock
- XChaCha20 stream cipher encryption and decryption
- Sealing and unsealing messages with random nonces
- Challenge-response MACs for mutual authentication
- SHA-512 hashing and HMAC functions
- X25519 Key Exchange (Public Key Cryptography)
Exports
-
deriveKeyFromPassword, hashPassword, verifyPassword, generatePassword, AeadStreamMode, computeChallengeMac, keyPairFromPassword, verifyChallengeMac, sharedSecret, aeadStreamInitX, aeadStreamInitIetf, decrypt, x25519KeyPair, seal, aeadStreamInitDjb, encrypt, aeadStreamInit, aeadStreamRead, aeadStreamWrite, AeadStream, SealedMessage, encrypt, unseal, seal, unsealWithPassword, ChachaMessage, sealWithPassword, decrypt, encrypt, unseal, blakeKeyed, verifyDigest, initBlake2bKeyed, finish, blakeKeyedHex, blakeKeyed, Blake2bMaxKeySize, Blake2bMinDigestSize, blakeHex, update, initBlake2b, blake, blakeKeyedHex, blake, verifyDigest, blakeHex, initBlake2bKeyed, finishHex, update, Blake2bMaxDigestSize, toHexDigest, Blake2b, Blake2bDefaultDigestSize, publicKeyToHex, signatureFromHex, verify, publicKeyFromHex, secretKeyToHex, sign, sign, secretKeyFromHex, generateSigningKeyPair, signatureToHex, verify, PublicKey, Seed32, SecretKey, SigningKeyPair, Signature, generateSigningKeyPair, hkdfExpandSha512, Sha512State, hkdfSha512, hkdfSha512, sha512HmacHex, finishHex, Sha512BlockSize, update, sha512Hmac, Sha512Digest, initSha512Hmac, update, hkdfSha512, finishHex, hkdfExpandSha512, Sha512Hmac, finish, sha512HmacHex, sha512, sha512Hex, update, sha512, sha512Hmac, update, initSha512, Sha512Prk, hkdfExpandSha512, Sha512HmacState, sha512Hex, initSha512Hmac, finish, Sha512DigestSize, crypto_aead_unlock, crypto_x25519_inverse, crypto_verify16, crypto_sha512_hmac_update, crypto_elligator_map, crypto_eddsa_scalarbase, crypto_argon2_config, crypto_aead_read, crypto_chacha20_djb, crypto_aead_init_djb, crypto_eddsa_key_pair, crypto_poly1305, crypto_aead_init_x, crypto_eddsa_mul_add, crypto_sha512_hkdf_expand, crypto_wipe, crypto_chacha20_h, crypto_x25519, crypto_aead_ctx, crypto_sha512_hmac_ctx, crypto_aead_write, crypto_sha512_ctx, crypto_eddsa_trim_scalar, crypto_x25519_dirty_small, crypto_x25519_public_key, crypto_argon2, crypto_eddsa_to_x25519, crypto_x25519_dirty_fast, crypto_poly1305_update, crypto_eddsa_reduce, crypto_sha512_update, crypto_eddsa_check, crypto_blake2b_keyed, crypto_chacha20_ietf, CRYPTO_ARGON2_D, crypto_blake2b_init, crypto_argon2_no_extras, crypto_blake2b_ctx, crypto_verify32, crypto_aead_init_ietf, crypto_aead_lock, crypto_chacha20_x, crypto_blake2b_update, crypto_argon2_inputs, crypto_eddsa_check_equation, crypto_elligator_key_pair, crypto_sha512_hmac_init, CRYPTO_ARGON2_ID, crypto_blake2b_keyed_init, crypto_sha512_hkdf, CRYPTO_ARGON2_I, crypto_sha512, crypto_sha512_hmac_final, crypto_poly1305_ctx, crypto_eddsa_sign, crypto_poly1305_final, crypto_blake2b, crypto_argon2_extras, crypto_sha512_final, crypto_elligator_rev, crypto_blake2b_final, crypto_sha512_hmac, crypto_verify64, crypto_sha512_init, crypto_x25519_to_eddsa, crypto_poly1305_init, Key32, Nonce24, randomBytes, fromHex, strPtr, generateSalt, RandomBytes, toPtr, seqPtr, toHex, Mac16