Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/vendor/base64ct/README.md # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers 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 10 Pure Rust implementation of Base64 ([RFC 4648]). 11 12 Implements multiple Base64 alphabets without data-dependent branches or lookup 13 tables, thereby providing portable "best effort" constant-time operation. 14 15 Supports `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 22 This crate implements several Base64 alphabets in constant-time for sidechannel 23 resistance, aimed at purposes like encoding/decoding the "PEM" format used to 24 store things like cryptographic private keys (i.e. in the [`pem-rfc7468`] crate). 25 26 The paper [Util::Lookup: Exploiting key decoding in cryptographic libraries][Util::Lookup] 27 demonstrates how the leakage from non-constant-time Base64 parsers can be used 28 to practically extract RSA private keys from SGX enclaves. 29 30 The padded variants require (`=`) padding. Unpadded variants expressly 31 reject such padding. 32 33 Whitespace is expressly disallowed, with the exception of the 34 [`Decoder::new_wrapped`] and [`Encoder::new_wrapped`] modes which provide 35 fixed-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 47 MSRV increases are not considered breaking changes and can happen in patch releases. 48 49 The crate MSRV accounts for all supported targets and crate feature combinations, excluding 50 explicitly unstable features. 51 52 ## License 53 54 Licensed 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 59 at your option. 60 61 ### Contribution 62 63 Unless you explicitly state otherwise, any contribution intentionally submitted 64 for inclusion in the work by you, as defined in the Apache-2.0 license, shall be 65 dual 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