Connect with us

AI Research

Rewriting SymCrypt in Rust to modernize Microsoft’s cryptographic library 


Outdated coding practices and memory-unsafe languages like C are putting software, including cryptographic libraries, at risk. Fortunately, memory-safe languages like Rust, along with formal verification tools, are now mature enough to be used at scale, helping prevent issues like crashes, data corruption, flawed implementation, and side-channel attacks.

To address these vulnerabilities and improve memory safety, we’re rewriting SymCrypt (opens in new tab)—Microsoft’s open-source cryptographic library—in Rust. We’re also incorporating formal verification methods. SymCrypt is used in Windows, Azure Linux, Xbox, and other platforms.

Currently, SymCrypt is primarily written in cross-platform C, with limited use of hardware-specific optimizations through intrinsics (compiler-provided low-level functions) and assembly language (direct processor instructions). It provides a wide range of algorithms, including AES-GCM, SHA, ECDSA, and the more recent post-quantum algorithms ML-KEM and ML-DSA. 

Formal verification will confirm that implementations behave as intended and don’t deviate from algorithm specifications, critical for preventing attacks. We’ll also analyze compiled code to detect side-channel leaks caused by timing or hardware-level behavior.

Proving Rust program properties with Aeneas

Program verification is the process of proving that a piece of code will always satisfy a given property, no matter the input. Rust’s type system profoundly improves the prospects for program verification by providing strong ownership guarantees, by construction, using a discipline known as “aliasing xor mutability”.

For example, reasoning about C code often requires proving that two non-const pointers are live and non-overlapping, a property that can depend on external client code. In contrast, Rust’s type system guarantees this property for any two mutably borrowed references.

As a result, new tools have emerged specifically for verifying Rust code. We chose Aeneas (opens in new tab) because it helps provide a clean separation between code and proofs.

Developed by Microsoft Azure Research in partnership with Inria, the French National Institute for Research in Digital Science and Technology, Aeneas connects to proof assistants like Lean (opens in new tab), allowing us to draw on a large body of mathematical proofs—especially valuable given the mathematical nature of cryptographic algorithms—and benefit from Lean’s active user community.

Compiling Rust to C supports backward compatibility  

We recognize that switching to Rust isn’t feasible for all use cases, so we’ll continue to support, extend, and certify C-based APIs as long as users need them. Users won’t see any changes, as Rust runs underneath the existing C APIs.

Some users compile our C code directly and may rely on specific toolchains or compiler features that complicate the adoption of Rust code. To address this, we will use Eurydice (opens in new tab), a Rust-to-C compiler developed by Microsoft Azure Research, to replace handwritten C code with C generated from formally verified Rust. Eurydice (opens in new tab) compiles directly from Rust’s MIR intermediate language, and the resulting C code will be checked into the SymCrypt repository alongside the original Rust source code.

As more users adopt Rust, we’ll continue supporting this compilation path for those who build SymCrypt from source code but aren’t ready to use the Rust compiler. In the long term, we hope to transition users to either use precompiled SymCrypt binaries (via C or Rust APIs), or compile from source code in Rust, at which point the Rust-to-C compilation path will no longer be needed.

PODCAST SERIES

The AI Revolution in Medicine, Revisited

Join Microsoft’s Peter Lee on a journey to discover how AI is impacting healthcare and what it means for the future of medicine.


Timing analysis with Revizor 

Even software that has been verified for functional correctness can remain vulnerable to low-level security threats, such as side channels caused by timing leaks or speculative execution. These threats operate at the hardware level and can leak private information, such as memory load addresses, branch targets, or division operands, even when the source code is provably correct. 

To address this, we’re extending Revizor (opens in new tab), a tool developed by Microsoft Azure Research, to more effectively analyze SymCrypt binaries. Revizor models microarchitectural leakage and uses fuzzing techniques to systematically uncover instructions that may expose private information through known hardware-level effects.  

Earlier cryptographic libraries relied on constant-time programming to avoid operations on secret data. However, recent research has shown that this alone is insufficient with today’s CPUs, where every new optimization may open a new side channel. 

