Стеганографический сайт не дает подробностей API AFAICS, что является неприятностью.
Однако, судя по вашему вопросу, похоже, что существует стеганографическая функция, которая принимает FILE *
(вы никогда не имеете дело с FILE
), которая содержит неизмененное изображение и, по-видимому, информацию, которую вы пытаетесь скрыть в образ. В этом случае вы можете организовать загрузку файла через libcurl
в открытый файл (который может не иметь имени); затем вы можете перемотать это FILE *
и передать его в библиотеку стеганографии.
После загрузки библиотеки доступны две основные функции:
steganolab_encode
/**
* Modifies specified jpeg file so that it contains given message.
* @param file - jpeg file name
* @param data - message to embed
* @param len - message length
* @param password - key string to cipher data and set up PRNG
* @param DCT_radius - which DCT coefficients shall be used to carry
* information, i^2+j^2 <= R^2
* @param stats - pointer to structure to put statistics to. The caller
* must take care about freeing the structure properly. NULL pass
* disables statistics output. The object don't need to be freed if the
* function fails, and it contains no message.
* @return 0: All OK
* not 0: Failed
**/
int steganolab_encode(const char * file, const char * data,
unsigned int len, const char * password, uint8_t DCT_radius,
struct steganolab_statistics * stats);
steganolab_decode
/**
* Reads steganographic message from specified file
* @param file - jpeg file name
* @param data - pointer to pointer to string to put data to
* @param len - pointer to push obtained buffer length to
* @param password - secred string for cipher and PRNG
* @param DCT_radius - which DCT coefficients shall be used to carry
* information, i^2+j^2 <= R^2
* @param stats - statistics object. Free is up to the caller.
* NULL disables the feature. The object don't need to be freed if the
* function fails, and it contains no message.
* @return 0: All OK
* not 0: fail (no buffers need freeing in this case)
*/
int steganolab_decode(const char * file, char ** data,
unsigned int * len, const char * password, uint8_t DCT_radius,
struct steganolab_statistics * stats);
Поскольку функции ожидают имена файлов, вам нужно будет указать имена файлов. Или вам придется переписать код так, чтобы он принимал все, что у вас на уме - буфер или поток открытых файлов.
(Кроме того: код требует использования архаичного и нестандартного заголовка <malloc.h>
для получения определения size_t
. Он компилируется в объект, если заменить каждую ссылку на <malloc.h>
(или "malloc.h"
) на <stdlib.h>
; теоретически он может компилироваться с <stddef.h>
, если единственное необходимое объявление - size_t
.)