### Build with Make Source: https://context7.com/mattkwan-zz/snow/llms.txt Instructions for compiling the Snow executable using the provided Makefile. ```APIDOC ## Compile with Make ### Description Build the Snow executable using the provided Makefile. ### Method Command Line ### Endpoint Not applicable ### Parameters Not applicable ### Request Example ```bash # Standard build make # Build with custom compiler flags CFLAGS="-O2 -Wall" make # Clean build artifacts make clean # The executable 'snow' will be created in the current directory ./snow --help ``` ### Response Not applicable ``` -------------------------------- ### Display Help and Version with Snow CLI Source: https://context7.com/mattkwan-zz/snow/llms.txt Show usage information and version details for the Snow program. ```bash # Display help snow -h snow --help ``` ```bash # Display version snow -V snow --version ``` -------------------------------- ### Snow Command Line Interface - Display Help and Version Source: https://context7.com/mattkwan-zz/snow/llms.txt Shows usage information and version details for the Snow program. ```APIDOC ## GET /api/help ### Description Displays the usage instructions and version information for the Snow program. ### Method GET ### Endpoint /api/help ### Parameters #### Query Parameters - **V** (boolean) - Optional - Displays the version information. - **h** (boolean) - Optional - Displays the help information. ### Response #### Success Response (200) - **helpText** (string) - The help or version information text. #### Response Example ```json { "helpText": "Usage: snow [-C] [-Q] [-S] [-V | --version] [-h | --help] [-p passwd] [-l line-len] [-f file | -m message] [infile [outfile]]" } ``` ``` -------------------------------- ### Compile Snow Executable with Make Source: https://context7.com/mattkwan-zz/snow/llms.txt Builds the Snow executable using the provided Makefile. Supports standard builds, custom compiler flags, and cleaning build artifacts. ```bash # Standard build make # Build with custom compiler flags CFLAGS="-O2 -Wall" make # Clean build artifacts make clean # The executable 'snow' will be created in the current directory ./snow --help ``` -------------------------------- ### Huffman Compression Initialization and Usage (C API) Source: https://context7.com/mattkwan-zz/snow/llms.txt Initializes and performs Huffman compression optimized for English text during message encoding using the Snow C library. Processes message character by character and flushes remaining data. ```c #include "snow.h" FILE *infile = fopen("cover.txt", "r"); FILE *outfile = fopen("output.txt", "w"); // Initialize compression system compress_init(); // Process message character by character, bit by bit unsigned char message[] = "Hello"; for (int i = 0; message[i] != '\0'; i++) { for (int bit = 0; bit < 8; bit++) { int b = ((message[i] & (128 >> bit)) != 0) ? 1 : 0; if (!compress_bit(b, infile, outfile)) { fprintf(stderr, "Encoding failed\n"); break; } } } // Flush remaining data and print compression statistics compress_flush(infile, outfile); // Output: Compressed by 35.42% ``` -------------------------------- ### Snow C Library API - compress_init / compress_bit / compress_flush Source: https://context7.com/mattkwan-zz/snow/llms.txt Initializes and performs Huffman compression optimized for English text during message encoding. Processes data bit by bit. ```APIDOC ## POST /api/library/compress ### Description Initializes the Huffman compression system, processes data bit by bit, and flushes remaining data during message encoding. Optimized for English text. ### Method POST ### Endpoint /api/library/compress ### Parameters #### Request Body - **messageData** (string) - Required - The message data to be compressed, processed bit by bit. - **coverFile** (string) - Required - The input file containing cover text. - **outputFile** (string) - Required - The output file to write the compressed data to. ### Request Example ```json { "messageData": "Hello", "coverFile": "cover.txt", "outputFile": "output.txt" } ``` ### Response #### Success Response (200) - **message** (string) - A message indicating the compression process status, potentially including compression statistics. #### Response Example ```json { "message": "Compression successful. Compressed by 35.42%" } ``` ``` -------------------------------- ### Snow C Library API - uncompress_init / uncompress_bit / uncompress_flush Source: https://context7.com/mattkwan-zz/snow/llms.txt Initializes and performs Huffman decompression during message extraction. Processes extracted bits and flushes remaining output. ```APIDOC ## POST /api/library/uncompress ### Description Initializes the Huffman decompression system, processes extracted bits, and flushes remaining output during message extraction. ### Method POST ### Endpoint /api/library/uncompress ### Parameters #### Request Body - **extractedBits** (array of integers) - Required - An array of bits representing the extracted data. - **outputFile** (string) - Required - The file where the decompressed message will be written. ### Request Example ```json { "extractedBits": [1, 0, 1, 1, 0, 0, 1, 0], "outputFile": "message.txt" } ``` ### Response #### Success Response (200) - **message** (string) - A message indicating the decompression process status. #### Response Example ```json { "message": "Decompression successful." } ``` ``` -------------------------------- ### Initialize, Encrypt, and Flush Data Source: https://context7.com/mattkwan-zz/snow/llms.txt Encrypts data using the ICE algorithm in 1-bit cipher-feedback mode. Requires setting a password and initializing encryption before processing data. ```c #include "snow.h" FILE *infile = fopen("cover.txt", "r"); FILE *outfile = fopen("output.txt", "w"); // Set password first (required for encryption) password_set("encryption_key"); // Initialize encryption encrypt_init(); // Encrypt and encode bits int plaintext_bit = 1; if (!encrypt_bit(plaintext_bit, infile, outfile)) { fprintf(stderr, "Encryption failed\n"); } // Flush and cleanup encrypt_flush(infile, outfile); ``` -------------------------------- ### Huffman Decompression Initialization and Usage (C API) Source: https://context7.com/mattkwan-zz/snow/llms.txt Initializes and performs Huffman decompression during message extraction using the Snow C library. Processes each extracted bit through the decompressor and flushes remaining output. ```c #include "snow.h" FILE *outfile = fopen("message.txt", "w"); // Initialize decompression uncompress_init(); // Process each extracted bit through decompressor int extracted_bits[] = {1, 0, 1, 1, 0, 0, 1, 0}; // example for (int i = 0; i < 8; i++) { if (!uncompress_bit(extracted_bits[i], outfile)) { fprintf(stderr, "Decompression failed\n"); break; } } // Flush remaining output uncompress_flush(outfile); ``` -------------------------------- ### Initialize, Encode, and Flush Bits Source: https://context7.com/mattkwan-zz/snow/llms.txt Encodes data bits into whitespace sequences appended to text lines. Allows setting a maximum line length and encodes 3 bits per whitespace pattern. ```c #include "snow.h" FILE *infile = fopen("cover.txt", "r"); FILE *outfile = fopen("stego.txt", "w"); // Set maximum line length (default 80) line_length = 72; // Initialize encoding encode_init(); // Encode data bits (3 bits become whitespace pattern) int bits[] = {1, 0, 1}; for (int i = 0; i < 3; i++) { if (!encode_bit(bits[i], infile, outfile)) { fprintf(stderr, "Encoding failed\n"); break; } } // Flush remaining lines encode_flush(infile, outfile); // Output: Message used approximately 15.50% of available space. ``` -------------------------------- ### Set ICE Key Schedule and Encrypt/Decrypt Block Source: https://context7.com/mattkwan-zz/snow/llms.txt Sets the key schedule for ICE encryption and performs 64-bit block encryption and decryption. Requires a valid ICE_KEY structure. ```c #include "ice.h" // Create and initialize key ICE_KEY *key = ice_key_create(1); unsigned char key_bytes[8] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF}; ice_key_set(key, key_bytes); // Encrypt 8-byte block unsigned char plaintext[8] = "TESTDATA"; unsigned char ciphertext[8]; ice_key_encrypt(key, plaintext, ciphertext); // Decrypt back to plaintext unsigned char decrypted[8]; ice_key_decrypt(key, ciphertext, decrypted); // Verify: decrypted should match plaintext ice_key_destroy(key); ``` -------------------------------- ### Snow Command Line Interface - Calculate Storage Capacity Source: https://context7.com/mattkwan-zz/snow/llms.txt Reports the approximate amount of space available for hidden messages in a given text file. Allows specifying a maximum line length. ```APIDOC ## GET /api/capacity ### Description Calculates and reports the approximate storage capacity for hidden messages within a specified text file. ### Method GET ### Endpoint /api/capacity ### Parameters #### Query Parameters - **l** (integer) - Optional - Specifies the maximum line length to consider for capacity calculation. #### Request Body - **inputFile** (string) - Required - The path to the text file for which to calculate storage capacity. ### Request Example ```json { "inputFile": "input.txt" } ``` ### Response #### Success Response (200) - **capacityInfo** (string) - A string describing the calculated storage capacity (e.g., "File has storage capacity of between 120 and 156 bits. Approximately 8 bytes."). #### Response Example ```json { "capacityInfo": "File has storage capacity of 240 bits (30 bytes)" } ``` ``` -------------------------------- ### Initialize, Decrypt, and Flush Data Source: https://context7.com/mattkwan-zz/snow/llms.txt Decrypts data using the ICE algorithm in 1-bit cipher-feedback mode. Requires setting the same password used for encryption and initializing decryption. ```c #include "snow.h" FILE *outfile = fopen("decrypted.txt", "w"); // Set the same password used for encryption password_set("encryption_key"); // Initialize decryption decrypt_init(); // Decrypt extracted bits int ciphertext_bit = 0; if (!decrypt_bit(ciphertext_bit, outfile)) { fprintf(stderr, "Decryption failed\n"); } // Flush remaining data decrypt_flush(outfile); ``` -------------------------------- ### ICE Key Management Source: https://context7.com/mattkwan-zz/snow/llms.txt Functions for creating, destroying, setting, and using ICE encryption keys. ```APIDOC ## ice_key_create / ice_key_destroy ### Description Creates and destroys ICE encryption key structures with variable security levels. ### Method Not applicable (C functions) ### Endpoint Not applicable (C functions) ### Parameters Not applicable (C functions) ### Request Example ```c #include "ice.h" // Create ICE key with level n (supports arbitrary key sizes) // Level 0 = 8-round ICE, Level 1 = 16-round ICE // Level n = 16n-round ICE for stronger encryption ICE_KEY *key = ice_key_create(1); // Standard ICE if (key == NULL) { fprintf(stderr, "Failed to create ICE key\n"); return; } // Use the key for encryption/decryption... // Clean up when done ice_key_destroy(key); ``` ### Response Not applicable (C functions) ``` ```APIDOC ## ice_key_set / ice_key_encrypt / ice_key_decrypt ### Description Sets the key schedule and performs 64-bit block encryption/decryption. ### Method Not applicable (C functions) ### Endpoint Not applicable (C functions) ### Parameters Not applicable (C functions) ### Request Example ```c #include "ice.h" // Create and initialize key ICE_KEY *key = ice_key_create(1); unsigned char key_bytes[8] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF}; ice_key_set(key, key_bytes); // Encrypt 8-byte block unsigned char plaintext[8] = "TESTDATA"; unsigned char ciphertext[8]; ice_key_encrypt(key, plaintext, ciphertext); // Decrypt back to plaintext unsigned char decrypted[8]; ice_key_decrypt(key, ciphertext, decrypted); // Verify: decrypted should match plaintext ice_key_destroy(key); ``` ### Response Not applicable (C functions) ``` -------------------------------- ### Calculate Storage Capacity with Snow CLI Source: https://context7.com/mattkwan-zz/snow/llms.txt Report the approximate amount of space available for hidden messages in a text file. Can specify a maximum line length (-l). ```bash # Check storage capacity snow -S input.txt ``` ```bash # With specific line length snow -S -l 72 email.txt ``` -------------------------------- ### Create and Destroy ICE Encryption Key Source: https://context7.com/mattkwan-zz/snow/llms.txt Creates and destroys ICE encryption key structures with variable security levels. Higher levels provide stronger encryption. ```c #include "ice.h" // Create ICE key with level n (supports arbitrary key sizes) // Level 0 = 8-round ICE, Level 1 = 16-round ICE // Level n = 16n-round ICE for stronger encryption ICE_KEY *key = ice_key_create(1); // Standard ICE if (key == NULL) { fprintf(stderr, "Failed to create ICE key\n"); return; } // Use the key for encryption/decryption... // Clean up when done ice_key_destroy(key); ``` -------------------------------- ### Set Encryption Password with C API Source: https://context7.com/mattkwan-zz/snow/llms.txt Sets the encryption password for subsequent encode/decode operations using the ICE encryption algorithm in the Snow C library. Supports long passwords and empty passwords. ```c #include "snow.h" // Set password before encoding or decoding password_set("mysecretpassword"); // Passwords up to 1170 characters are supported // (uses lower 7 bits from each character) password_set("very long password with special chars !@#$%"); // Empty password warning will be displayed password_set(""); ``` -------------------------------- ### Snow C Library API - password_set Source: https://context7.com/mattkwan-zz/snow/llms.txt Sets the encryption password for subsequent encode/decode operations using the ICE encryption algorithm. Supports long passwords. ```APIDOC ## POST /api/library/password_set ### Description Sets the encryption password for subsequent encode/decode operations using the ICE encryption algorithm. Passwords up to 1170 characters are supported. ### Method POST ### Endpoint /api/library/password_set ### Parameters #### Request Body - **password** (string) - Required - The password to set for encryption. ### Request Example ```json { "password": "mysecretpassword" } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message that the password has been set. #### Response Example ```json { "message": "Password set successfully." } ``` ``` -------------------------------- ### Space Calculation Function Source: https://context7.com/mattkwan-zz/snow/llms.txt Function to calculate the approximate storage capacity available in a text file. ```APIDOC ## space_calculate ### Description Calculates the approximate storage capacity available in a text file for hidden data. ### Method Not applicable (C function) ### Endpoint Not applicable (C function) ### Parameters Not applicable (C function) ### Request Example ```c #include "snow.h" FILE *infile = fopen("document.txt", "r"); // Set line length constraint line_length = 72; // Calculate and print available storage space_calculate(infile); // Output: File has storage capacity of between 240 and 312 bits. // Approximately 17 bytes. fclose(infile); ``` ### Response Not applicable (C function) ``` -------------------------------- ### Calculate Storage Capacity in a Text File Source: https://context7.com/mattkwan-zz/snow/llms.txt Calculates the approximate storage capacity available in a text file for hidden data using whitespace encoding. Allows setting a line length constraint. ```c #include "snow.h" FILE *infile = fopen("document.txt", "r"); // Set line length constraint line_length = 72; // Calculate and print available storage space_calculate(infile); // Output: File has storage capacity of between 240 and 312 bits. // Approximately 17 bytes. fclose(infile); ``` -------------------------------- ### Snow Command Line Interface - Conceal Message from File Source: https://context7.com/mattkwan-zz/snow/llms.txt Reads a message from a specified file and conceals it within another text file's whitespace. Supports compression, password protection, and line length limits. ```APIDOC ## POST /api/conceal/file ### Description Reads a message from a source file and conceals its content within the whitespace of a cover text file. ### Method POST ### Endpoint /api/conceal/file ### Parameters #### Query Parameters - **f** (string) - Required - The path to the file containing the message to conceal. - **C** (boolean) - Optional - Enables Huffman compression. - **p** (string) - Optional - Sets the encryption password. - **l** (integer) - Optional - Specifies the maximum line length for compatibility (e.g., email). #### Request Body - **coverFile** (string) - Required - The path to the cover text file where the message will be hidden. - **outputFile** (string) - Required - The path to the output file that will contain the cover text with the concealed message. ### Request Example ```json { "coverFile": "document.txt", "outputFile": "output.txt" } ``` ### Response #### Success Response (200) - **message** (string) - A success message indicating the operation completed. #### Response Example ```json { "message": "Message concealed from file successfully." } ``` ``` -------------------------------- ### ICE Encryption Functions Source: https://context7.com/mattkwan-zz/snow/llms.txt Functions for initializing, processing bits, and flushing data during ICE encryption. ```APIDOC ## encrypt_init / encrypt_bit / encrypt_flush ### Description Encrypts data using ICE algorithm in 1-bit cipher-feedback mode during encoding. ### Method Not applicable (C functions) ### Endpoint Not applicable (C functions) ### Parameters Not applicable (C functions) ### Request Example ```c #include "snow.h" FILE *infile = fopen("cover.txt", "r"); FILE *outfile = fopen("output.txt", "w"); // Set password first (required for encryption) password_set("encryption_key"); // Initialize encryption encrypt_init(); // Encrypt and encode bits int plaintext_bit = 1; if (!encrypt_bit(plaintext_bit, infile, outfile)) { fprintf(stderr, "Encryption failed\n"); } // Flush and cleanup encrypt_flush(infile, outfile); ``` ### Response Not applicable (C functions) ``` -------------------------------- ### ICE Decryption Functions Source: https://context7.com/mattkwan-zz/snow/llms.txt Functions for initializing, processing bits, and flushing data during ICE decryption. ```APIDOC ## decrypt_init / decrypt_bit / decrypt_flush ### Description Decrypts data using ICE algorithm in 1-bit cipher-feedback mode during extraction. ### Method Not applicable (C functions) ### Endpoint Not applicable (C functions) ### Parameters Not applicable (C functions) ### Request Example ```c #include "snow.h" FILE *outfile = fopen("decrypted.txt", "w"); // Set the same password used for encryption password_set("encryption_key"); // Initialize decryption decrypt_init(); // Decrypt extracted bits int ciphertext_bit = 0; if (!decrypt_bit(ciphertext_bit, outfile)) { fprintf(stderr, "Decryption failed\n"); } // Flush remaining data decrypt_flush(outfile); ``` ### Response Not applicable (C functions) ``` -------------------------------- ### Snow Command Line Interface - Conceal Message String Source: https://context7.com/mattkwan-zz/snow/llms.txt Hides a text message directly from the command line into a text file using whitespace encoding. Supports options for compression, encryption, quiet mode, and specifying maximum line length. ```APIDOC ## POST /api/conceal/message ### Description Conceals a text message string directly from the command line into a specified text file using whitespace encoding. ### Method POST ### Endpoint /api/conceal/message ### Parameters #### Query Parameters - **m** (string) - Required - The message string to conceal. - **C** (boolean) - Optional - Enables Huffman compression. - **p** (string) - Optional - Sets the encryption password. - **Q** (boolean) - Optional - Enables quiet mode, suppressing statistics output. - **l** (integer) - Optional - Specifies the maximum line length (default is 80). #### Request Body - **inputFile** (string) - Required - The path to the input text file. - **outputFile** (string) - Required - The path to the output file where the concealed message will be saved. ### Request Example ```json { "inputFile": "input.txt", "outputFile": "output.txt" } ``` ### Response #### Success Response (200) - **message** (string) - A success message indicating the operation completed. #### Response Example ```json { "message": "Message concealed successfully." } ``` ``` -------------------------------- ### Encoding Functions Source: https://context7.com/mattkwan-zz/snow/llms.txt Functions for encoding bits into whitespace sequences and flushing remaining lines. ```APIDOC ## encode_init / encode_bit / encode_flush ### Description Encodes bits into whitespace sequences appended to text lines. ### Method Not applicable (C functions) ### Endpoint Not applicable (C functions) ### Parameters Not applicable (C functions) ### Request Example ```c #include "snow.h" FILE *infile = fopen("cover.txt", "r"); FILE *outfile = fopen("stego.txt", "w"); // Set maximum line length (default 80) line_length = 72; // Initialize encoding encode_init(); // Encode data bits (3 bits become whitespace pattern) int bits[] = {1, 0, 1}; for (int i = 0; i < 3; i++) { if (!encode_bit(bits[i], infile, outfile)) { fprintf(stderr, "Encoding failed\n"); break; } } // Flush remaining lines encode_flush(infile, outfile); // Output: Message used approximately 15.50% of available space. ``` ### Response Not applicable (C functions) ``` -------------------------------- ### Conceal Message from File with Snow CLI Source: https://context7.com/mattkwan-zz/snow/llms.txt Read a message from a file and conceal it within another text file's whitespace. Supports compression (-C), password protection (-p), and line length limits (-l). ```bash # Hide contents of secret.txt in document.txt snow -f secret.txt document.txt output.txt ``` ```bash # With compression and password protection snow -C -p "mypassword" -f message.txt cover.txt stego.txt ``` ```bash # With line length limit for email compatibility snow -C -l 72 -f secret.txt email_body.txt encoded_email.txt ``` -------------------------------- ### Conceal Message String with Snow CLI Source: https://context7.com/mattkwan-zz/snow/llms.txt Hide a text message directly from the command line into a text file using whitespace encoding. Options include compression (-C) and encryption (-p). ```bash # Basic message concealment snow -m "Secret message here" input.txt output.txt ``` ```bash # With compression and encryption snow -C -m "I am lying" -p "hello world" infile.txt outfile.txt ``` ```bash # Quiet mode (suppress statistics output) snow -Q -m "Hidden text" document.txt result.txt ``` ```bash # Specify maximum line length (default is 80) snow -l 72 -m "My secret" input.txt output.txt ``` -------------------------------- ### Snow Command Line Interface - Extract Hidden Messages Source: https://context7.com/mattkwan-zz/snow/llms.txt Extracts concealed messages from files that contain hidden whitespace data. Supports decryption and outputting the extracted message to a file or standard output. ```APIDOC ## GET /api/extract ### Description Extracts concealed messages from a file containing hidden whitespace data. Supports decryption and can output the result to a specified file or standard output. ### Method GET ### Endpoint /api/extract ### Parameters #### Query Parameters - **p** (string) - Optional - The decryption password. Required if the message was encrypted. - **Q** (boolean) - Optional - Enables quiet extraction, suppressing statistics output. #### Request Body - **inputFile** (string) - Required - The path to the file from which to extract the message. - **outputFile** (string) - Optional - The path to the file where the extracted message will be saved. If not provided, the message is output to standard output. ### Request Example ```json { "inputFile": "outfile.txt", "outputFile": "recovered_message.txt" } ``` ### Response #### Success Response (200) - **message** (string) - The extracted message content, or a success message if output to a file. #### Response Example ```json { "message": "This is the secret message." } ``` ``` -------------------------------- ### Extract Hidden Messages with Snow CLI Source: https://context7.com/mattkwan-zz/snow/llms.txt Extract concealed messages from files containing hidden whitespace data. Supports decryption with a password (-p) and quiet mode (-Q). ```bash # Basic extraction to stdout snow outfile.txt ``` ```bash # Extract with decryption snow -C -p "hello world" outfile.txt ``` ```bash # Extract to a specific file snow -C -p "password" stego.txt recovered_message.txt ``` ```bash # Quiet extraction (no statistics) snow -Q -p "secret" encoded.txt message.txt ``` -------------------------------- ### Message Extraction Function Source: https://context7.com/mattkwan-zz/snow/llms.txt Function to extract a hidden message from a file containing whitespace-encoded data. ```APIDOC ## message_extract ### Description Extracts a hidden message from a file containing whitespace-encoded data. ### Method Not applicable (C function) ### Endpoint Not applicable (C function) ### Parameters Not applicable (C function) ### Request Example ```c #include "snow.h" FILE *infile = fopen("stego.txt", "r"); FILE *outfile = fopen("extracted.txt", "w"); // Optional: set password if message was encrypted password_set("secret"); // Optional: enable decompression if message was compressed compress_flag = TRUE; // Extract the hidden message if (!message_extract(infile, outfile)) { fprintf(stderr, "Extraction failed\n"); } else { printf("Message extracted successfully\n"); } fclose(infile); fclose(outfile); ``` ### Response Not applicable (C function) ``` -------------------------------- ### Extract Hidden Message from Steganographic File Source: https://context7.com/mattkwan-zz/snow/llms.txt Extracts a hidden message from a file containing whitespace-encoded data. Optionally supports password protection and decompression. ```c #include "snow.h" FILE *infile = fopen("stego.txt", "r"); FILE *outfile = fopen("extracted.txt", "w"); // Optional: set password if message was encrypted password_set("secret"); // Optional: enable decompression if message was compressed compress_flag = TRUE; // Extract the hidden message if (!message_extract(infile, outfile)) { fprintf(stderr, "Extraction failed\n"); } else { printf("Message extracted successfully\n"); } fclose(infile); fclose(outfile); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.