By analyzing binary code for specific compilers and platforms, our extended Revizor tool enables deeper scrutiny of vulnerabilities that aren’t visible in the source code.

Verified Rust implementations begin with ML-KEM

This long-term effort is in alignment with the Microsoft Secure Future Initiative and brings together experts across Microsoft, building on decades of Microsoft Research investment in program verification and security tooling.

A preliminary version of ML-KEM in Rust is now available on the preview feature/verifiedcrypto (opens in new tab) branch of the SymCrypt repository. We encourage users to try the Rust build and share feedback (opens in new tab). Looking ahead, we plan to support direct use of the same cryptographic library in Rust without requiring C bindings. 

Over the coming months, we plan to rewrite, verify, and ship several algorithms in Rust as part of SymCrypt. As our investment in Rust deepens, we expect to gain new insights into how to best leverage the language for high-assurance cryptographic implementations with low-level optimizations. 

As performance is key to scalability and sustainability, we’re holding new implementations to a high bar using our benchmarking tools to match or exceed existing systems.

Looking forward 

This is a pivotal moment for high-assurance software. Microsoft’s investment in Rust and formal verification presents a rare opportunity to advance one of our key libraries. We’re excited to scale this work and ultimately deliver an industrial-grade, Rust-based, FIPS-certified cryptographic library.





Source link

Continue Reading
Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

AI Research

Lila Sciences raises $235 million to expand AI-driven research platform | Pharmaceutical | The Pharmaletter

Published

on


Lila Sciences has secured $235 million in series A financing, co-led by Braidwell and Collective Global, at a valuation of about $1.23 billion. The Massachusetts-based company, founded by Flagship Pioneering in 2023, is building an artificial intelligence platform designed to automate and accelerate the scientific method across multiple disciplines.

The latest financing follows a $200-million seed round in March and will be used to hire staff and open new sites in Boston, San Francisco and London. These locations will house the company’s so-called AI Science Factories, facilities that integrate AI, robotics and laboratory systems to design and run experiments at scale. Lila says these factories have already conducted hundreds of thousands of studies across life science, chemistry and materials science.

Building autonomous science at scale

This article is accessible to registered users, to continue reading please register for free.  A free trial will give you access to exclusive features, interviews, round-ups and commentary from the sharpest minds in the pharmaceutical and biotechnology space for a week. If you are already a registered user please login. If your trial has come to an end, you can subscribe here.

Login to your account

Become a subscriber

 

£820

Or £77 per month

Subscribe Now

  • Unfettered access to industry-leading news, commentary and analysis in pharma and biotech.
  • Updates from clinical trials, conferences, M&A, licensing, financing, regulation, patents & legal, executive appointments, commercial strategy and financial results.
  • Daily roundup of key events in pharma and biotech.
  • Monthly in-depth briefings on Boardroom appointments and M&A news.
  • Choose from a cost-effective annual package or a flexible monthly subscription

The Pharma Letter is an extremely useful and valuable Life Sciences service that brings together a daily update on performance people and products. It’s part of the key information for keeping me informed

Chairman, Sanofi Aventis UK



Source link

Continue Reading

AI Research

Gachon University establishes AI·Computing Research Institute – 조선일보

Published

on



Gachon University establishes AI·Computing Research Institute  조선일보



Source link

Continue Reading

AI Research

Tech war: Tencent pushes adoption of Chinese AI chips as mainland cuts reliance on Nvidia

Published

on

By


The Shenzhen-based tech conglomerate’s cloud computing unit, Tencent Cloud, said it was supporting “mainstream domestic chips” in its AI computing infrastructure, without naming any Chinese integrated circuit brand.

Tencent has “fully adapted to mainstream domestic chips” and “participates in the open-source community”, Tencent Cloud president Qiu Yuepeng said at the company’s annual Global Digital Ecosystem Summit on Tuesday.

It is a commitment that reflects growing efforts in the country’s semiconductor industry and AI sector to push forward Beijing’s tech self-sufficiency agenda amid US export restrictions on China and rising geopolitical tensions.
Tencent Cloud unveils support for Chinese-designed AI chips at the company’s annual Global Digital Ecosystem Summit. Photo: Weibo



Source link

Continue Reading

Trending