#base64 #bech32 #constant-time #hex #security

no-std subtle-encoding

Encoders and decoders for common data encodings (base64, bech32, hex) which avoid data-dependent branching/table lookups and therefore provide “best effort” constant time. Useful for encoding/decoding secret values such as cryptographic keys.

11 releases

✓ Uses Rust 2018 edition

new 0.5.0 Oct 14, 2019
0.4.0 Aug 20, 2019
0.3.7 Jun 5, 2019
0.3.4 Mar 23, 2019
0.3.0 Nov 25, 2018

#55 in Encoding

Download history 398/week @ 2019-06-30 404/week @ 2019-07-07 395/week @ 2019-07-14 342/week @ 2019-07-21 347/week @ 2019-07-28 230/week @ 2019-08-04 305/week @ 2019-08-11 500/week @ 2019-08-18 292/week @ 2019-08-25 387/week @ 2019-09-01 554/week @ 2019-09-08 696/week @ 2019-09-15 797/week @ 2019-09-22 834/week @ 2019-09-29 885/week @ 2019-10-06

2,144 downloads per month
Used in 7 crates (6 directly)

Apache-2.0 OR MIT

55KB
1K SLoC

subtle-encoding iqlusion

Crate Docs Apache 2.0/MIT Licensed MSRV Safety Dance Build Status Gitter Chat

Rust crate for encoding/decoding binary data to/from base64 and hex encodings while avoiding data-dependent branching/table lookups, and therefore providing "best effort" constant-time operation.

Useful for encoding/decoding secret values such as cryptographic keys.

Documentation

Requirements

  • Rust 1.36+

Security Notice

While this crate takes care to avoid data-dependent branching, that does not actually make it "constant time", which is an architecture-dependent property.

This crate is a "best effort" attempt at providing a constant time encoding library, however it presently provides no guarantees, nor has it been independently audited for security vulnerabilities.

Use at your own risk.

License

Copyright © 2018-2019 iqlusion

subtle-encoding is distributed under the terms of either the MIT license or the Apache License (Version 2.0), at your option.

See LICENSE (Apache License, Version 2.0) file in the iqlusioninc/crates toplevel directory of this repository or LICENSE-MIT for details.

Dependencies