pub fn hide_into_image(file_to_hide: &str, host_file: &str)-> Result<()> {
    let file_to_hide_content = FileContent::new(file_to_hide)
        .chain_err(||"Error creating file to hide content handle.")?;
    let file_to_hide_size = metadata(file_to_hide)
        .chain_err(||"Error accessing file to hide metadata.")?
        .len();
    if file_to_hide_size > std::u32::MAX as u64 {
        bail!("File to hide is too big. Maximum size is {}", std::u32::MAX);
    } else {
        let mut host_image = ContainerImage::new(host_file)?;
        let chunk_size = host_image.setup_hiding(file_to_hide_size as u32);
        let file_to_hide_reader = ContentReader::new(&file_to_hide_content, chunk_size);
        for chunk in file_to_hide_reader {
            host_image.hide_data(&chunk);
        }
    }
    Ok(())
}
/// Hide a file into into an image using steganography techniques.
///
/// # Parameters:
/// * file_to_hide: Absolute path to hidden file.
/// * host_file: Absolute path to image file that contains hidden file.
Hide a file into into an image using steganography techniques.
Hide a file into into an image using steganography techniques .
pub fn hide_into_image(file_to_hide: &str, host_file: &str)-> Result<()> {
    let file_to_hide_content = FileContent::new(file_to_hide)
        .chain_err(||"Error creating file to hide content handle.")?;
    let file_to_hide_size = metadata(file_to_hide)
        .chain_err(||"Error accessing file to hide metadata.")?
        .len();
    if file_to_hide_size > std::u32::MAX as u64 {
        bail!("File to hide is too big. Maximum size is {}", std::u32::MAX);
    } else {
        let mut host_image = ContainerImage::new(host_file)?;
        let chunk_size = host_image.setup_hiding(file_to_hide_size as u32);
        let file_to_hide_reader = ContentReader::new(&file_to_hide_content, chunk_size);
        for chunk in file_to_hide_reader {
            host_image.hide_data(&chunk);
        }
    }
    Ok(())
}
pub fn hide_into_image ( file_to_hide : & str , host_file : & str ) -> Result < ( ) > { let file_to_hide_content = FileContent :: new ( file_to_hide ) . chain_err ( | | " " ) ? ; let file_to_hide_size = metadata ( file_to_hide ) . chain_err ( | | " " ) ? . len ( ) ; if file_to_hide_size > std :: u32 :: MAX as u64 { bail ! ( " " std u32 MAX ) ; } else { let mut host_image = ContainerImage :: new ( host_file ) ? ; let chunk_size = host_image . setup_hiding ( file_to_hide_size as u32 ) ; let file_to_hide_reader = ContentReader :: new ( & file_to_hide_content , chunk_size ) ; for chunk in file_to_hide_reader { host_image . hide_data ( & chunk ) ; } } Ok ( ( ) ) }
Hide a file into into an image using steganography techniques.
Hide a file into into an image using steganography techniques .
file_to_hide
&str
host_file
&str
file_to_hide
&str
host_file
&str
parameters:
Absolute path to hidden file.
host_file: Absolute path to image file that contains hidden file.
Absolute path to hidden file . host_file : Absolute path to image file that contains hidden file .