hcl

high level cryptography library ready for production use

5 stable releases

Uses new Rust 2024

1.0.4 Oct 27, 2025
1.0.3 Jun 30, 2025
1.0.2 Jun 29, 2025
1.0.1 Jun 11, 2025

#465 in Cryptography

Download history 5/week @ 2025-08-15 25/week @ 2025-08-22 89/week @ 2025-08-29 30/week @ 2025-09-05 29/week @ 2025-09-12 39/week @ 2025-09-19 34/week @ 2025-09-26 18/week @ 2025-10-03 30/week @ 2025-10-10 439/week @ 2025-10-17 684/week @ 2025-10-24 551/week @ 2025-10-31 333/week @ 2025-11-07 332/week @ 2025-11-14 264/week @ 2025-11-21

1,606 downloads per month

MIT/Apache

7.5MB
525 lines

Contains (static library, 3MB) c/lib/linux_gnu_x86_64/libsodium.a, (static library, 2.5MB) c/lib/windows_x86_64/libsodium.lib, (static library, 2MB) c/lib/macos_aarch64/libsodium.a

high level cryptograhpy library (hcl)

hcl provides implementations of various cryptograhic concepts such as ratchet.

It is backed by the excellent and well-audited libsodium.

Getting started

To get started, just create an instance of the Hcl struct like so:

let hcl = Hcl::new().unwrap();

After that, you can use the library through this variable. For more information, see examples or tests

Features implemented

  • Key generation
    • Symmetric Keys
    • Public/Private KeyPair
    • Public/Private Signing KeyPair
  • Cryptographically secure random data generation
    • Generate a random bytes and store into buffer
    • Generate a random number in a uniform distribution
  • Cryptographic signatures
  • Key derivation
  • Message padding
  • Ratchets
  • Base64 encoding and decoding

No runtime deps