false-bottom

Crates.iofalse-bottom
lib.rsfalse-bottom
version0.3.4
sourcesrc
created_at2024-04-18 03:29:12.437771
updated_at2024-05-07 09:27:13.282418
descriptionA deniable encryption scheme
homepage
repositoryhttps://codeberg.org/skran/false-bottom
max_upload_size
id1212090
size79,865
Shiva (skr4n)

documentation

README

False Bottom: A deniable encryption scheme

False Bottom is a deniable encryption scheme.
The name “False-Bottom” alludes to well-known equipment of stage magicians, who have boxes that can be opened to appear empty or with something inside, hidden under a false bottom. This scheme is designed for the same effect, hence the name.
As such, unlike traditional encryption algorithms, False Bottom allows for the encryption and decryption of multiple messages to and from a single ciphertext.
Each addition returns a message specific key which can only be used to decrypt the correspoding message added.
Link to Technical Paper: here

Security Note: This library has not been audited. Use it at your own risk.

Usage and Documentation

Run the following command in your project directory to add this library.

cargo add false-bottom

Or alternatively, check out crates.io to add this library to your project using the Cargo.toml file.
The documentation is available at docs.rs.

Examples

These are provided in the examples directory. Run them using the following command:

cargo run --example <filename>

Encryption

use false_bottom::{FalseBottom, Fb128};

fn main() {
	// Input messages
	let msg1 = "Weather department warns of heavy rains within the upcoming two days";
	let msg2 = "I have gathered intel regarding the government's illegal spying";

	// Cipher initialization
	let mut fb = Fb128::init(12, 12);

	// Encryption (Adding messages is not limited to 2)
	let key1 = fb.add(&msg1.as_bytes());
	let key2 = fb.add(&msg2.as_bytes());

	// Decryption
	let decr1 = fb.decrypt(&key1).unwrap();
	let decr2 = fb.decrypt(&key2).unwrap();

	let result1 = String::from_utf8(decr1).unwrap();
	let result2 = String::from_utf8(decr2).unwrap();

	assert_eq!(msg1, result1);
	assert_eq!(msg2, result2);
}

Todo

  • Add more block sizes.
  • Add capabilities to edit and delete added messages in the ciphertext.

License

Copyright © 2024 K Shiva Kiran <shiva_kr at riseup dot net>.
This library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Credits

This algorithm has been designed by Shahzad Ahmad <shahzad dot ahmad at jku dot at>.
The technical paper can be obtained here.

Commit count: 0

cargo fmt