The intention of this project is to modify an existing bootloader application so that it may support eXtended Tiny Encryption Algorithm (XTEA). Sample code for both modules are available this project will only require you to integrate the two modules and perform testing.
The bootloader is available from the Microchip (website [url removed, login to view] ) and the XTEA is also provided my Microchip (application note AN0953). Information on XTEA is available here ( [url removed, login to view] )
- MPLAB IDE [url removed, login to view]
- MPLAB C18 compiler (must use this compiler)
- Microchip TCP/IP stack (for the boot loader code)
- Microchip sw300052 Data Encryption Routines for the PIC18 (XTEA code)
- Microchip PIC18 (with built in Ethernet support, not ENC part) device for testing
- Microchip compatible device programmer that supports the PIC18 device
The number of XTEA rounds needs to be defined in the XTEA.h file as a macro
#define NUM_ITERATIONS 32
The key or password is defined in XTEA.C ( line 66 unsigned long key; ) but should be set in main.c (the bootloader) and populated by a macro value which is defined in XTEA.h ie
#define PASSWORD pass
This project is only successfully if you can take a MPLAB bin file, encrypt is using a windows command line tool (need to supply) and load it onto a PIC18F Ethernet device using the bootloader.
MPLAB Bootloader project files
XTEA tool to encode bin file for uploading, source code not needed.
Confirmation that you have tested this and it works as described.
The following forum post has sample code for a serial bootloader that used XTEA in the same way
Useful details on some of the issues faced along the way, very detailed.