Skip to content

Commit 9a9408e

Browse files
authored
crypto_secretstream v0.1.0 (#58)
1 parent 09a8873 commit 9a9408e

File tree

5 files changed

+41
-37
lines changed

5 files changed

+41
-37
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crypto_secretstream/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,14 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## 0.1.0 (2022-08-13)
9+
### Changed
10+
- Bump `chacha20` to v0.9 ([#50])
11+
- Bump `chacha20poly1305` to v0.10 ([#50])
12+
- Upgrade to Rust 2021 edition; MSRV 1.56 ([#42])
13+
14+
[#42]: https://github.com/RustCrypto/nacl-compat/pull/42
15+
[#50]: https://github.com/RustCrypto/nacl-compat/pull/50
16+
817
## 0.0.1 (2021-08-30)
918
- Initial release

crypto_secretstream/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "crypto_secretstream"
3-
version = "0.1.0-pre" # Also update html_root_url in lib.rs when bumping this
3+
version = "0.1.0"
44
description = """
55
Pure Rust implementation of libsodium's crypto_secretstream secret-key using
66
ChaCha20 and Poly1305

crypto_secretstream/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,28 @@ It is tested against [sodiumoxide], a Rust [libsodium] bindings.
1414

1515
[Documentation][docs-link]
1616

17+
## About
18+
19+
Imagine Alice wants to open a safe channel of communication with Bob,
20+
one that can't be read or modified by anyone else.
21+
22+
One way she can do this is by first agreeing with Bob on a shared secret
23+
key (such as one generated via a key exchange protocol), then she opens a
24+
normal/unsafe channel of communication and sends her messages, encrypted
25+
under this shared key. Then, when Bob receives theses messages, he can
26+
decrypt each one and the mere knowledge of this shared key ensures that it
27+
was indeed sent by Alice.
28+
29+
Under the hood, the first message is postfixed with a random number, called
30+
a nonce, generated by Alice, which is taken into account during encryption
31+
and decryption. It is then incremented for each new message.
32+
33+
It also allows for additional data to be sent with each message.
34+
This data is not encrypted but used in the encryption process thus it is
35+
needed to be known in advance by the receiver.
36+
It can be useful for adding another layer of security, and is not of a
37+
fixed size as the key is.
38+
1739
## License
1840

1941
Licensed under either of:

crypto_secretstream/src/lib.rs

Lines changed: 8 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,11 @@
1-
//! Pure Rust implementation of the [`crypto_secretstream`] AEAD
2-
//! from [NaCl]-family libraries (e.g. libsodium, TweetNaCl)
3-
//! which uses [ChaCha20] and [Poly1305].
4-
//!
5-
//! # Introduction
6-
//!
7-
//! Imagine Alice wants to open a safe channel of communication with Bob,
8-
//! one that can't be read or modified by anyone else.
9-
//!
10-
//! One way she can do this is by first agreeing with Bob on a shared secret
11-
//! key (such as one generated via a key exchange protocol), then she opens a
12-
//! normal/unsafe channel of communication and sends her messages, encrypted
13-
//! under this shared key. Then, when Bob receives theses messages, he can
14-
//! decrypt each one and the mere knowledge of this shared key ensures that it
15-
//! was indeed sent by Alice.
16-
//!
17-
//! Under the hood, the first message is postfixed with a random number, called
18-
//! a nonce, generated by Alice, which is taken into account during encryption
19-
//! and decryption. It is then incremented for each new message.
20-
//!
21-
//! It also allows for additional data to be sent with each message.
22-
//! This data is not encrypted but used in the encryption process thus it is
23-
//! needed to be known in advance by the receiver.
24-
//! It can be useful for adding another layer of security, and is not of a
25-
//! fixed size as the key is.
26-
//!
27-
//! # Usage
1+
#![no_std]
2+
#![doc(
3+
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg",
4+
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg"
5+
)]
6+
#![warn(missing_docs, rust_2018_idioms)]
7+
8+
//! ## Usage
289
//!
2910
//! ```rust
3011
//! use crypto_secretstream::*;
@@ -74,14 +55,6 @@
7455
//! [ChaCha20]: https://github.com/RustCrypto/stream-ciphers/tree/master/chacha20
7556
//! [Poly1305]: https://github.com/RustCrypto/universal-hashes/tree/master/poly1305
7657
77-
#![no_std]
78-
#![doc(
79-
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg",
80-
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg",
81-
html_root_url = "https://docs.rs/crypto_secretstream/0.0.1"
82-
)]
83-
#![warn(missing_docs, rust_2018_idioms)]
84-
8558
mod header;
8659
mod key;
8760
mod nonce;

0 commit comments

Comments
 (0)