| Crates.io | serdect |
| lib.rs | serdect |
| version | 0.4.1 |
| created_at | 2022-03-29 19:23:47.159208+00 |
| updated_at | 2025-09-02 00:17:08.9065+00 |
| description | Constant-time serde serializer/deserializer helpers for data that potentially contains secrets (e.g. cryptographic keys) |
| homepage | https://github.com/RustCrypto/formats/tree/master/serdect |
| repository | https://github.com/RustCrypto/formats |
| max_upload_size | |
| id | 558746 |
| size | 74,405 |
Constant-time serde serializer/deserializer helpers for data that potentially contains secrets (e.g. cryptographic keys)
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:
bincode v2ciborium v0.2rmp-serde v1serde-json-core v0.5serde-json v1toml v0.8MSRV 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.
Licensed under either of:
at your option.
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.