Crate false_bottom

source ·
Expand description

§Usage

Unlike traditional encryption algorithms that output ciphertext to a given plaintext, False Bottom works by “adding” messages to an existing ciphertext.
As such, the initial ciphertext and the keybase are generated from random data.
The ciphertext then grows as messages are added whereas the keybase is fixed after initialization and is used to generate the keys for the ciphertext.
The parameters for the init() function determine the size (in number of blocks) of the initial ciphertext and keybase respectively.
Type aliases over FBObj are provided to pick a block size. Ex: FB128 corresponds to a block size of 128 bits.

§Cipher Initialization:

use false_bottom::{FB128, FBAlgo};
// 15 blocks of ciphertext and 12 blocks of keybase with a block size of 128 bits.
let fb = FB128::init(15, 12);

§Adding Messages:

Messages can be added using the add() method. This method returns an object FBKey that represents the corresponding key for this message. This key can only be used to decrypt this message.

let msg = b"Hello World!";
let key = fb.add(&msg);

§Decryption:

The decrypt() method returns the message that corresponds to the provided FBKey.

let decrypted = fb.decrypt(&key);

There is also an example here.

§Import and Export

Available formats: Raw bytes and Base64 encoded.
Refer to the example.

Structs§

  • A key object that is specific to a message.
  • The False Bottom Object holds the ciphertext and the keybase. The provided type aliases can be used to pick a block size.

Enums§

Traits§

Type Aliases§