Encrypting code for delivery

Thread Starter


Joined Mar 21, 2017
Hello All,
I was wondering if there are any applications that can encrypt my code in arduino for delivery to fab house for production. How does everyone do it ?

I read that one way to do it is send the HEX file and use Xloader to upload the HEX file but Arduino Software has to be pre-installed before using XLoader. Is there anything using putty as its something that is commonly used for serial communication.


Joined Jun 26, 2012
WinZip allows you to encrypt and password protect a set of files. Windows used to and may still but I find WZ easier to use so I don’t know what current versions do. You may not be able to send the file by email if the client or server does any kind of virus/malware scan but Dropbox/Google Drive should work.

Check with your fab house. They may have a secure file transfer facility.

Good luck!

Last edited:

Thread Starter


Joined Mar 21, 2017
I guess, as usual, i wasn't clear. I meant uploading arduino code into an atemega328 without the end-user not seeing it.


Joined Feb 24, 2006
Rite !

Any page that you point me to get started on it. I've not clue how to do it.
You go to the manufacturers website and you look for the application notes on writing a bootloader. The biggest challenge is coming up with an encryption scheme to implement in the development tools and a decryption scheme to implement in the bootloader. The real problem is the space available to work with. I would have no clue about where to go with this especially if you wanted to thwart the guys with unlimited resources. They just unlocked the phone of the Pensacola(?) shooter, so I'm sure that will be the primary challenge.

If you don't need to go to those lengths you do bit swapping. In each 16-bit instruction word, you swap bits 13 & 2 with bits 6 & 11. The output file will not look like AVR instructions or work on a standard Arduino, and the code in your boot loader can do the unswap with minimal space and delay impact. It won't fool the big boys but it will impede the casual observers.