Slide 26
Slide 26 text
use stegano_core::{SteganoCore, SteganoEncoder, SteganoDecoder, Hide, Unveil};
#[test]
fn should_hide_and_unveil_one_text_file() -> Result<()> {
SteganoCore::encoder()
.hide_file("Cargo.toml")
.use_carrier_image("resources/plain/carrier-image.png")
.write_to("/tmp/image-with-a-file-inside.png")
.hide();
SteganoCore::decoder()
.use_source_image("/tmp/image-with-a-file-inside.png")
.write_to_folder("/tmp/")
.unveil();
assert_eq_file_content(
"/tmp/Cargo.toml".as_ref(),
"Cargo.toml".as_ref(),
"Unveiled data did not match the original content”,
);
Ok(())
}
pub struct SteganoEncoder {
target: Option,
carrier: Option,
message: Message,
}
pub struct SteganoDecoder {
input: Option,
output: Option,
}
@5422m4n
/sassman