Quside Blog
Quside’s QRNG Integration with Rust

3 de julio de 2024

In recent weeks, our team at Quside has been working on an exciting project: integrating our Quantum Random Number Generator (QRNG) with the Rust programming language. In this blog post, we detail the process and advantages of this integration, which is aimed at developers and technology enthusiasts.

About Quside’s QRNG

Quantum Random Number Generators (QRNGs) leverage quantum mechanics principles to produce sequences of truly random numbers with measurable quality. Unlike pseudo-random number generators (PRNGs), which generate sequences that only appear random, QRNGs are intrinsically unpredictable. This makes them ideal, even imperative, for applications where genuine randomness is crucial, such as cryptography.

Quside’s QRNG comes in various form factors, from appliances with exposed REST APIs to PCIe cards for Linux and Windows devices. It has native interfaces in C and adapters for other programming languages like Python.

Why Rust?

When choosing the next way forward for our device, we selected Rust for several key reasons:

  1. Rust’s memory management security: Rust is known for safely handling memory, which is one of its most praised features. Rust uses a system of ownership with rules that the compiler checks at compile time, making common issues like buffer overflows and race conditions difficult or even impossible. Since many software vulnerabilities are traceable to a wrong memory management approach, Rust is in a great position to avoid these issues from the very beginning, as recognized even by institutions such as The White House.
  2. Rust offers performance close to C and C++, making it an excellent complementary language to these. In fact, it is increasingly being used intensively in the kernels of several operating systems. In Linux, for example, Rust is used in the BPF subsystem, and in Windows, it is used in the Windows Subsystem for Linux (WSL), as well as other core components.
  3. The active and supportive Rust community, with members such as Mozilla, Microsoft, Amazon, and Google, actively contributes to the language and its ecosystem. This community is also very welcoming to newcomers, making it easier to get started with Rust and making solving problems and adopting new technologies more accessible.

Integration Process

The first step in our integration was to develop an API that allows Rust developers to access the capabilities of the QRNG. We designed this API to be intuitive and efficient, leveraging Rust’s features to ensure optimal performance.

We created an interface that securely and efficiently exposes the functionalities of the QRNG, very similar to our C interface, to facilitate migration for our current users. Additionally, the API allows for the generation of random numbers with a simple function call.

To minimize the impact of transitioning to Rust, the libraries optimize the communication between the QRNG device and the Rust runtime environment, minimizing latency and ensuring the consistency of the generated data.

Regarding the integration, getting started with Quside’s QRNG in Rust is straightforward and user-friendly. You just need to:

  • Install the card and its drivers: Install the QRNG hardware and its corresponding drivers on your system. Our devices have a comprehensive installation guide to ensure a smooth setup process.
  • Import the crate into your codebase: Add the Quside QRNG crate to your Rust project’s `Cargo.tomlI` file.
  • Call the random numbers from the board directly: Once the crate is imported, you can start generating random numbers with just a few lines of code, as shown above.

Benefits for Developers

Integrating our QRNG with Rust offers developers several tangible benefits. The most obvious is the potential to enhance the security of their implementations by providing direct and easy access to a quantum entropy source, improving the security of their cryptographic applications. Additionally, the combination of Rust and Quside’s QRNG facilitates the development of secure applications not only from an entropy standpoint but also from a memory management perspective without sacrificing performance or efficiency. Finally, the API we have developed is straightforward to integrate into existing projects, allowing Rust developers to start using quantum random numbers directly with no friction.

Future and Next Steps

We are excited about the possibilities this integration offers. In the future, we plan to continue optimizing the API and exploring new applications in emerging areas, such as post-quantum cryptography or statistical simulations. Additionally, we are committed to staying up-to-date with Rust’s updates and improvements to fully leverage its capabilities and adapt the interface and functionalities to the developer community’s needs.

Integrating our QRNG with Rust is a significant step toward creating more secure and efficient applications. We invite the developer community to explore this tool and share their experiences and feedback. For more technical details and access to our APIs, please contact us at or our website,