USB PIC Bootloader. User Manual


8.2. Encoder Application

The encoder application allows to encript or decript HEX files for microcontroller. The encription is implemented by using XTEA algorithm. You can also browse the recent source code online at "encoder source code".

The encoder application supports the following commands (Table 8.1, “Encoder commands”):

Table 8.1. Encoder commands

Short CommandFull CommandParameter ValueDescription
-h-help Displays the supported commands and options description.
-e-encodePASSWORDEncode the input file with PASSWORD and save it to output file. PASSWORD is used as an encryption key. PASSWORD has to be provided as string of two hex digits per byte (like 01202040ac).
-d-decodePASSWORDDecode the input file with PASSWORD and save it to output file. PASSWORD is used as an encryption key. PASSWORD has to be provided as string of two hex digits per byte (like 01202040ac).
-c-convert Convert the file from one format to another.

The encoder application supports the following options(Table 8.2, “Encoder options”):

Table 8.2. Encoder options

Short OptionFull OptionParameter ValueDescription
-ix-input_hexFILENAMEInput file in Intel Hex Format.
-ib-input_binFILENAMEInput file in Binary Format.
-id-input_dataDATAImmediate mode - actual byte(s) specified in the command line as string of two hex digits per byte (like 01202040ac).
-ox-output_hexFILENAMEOutput file in Intel Hex Format.
-ob-output_binFILENAMEOutput file in Binary Format.

For instance, we need to perform the "example.hex" file encryption using Intel Hex file format and "0102030405060708090a0b0c0d0e0f10" encription key. The command line for this operation is:

encoder -e 0102030405060708090a0b0c0d0e0f10 
-ix example.hex -ox example_encrypted.hex

To decrypt "example_encrypted.hex" use following command line:

encoder -d 0102030405060708090a0b0c0d0e0f10 
-ix example_encrypted.hex -ox example_decrypted.hex