Free Trials

Download a free trial to find out which Altium software best suits your needs

How to Buy

Contact your local sales office to get started on improving your design environment

Downloads

Download the latest in PCB design and EDA software

  • PCB DESIGN SOFTWARE
  • Altium Designer

    Complete Environment for Schematic + Layout

  • CircuitStudio

    Entry Level, Professional PCB Design Tool

  • CircuitMaker

    Community Based PCB Design Tool

  • NEXUS

    Agile PCB Design For Teams

  • CLOUD PLATFORM
  • Altium 365

    Connecting PCB Design to the Manufacturing Floor

  • COMPONENT MANAGEMENT
  • Altium Concord Pro

    Complete Solution for Library Management

  • Octopart

    Extensive, Easy-to-Use Component Database

  • PRODUCT EXTENSIONS
  • PDN Analyzer

    Natural and Effortless Power Distribution Network Analysis

  • See All Extensions
  • EMBEDDED
  • TASKING

    World-Renowned Technology for Embedded Systems Development

  • TRAININGS
  • Live Courses

    Learn best practices with instructional training available worldwide

  • On-Demand Courses

    Gain comprehensive knowledge without leaving your home or office

  • ONLINE VIEWER
  • Altium 365 Viewer

    View & Share electronic designs in your browser

  • Altium Designer 20

    The most powerful, modern and easy-to-use PCB design tool for professional use

    ALTIUMLIVE

    Annual PCB Design Summit

    • Forum

      Where Altium users and enthusiasts can interact with each other

    • Blog

      Our blog about things that interest us and hopefully you too

    • Ideas

      Submit ideas and vote for new features you want in Altium tools

    • Bug Crunch

      Help make the software better by submitting bugs and voting on what's important

    • Wall

      A stream of events on AltiumLive you follow by participating in or subscribing to

    • Beta Program

      Information about participating in our Beta program and getting early access to Altium tools

    All Resources

    Explore the latest content from blog posts to social media and technical white papers gathered together for your convenience

    Downloads

    Take a look at what download options are available to best suit your needs

    How to Buy

    Contact your local sales office to get started improving your design environment

    • Documentation

      The documentation area is where you can find extensive, versioned information about our software online, for free.

    • Training & Events

      View the schedule and register for training events all around the world and online

    • Design Content

      Browse our vast library of free design content including components, templates and reference designs

    • Webinars

      Attend a live webinar online or get instant access to our on demand series of webinars

    • Support

      Get your questions answered with our variety of direct support and self-service options

    • Technical Papers

      Stay up to date with the latest technology and industry trends with our complete collection of technical white papers.

    • Video Library

      Quick and to-the-point video tutorials to get you started with Altium Designer

    Hide and Seek: Key Serial-Number Chips for PIC Microcontroller Code Protection

    December 29, 2017

    Boy leans against tree while other children run off in grass

    One of my favorite games, when I was young, was hide and seek. I would play with my friends and it was always fun to try and find a good hiding place. As an older brother, I played the same game with my younger brothers, but with a twist. Instead of hiding myself, I had to hide my stuff from them. If I picked good hiding places, my stuff was safe. However, if I was lackadaisical and chose poor hiding places they were sure to find my toys or clothes and sometimes damage or lose them.

    For those of us who design and develop PCBs protecting your firmware from hackers can seem like a game of hide and seek. Firmware or microcontroller code protection is critical for preserving the fidelity of your product and protecting the investment of time and capital expenditures that go into product design development. There are several good methods of microcontroller code protection that will keep your firmware safe from most hackers. But, just like my stubborn brother Jeff, some hackers are determined to steal your hard work and your profits along with it by flooding the market with duplicates at a cheaper price or selling inferior products pretending they were manufactured by you. For these hackers, keying serial-number chips is an effective hide and seek strategy for microcontroller code protection.

    Count to Ten-Thousand: PIC Microcontroller Code Protection

    Typically, processors are programmed by downloading the machine code into local memory. This may be by flashing, where the code is erasable and the processor can be reprogrammed or hard-wired (burned) into memory where no future changes can be made. In these cases, the location of the program code is well-known by even inexperienced hackers, which makes it very insecure.

    PIC microcontrollers are one of the most popular controllers available and they come in a wide range of architectures and with varying capabilities. Irrespective of variance, the controller code structure for these processors is similar. Most firmware development is accomplished by using development boards, which are invaluable for debugging code. Yet, these boards provide simple access to the controller memory over a serial cable.

    illustration of easily found hiding location
    Without adequate microcontroller code protection accessing your code is easy

    Hide and Seek for Your Code Security

    The use of serial-number keys is a form of encryption, similar to what is used for password protection. Each manufactured microcontroller is assigned a unique code, which may range from 8-bit to 80-bit  or longer. The idea is to prevent access to the controller code unless the code is matched by the accessing device or program. This prevents the program code from being read by prying eyes. As with password protection, hackers have developed key generators that attempt to create the appropriate code for access. Given enough time, these are pretty effective at arriving at the correct code. To thwart this, I advise you store the key in a location that the hacker cannot access or may not know to look in.

    The unique key must be in a location that can be read prior to executing the program. Although this may sound limiting, there are a number of options. For example:

    • Flash Memory: This is the most place for storing program code and keys that may be erased and rewritten. This is used during the debugging process and for in- testing and development.
    • Program Memory: This a usually a dedicated block of memory reserved for the program. It is a good place to hide the key, as well. Unless the encryption method for the key is known, it is difficult to separate actual program code from the key code.
    • Microprocessor Memory (EEPROM): The key is hard-wired or burned into a ROM device and cannot be changed. This relies upon the system’s ability to prevent read access from intruders. Usually done during the manufacturing process or just prior to shipping.
    Typical internal memory locations for PIC Microcontroller
    Mikroe PIC Microcontroller block diagram

    As shown above, there are several memory locations where the key can be stored within the microcontroller and is not directly accessible by an external reading device. In addition, an external security storage component may be added to the PCB that is accessed directly by the microcontroller via a dedicated port location.

    You can create an external memory unit by implementing a dedicated secure storage device to the PCB to serve as a that is inaccessible except by the microcontroller. As most PCBs contain many devices connected to the microcontroller, this ambiguous device can go undetected by a potential hacker. Instead, it is assumed to be a system critical component.

    By providing several different locations to “hide” the key code forces a potential hacker to “seek” the correct storage location. This strategy makes PIC microcontroller code theft much more difficult. Regardless of which keying serial-code strategy you employ for your PIC microcontroller, Altium’s CircuitStudio® is the design tool for the job.

    For more information on securing your program code or Keying Serial-Code for PIC microcontrollers, contact an Altium PCB design expert.

    most recent articles

    Back to Home