Crate stegano_core

Crate stegano_core 

Source
Expand description

§Stegano Core API

There are 3 main API entry points:

  • hide
  • unveil
  • unveil_raw

Each of these APIs offer a builder pattern to configure the operation.

§Usage Examples

§Hide data inside an image

use tempfile::tempdir;

let temp_dir = tempdir().expect("Failed to create temporary directory");

stegano_core::api::hide::prepare()   // prepares the hide operation with some default options
    .with_message("Hello, World!")   // this message will be hidden inside the image
    .with_file("Cargo.toml")         // this file will be hidden inside the image
    .using_password("SuperSecret42") // encrypts all the data with this password
    .with_image("tests/images/plain/carrier-image.png")     // this is the carrier image, it's read-only
    .with_output(temp_dir.path().join("image-with-a-file-inside.png"))  // this is the output image
    .execute()
    .expect("Failed to hide file in image");

§Unveil data from an image

use tempfile::tempdir;

let temp_dir = tempdir().expect("Failed to create temporary directory");

stegano_core::api::unveil::prepare()
    .from_secret_file("tests/images/encrypted/hello_world.png")
    .using_password("Secret42")
    .into_output_folder(temp_dir.path())
    .execute()
    .expect("Failed to unveil message from image");

Modules§

api

Structs§

CodecOptions
SteganoEncoder

Enums§

SteganoError

Type Aliases§

Result