How can I encrypt the codes I have written?

As an example,

I used arduino for a project, and now my codes will upload to about 80 arduinos.

"uploading codes to arduino" job will not done by me, it will done by somebody else... So, I do not want to share my program with open codes. Is there any way to share them in binary or hex format or anyother way?


Just give them the hex file.

To find the hex file, turn on verbose compile messages in Preferences. The .hex file will be the last thing before the "Sketch uses 4,154 bytes (14%) of program storage space" message. In my case it was: "/var/folders/cs/p6yz0z1m8xj9lf0059b_lzw00000gn/T/arduino_build_318773/BlinkWithoutDelay.ino.hex"

The uploader will need to use the 'avrdude' program to upload the .hex file. You can also use that program to disable the reading of FLASH through the programming interface so nobody can copy your .hex file from the AVR processor.

1 Like

If using any recent version of the Arduino IDE you can also do:

  • Sketch > Export compiled Binaryu
  • Sketch > Show Sketch Folder

maybe a bit more user friendly, though learning how to find the build folder is very useful in itself.

1 Like

How can I encode the Arduino code and not give it to someone else?

How did the hex coil work?

Hex code is what is actually sent to the Arduino during upload with the serial connection.

It is the machine code translation of the C/C++ code that you write, and is incomprehensible to most people.

Looks something like this:

To produce the hex file, In the Arduino IDE, chose sketch > upload or sketch > export compiled binary. See post above to find the output file.

If you have any secret code, and you want to give the program to your clients, you can use this tool PravySoft Arduino Program Encrypter and Burner (

It will automatically detect the hex file of your project (so you don't want to search temporary folders for that), and it also encrypts that file with a password (which adds an additional security level to your file).
Share this tool, encrypted file and password with your clients, they don't want to install Arduino IDE/Libraries or upload the program to the board.

1 Like

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.