#serializer-deserializer #constant-time

no-std serdect

Constant-time serde serializer/deserializer helpers for data that potentially contains secrets (e.g. cryptographic keys)

7 unstable releases

Uses new Rust 2024

0.4.1 Sep 2, 2025
0.4.0 Aug 21, 2025
0.3.0 Jan 6, 2025
0.3.0-rc.0 Sep 10, 2024
0.1.0 Mar 29, 2022

#2525 in Encoding

Download history 209176/week @ 2025-05-31 199149/week @ 2025-06-07 195025/week @ 2025-06-14 210395/week @ 2025-06-21 190024/week @ 2025-06-28 233676/week @ 2025-07-05 219516/week @ 2025-07-12 266276/week @ 2025-07-19 239788/week @ 2025-07-26 214539/week @ 2025-08-02 208382/week @ 2025-08-09 221357/week @ 2025-08-16 218373/week @ 2025-08-23 251313/week @ 2025-08-30 252526/week @ 2025-09-06 189350/week @ 2025-09-13

948,499 downloads per month
Used in 1,101 crates (33 directly)

Apache-2.0 OR MIT

43KB
617 lines

RustCrypto: Constant-Time Serde Helpers

Crate Docs Build Status Apache 2.0/MIT Licensed MSRV

Constant-time serde serializer/deserializer helpers for data that potentially contains secrets (e.g. cryptographic keys)

Documentation

About

Serialization is a potential sidechannel for leaking sensitive secrets such as cryptographic keys.

This crate provides "best effort" constant-time helper methods for reducing the amount of timing variability involved in serializing/deserializing data when using serde, Rust's standard serialization framework.

These helper methods conditionally serialize data as hexadecimal using the constant-time base16ct crate when using human-readable formats such as JSON or TOML. When using a binary format, the data is serialized as-is into binary.

While this crate can't ensure that format implementations don't perform other kinds of data-dependent branching on the contents of the serialized data, using a constant-time hex serialization with human-readable formats should help reduce the overall timing variability.

serdect is tested against the following crates:

Minimum Supported Rust Version (MSRV) Policy

MSRV increases are not considered breaking changes and can happen in patch releases.

The crate MSRV accounts for all supported targets and crate feature combinations, excluding explicitly unstable features.

License

Licensed under either of:

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~99–330KB