# False Bottom: A deniable encryption scheme False Bottom is a [deniable encryption](https://en.wikipedia.org/wiki/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](https://doi.org/10.1109/ACCESS.2023.3288285) **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. ```sh cargo add false-bottom ``` Or alternatively, check out [crates.io](https://crates.io/crates/false-bottom) to add this library to your project using the `Cargo.toml` file. The documentation is available at [docs.rs](https://docs.rs/false-bottom). ## Examples These are provided in the [examples](https://codeberg.org/skran/false-bottom/src/branch/main/examples) directory. Run them using the following command: ```sh cargo run --example ``` ### Encryption ```rust 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 - [x] 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](https://doi.org/10.1109/ACCESS.2023.3288285).