Class CovertCommand
This extension operates in two primary modes:
- Embedding a binary payload across one or more EXIF metadata fields
- Extracting a previously embedded payload from those fields
The embedding process preserves all original metadata except for the specific slots being reused. Slot selection can be customized, or a default set of predefined high-capacity EXIF fields will be used automatically.
The following command-line options are supported:
--embed: Activate embedding mode (requires--payload)--extract: Activate extraction mode--jpeg <input.jpg>: Input JPEG file to embed into or extract from (required)--payload <file>: File containing payload data to embed (required for--embed)--output <file>: Output file (JPEG with embedded data, or raw extracted payload) (required)--slots <s1;s2;...>: Optional semicolon-separated list of EXIF slot definitions, each in the form[group.]name[:capacity]or a fully defined custom tag like[group.]name/tag=tagId,type,count,dir[:capacity]
If --slots is omitted, a default list of slots is used with realistic
capacities suitable for several kilobytes of covert data. Slots are defined
using EXIF field tags grouped by logical metadata regions (e.g., IFD0, Exif
IFD, GPS IFD).
Text-based EXIF slots (e.g., ASCII) will automatically encode binary payloads using Base64. Extraction decodes them back transparently.
This class is not meant to be instantiated.
- Author:
- Leo Galambos
-
Method Summary
-
Method Details
-
main
public static int main(String[] args, org.apache.commons.cli.Options options) throws org.apache.commons.cli.ParseException Entry point for command-line usage of the covert embedding and extraction tool.Parses command-line arguments to embed or extract binary payloads in JPEG files using EXIF metadata slots. Embedding requires a payload file, a JPEG input, and an output destination. Extraction requires only the JPEG input and output file. Slot behavior can be customized using semicolon-separated slot specifications.
- Parameters:
args- Command-line argumentsoptions- AnOptionsinstance to populate with supported CLI options- Returns:
0on success,1on I/O error- Throws:
org.apache.commons.cli.ParseException- if the arguments are invalid or incomplete
-