#crypto #base64 #pem #phc

no-std base64ct

Pure Rust implementation of Base64 (RFC 4648) which avoids any usages of data-dependent branches/LUTs and thereby provides portable “best effort” constant-time operation and embedded-friendly no_std support

2 stable releases

new 1.1.0 Sep 14, 2021
1.0.1 Aug 14, 2021
1.0.0 Mar 17, 2021
0.2.1 Mar 8, 2021
0.0.0 Jan 21, 2021

#662 in Cryptography

Download history 7727/week @ 2021-05-26 12332/week @ 2021-06-02 11569/week @ 2021-06-09 11528/week @ 2021-06-16 11023/week @ 2021-06-23 11127/week @ 2021-06-30 11231/week @ 2021-07-07 14175/week @ 2021-07-14 13933/week @ 2021-07-21 12704/week @ 2021-07-28 12607/week @ 2021-08-04 15685/week @ 2021-08-11 18672/week @ 2021-08-18 22864/week @ 2021-08-25 20519/week @ 2021-09-01 19678/week @ 2021-09-08

65,424 downloads per month
Used in 37 crates (6 directly)

Apache-2.0 OR MIT

27KB
472 lines

RustCrypto: Constant-Time Base64

crate Docs Build Status Apache2/MIT licensed Rust Version Project Chat

Pure Rust implementation of Base64 (RFC 4648).

Implements multiple Base64 variants without data-dependent branches or lookup tables, thereby providing portable "best effort" constant-time operation.

Supports no_std environments and avoids heap allocations in the core API (but also provides optional alloc support for convenience).

Documentation

Supported Base64 variants

  • Standard Base64: [A-Z], [a-z], [0-9], +, /
  • URL-safe Base64: [A-Z], [a-z], [0-9], -, _
  • bcrypt Base64: ., /, [A-Z], [a-z], [0-9]
  • crypt(3) Base64: ., -, [0-9], [A-Z], [a-z]

Minimum Supported Rust Version

This crate requires Rust 1.51 at a minimum.

We may change the MSRV in the future, but it will be accompanied by a minor version bump.

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.

No runtime deps

Features

  • alloc
  • std