Crate zeppelin_core
source ·Expand description
zeppelin_core is a library that implements a stream cipher based on Balloon hashing.
⚠️ WARNING: Do not use ⚠️
This project is just for fun. Neither the design nor the implementation of this library have been independently evaluated.
Cryptographic Features
- authenticated encryption
- passwords are always salted
- arbitrary scalable time and space complexity
- it’s an all-or-nothing transform
Non-cryptographic features
- flexible container format that can be extended
- can be used on anything that implements the
Read
andSeek
traits
Examples
This example example shows how to use the high-level API based on the Read
and Write
traits.
// High level functions are based on the `read` and `write` traits
// so we will convert our message to a cursor
let data: Vec<u8> = b"Secret message".to_vec();
let mut source = Cursor::new(data);
let mut tmp = Cursor::new(Vec::<u8>::new());
container::create_container(
&mut source,
&mut tmp,
"Secret password",
CryptSettings::default_for_testing(),
None,
).expect("Failed to create encrypted container!");
tmp.rewind().unwrap();
let mut res = Cursor::new(Vec::<u8>::new());
container::read_container(&mut tmp, &mut res, "Secret password", None).unwrap();
assert_eq!(source, res)
The strength of the encryption is determined by the provided CryptSettings
object.
Modules
- Implementation of stream cipher based on Balloon-hashing called
Stream
. Additionally definesCryptSettings
object that encapsulates all information required to perform cryptographic operations. - This module provides an easy to use API to apply the cipher to a reader/writer.
- This module contains a version of Balloon-hashing that allows it to be modified into a stream cipher.
- This module contains the
Progress
struct which is used to communicate the status of an ongoing operation between threads.