Ring is one of the most popular Rust cryptography libraries and it provides a way to securely generate random numbers by using the ring::rand module. In this post I will show you how to generate random numbers correctly using the types provided by Ring.
In my previous post I introduced the Rust cryptography library Ring (see here). In this post I will show you how to use Ring to sign and verify messages using the HMAC algorithm.
Ring is an open source cryptography library that implements cryptographic primitives and is designed to have an easy to use interface. It is implemented in Rust, C and assembly and most of the C and assembly language code in ring comes from BoringSSL. It supports the following features:
Authenticated Encryption with Associated Data (AEAD)
Key agreement
Constant-time operations
Hash functions and digests
Hashed based Message Authentication Codes (HMAC)
Key Derivation Functions (KDF)
Cryptography pseudo-random number generation
Public key cryptography and digital signatures
Serialization and deserialization
You can find the documentation for the library here and the Github link here.