How to get started with Code Security

jhendrix

Active member
I am building a project that I would like to sell and I would like to secure my code.
I have downloaded the latest Arduino IDE, but I don't have Teensy 4 Security under my Tools menu.
On the Code Security page, it says it is currently only available to certain beta testers. How can I get on the list to become a beta tester?
 
The security feature is only available on a Lockable Teensy - will have a white LOCK stamped on the processor top.

Once you have that version the lockable security software has been out of Beta for some many months.

Best information on the PJRC.COM page for the Lockable product details.

Note: Only IDE 1.8.19 can implement the menu items for security at this time. The IDE 2.x does not yet offer the means for PJRC to add those to the menu system as needed.

Using the IDE 1.8.x version with TeensyDuino installed those menu options will be preset to continue to lock a Teensy using a KEY.PEM file to encrypt the stored code and prevent any code not encrypted with that key from running.
 
You must use Arduino 1.8.19 to create the key.pem file.

Apparently Arduino has just recently added some sort of support for creating a custom tool in IDE 2.1.x, but as far as I know it's not yet documented. Eventually the Teensy 4 Security tool will come to newer versions of Arduino, but for now you must use 1.8.19 to create the key.pem file.

Once your key is created, it should be usable from any version.

Remember to make backup copies of your key.pem file. If you lose this file, you'll forever lose the ability to create new .ehex files that work on all boards previously set up with your key.
 
I use vscode for all my development, so I didn't have the arduino IDE installed. I had installed version 2.2 and couldn't find the menu (by the way, the Code Security page says nothing about what version to use and the Download+Install page says to install Arduino 2.0.x)
I downloaded version 1.8.19 and installed the teensy boards, but I still don't see the Teensy 4 Security menu.
menu.png
 
I use vscode for all my development, so I didn't have the arduino IDE installed. I had installed version 2.2 and couldn't find the menu (by the way, the Code Security page says nothing about what version to use and the Download+Install page says to install Arduino 2.0.x)
I downloaded version 1.8.19 and installed the teensy boards, but I still don't see the Teensy 4 Security menu.
...

That properly shows Teensy 4 selected - what version of TeensyDuino was installed? It should be the current 1.58 or perhaps the latest beta of 1.59 beta 3.

Doing "IDE /Help / About" will confirm the installed version - left corner shows IDE ver and upper right corner the TeensyDuino version.
 
I downloaded version 1.8.19 and installed the teensy boards, but I still don't see the Teensy 4 Security menu.

I can't see your screen, so I'm just guessing, but maybe you tried using Boards Manager to install Teensy?

Boards Manager only works for Arduino IDE 2.x.x. If you try it with Arduino 1.8.19, you'll get an incomplete install with some stuff missing, like the Teensy 4 Security tool.

You must download and run the installer from this page:

https://www.pjrc.com/teensy/td_download.html

Scroll down to "Arduino 1.8.x Software Development" to get the installer.

Arduino 1.8.19 simply didn't support enough capability for Teensy by its Boards Manager (and IDE 2.x.x still doesn't for the ability to add the Teensy 4 Security tool), so the separate installer truly is necessary to get the complete Teensy software installed in Arduino 1.8.x.
 
Back
Top