interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / vendor / base64ct / README.md

87 lines · 3502 bytes Raw Blame History Rendered
1# [RustCrypto]: Constant-Time Base64
2
3[![crate][crate-image]][crate-link]
4[![Docs][docs-image]][docs-link]
5[![Build Status][build-image]][build-link]
6![Apache2/MIT licensed][license-image]
7![Rust Version][rustc-image]
8[![Project Chat][chat-image]][chat-link]
9
10Pure Rust implementation of Base64 ([RFC 4648]).
11
12Implements multiple Base64 alphabets without data-dependent branches or lookup
13tables, thereby providing portable "best effort" constant-time operation.
14
15Supports `no_std` environments and avoids heap allocations in the core API
16(but also provides optional `alloc` support for convenience).
17
18[Documentation][docs-link]
19
20## About
21
22This crate implements several Base64 alphabets in constant-time for sidechannel
23resistance, aimed at purposes like encoding/decoding the "PEM" format used to
24store things like cryptographic private keys (i.e. in the [`pem-rfc7468`] crate).
25
26The paper [Util::Lookup: Exploiting key decoding in cryptographic libraries][Util::Lookup]
27demonstrates how the leakage from non-constant-time Base64 parsers can be used
28to practically extract RSA private keys from SGX enclaves.
29
30The padded variants require (`=`) padding. Unpadded variants expressly
31reject such padding.
32
33Whitespace is expressly disallowed, with the exception of the
34[`Decoder::new_wrapped`] and [`Encoder::new_wrapped`] modes which provide
35fixed-width line wrapping.
36
37## Supported Base64 variants
38
39- Standard Base64: `[A-Z]`, `[a-z]`, `[0-9]`, `+`, `/`
40- URL-safe Base64: `[A-Z]`, `[a-z]`, `[0-9]`, `-`, `_`
41- bcrypt Base64: `.`, `/`, `[A-Z]`, `[a-z]`, `[0-9]`
42- `crypt(3)` Base64: `.`, `-`, `[0-9]`, `[A-Z]`, `[a-z]`
43- PBKDF2 Base64: `[A-Z]`, `[a-z]`, `[0-9]`, `.`, `/`
44
45## Minimum Supported Rust Version (MSRV) Policy
46
47MSRV increases are not considered breaking changes and can happen in patch releases.
48
49The crate MSRV accounts for all supported targets and crate feature combinations, excluding
50explicitly unstable features.
51
52## License
53
54Licensed under either of:
55
56 * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)
57 * [MIT license](http://opensource.org/licenses/MIT)
58
59at your option.
60
61### Contribution
62
63Unless you explicitly state otherwise, any contribution intentionally submitted
64for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
65dual licensed as above, without any additional terms or conditions.
66
67[//]: # (badges)
68
69[crate-image]: https://img.shields.io/crates/v/base64ct?logo=rust
70[crate-link]: https://crates.io/crates/base64ct
71[docs-image]: https://docs.rs/base64ct/badge.svg
72[docs-link]: https://docs.rs/base64ct/
73[build-image]: https://github.com/RustCrypto/formats/actions/workflows/base64ct.yml/badge.svg
74[build-link]: https://github.com/RustCrypto/formats/actions/workflows/base64ct.yml
75[license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg
76[rustc-image]: https://img.shields.io/badge/rustc-1.85+-blue.svg
77[chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg
78[chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/300570-formats
79
80[//]: # (links)
81
82[RustCrypto]: https://github.com/rustcrypto
83[RFC 4648]: https://tools.ietf.org/html/rfc4648
84[`pem-rfc7468`]: https://github.com/RustCrypto/formats/tree/master/pem-rfc7468
85[Util::Lookup]: https://arxiv.org/pdf/2108.04600.pdf
86[`Decoder::new_wrapped`]: https://docs.rs/base64ct/latest/base64ct/struct.Decoder.html#method.new_wrapped
87[`Encoder::new_wrapped`]: https://docs.rs/base64ct/latest/base64ct/struct.Encoder.html#method.new_wrapped