<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: HCS08 Bootloader with encryption in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-Bootloader-with-encryption/m-p/181477#M13227</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I will try to port it. I thought, there is already a implementation for that - this was the reason I asked here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Only for information:&lt;/P&gt;&lt;P&gt;The according Application note at the ATMEL site is:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.atmel.com/dyn/resources/prod_documents/doc2541.pdf" rel="nofollow" target="_blank"&gt;http://www.atmel.com/dyn/resources/prod_documents/doc2541.pdf&lt;/A&gt; (documentation)&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.atmel.com/dyn/resources/prod_documents/AVR231.zip" rel="nofollow" target="_blank"&gt;http://www.atmel.com/dyn/resources/prod_documents/AVR231.zip&lt;/A&gt; (sources)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Mar 2010 17:42:38 GMT</pubDate>
    <dc:creator>ttom</dc:creator>
    <dc:date>2010-03-09T17:42:38Z</dc:date>
    <item>
      <title>HCS08 Bootloader with encryption</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-Bootloader-with-encryption/m-p/181472#M13222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;our customer wants me to implement a bootloader on our HCS08SG16 via SCI and with encryption. Are there any libraries to do the decryption on the target? I did not find any information for the 8bit - Microcontrollers.&lt;/P&gt;&lt;P&gt;The encryption method is not defined - but it should not be the easiest method to break.&lt;/P&gt;&lt;P&gt;I want to take the doonstack - routines to do the erase and write access to the flash - this works already.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think AES or DES or 3DES - encryption would be nice, but I did not find any hints according to this for my microcontroller - family.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does somebody has an idea or a link for me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks (and have a nice weekend)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Mar 2010 06:20:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-Bootloader-with-encryption/m-p/181472#M13222</guid>
      <dc:creator>ttom</dc:creator>
      <dc:date>2010-03-06T06:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08 Bootloader with encryption</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-Bootloader-with-encryption/m-p/181473#M13223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're using a 16KB device.&amp;nbsp; If you use most of the program space for storing the decryption code (by picking one of the more involved encryption algorithms), you've lost the game.&amp;nbsp; Furthermore, if you plan to squeeze all that by writing it in C, you've lost once more.&amp;nbsp; But if your application is small enough that it will fit, regardless, then it's probably not worth encrypting too much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think you can be more effective if you make your own tiny encryption scheme that will be 'secure enough' for the purpose of protecting the firmware from being cloned.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The whole idea with encryption is to attempt to make the cloning effort more expensive than the cost of writing the firmware from scratch.&amp;nbsp; For example, if your application is easily reproduced (because the firmware and the how-to is relatively simple), there is no point in using the best encryption money can buy.&amp;nbsp; On the other hand, if it's the gadget of the century but which also happens to use proprietary computations, or whatever know-how not easily derived by observing the gadget's function, then by all means, use the best you can (but I would still add a personal touch to the method because all publicly known algorithms are the ones someone will attempt to break first).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I've already mentioned in other similar posts, you can also add CRC protection to prevent 'foreign' code from being loaded/executed in your device, and making the core of the stable library/OS functions a part of the bootloader, so that the distributable application is never even close enough to doing the job by itself, in case encryption is compromised.&amp;nbsp; Also, any proprietary methods could be inside the bootloader (provided they won't ever be updated.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Mar 2010 07:15:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-Bootloader-with-encryption/m-p/181473#M13223</guid>
      <dc:creator>tonyp</dc:creator>
      <dc:date>2010-03-06T07:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08 Bootloader with encryption</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-Bootloader-with-encryption/m-p/181474#M13224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with Tony. Using a standard secret-key style encryption is going to be pretty heavy. You may need to ask your customer if they wish to spring for a mcu with more flash to accommodate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or you can do something lightweight and proprietary. Some simple methods to consider:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Send the program-data without addresses, and load them in an order defined by pre-rearranging the address bits. This would need to be done in two stages: First, scramble the page order, then scramble the addresses within the page. The scrambling order could also be embedded in the data stream.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) Invert bits in each byte, either with a fixed XOR value, or with a changing XOR value. The XOR value could be embedded in the data stream, say, once per every 47 bytes. Or a variable number of bytes, embedded in the stream with the XOR value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3) Throw in checksum or CRC bytes at (fixed or variable) intervals within the data stream. With this, you could detect attempts to bypass security, and possibly self-destruct. Or just use it to detect communication errors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are plenty of other non-intuitive and low cost methods you could come up with, and most firmware thieves wouldn't have a clue where to start.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Mar 2010 12:27:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-Bootloader-with-encryption/m-p/181474#M13224</guid>
      <dc:creator>rocco</dc:creator>
      <dc:date>2010-03-06T12:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08 Bootloader with encryption</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-Bootloader-with-encryption/m-p/181475#M13225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;thank you for your answers.&lt;/P&gt;&lt;P&gt;I come from the ATMEL(ATMega) - world.&lt;/P&gt;&lt;P&gt;For ATMEL, there is a AES Bootloader, which fits into 2 k Flash. When I have a controller running at 3,69 MHz, and I want to update 64k Application with AES (with 256bit key) via 115k2 UART, this action lasts 33 seconds. I know, this is a long time, but a deep encryption, too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I thought, that there is a similar bootloader available for freescales. In my 16k - Device, my application needs about 12 k, so about 4k are available.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;According to your explanations, I have to consider about the security. I would prefer real encryption. But it seems I have to do my security in a way you wrote.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to do some more thoughts and will call back here when I have a good idea,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;have a nice weekend and many thanks for your replies,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Mar 2010 21:07:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-Bootloader-with-encryption/m-p/181475#M13225</guid>
      <dc:creator>ttom</dc:creator>
      <dc:date>2010-03-06T21:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08 Bootloader with encryption</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-Bootloader-with-encryption/m-p/181476#M13226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have access to the source code of that bootloader, why not try to port it to 9S08?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Judging by the size of it, I suspect (but I could be wrong, of course) that there is a PC-side app that talks to the bootloader.&amp;nbsp; And, the AES decryption is most-likely done on the PC side.&amp;nbsp; If that's the case, then the whole scheme is flawed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If, however, you believe the 2K bootloader (of which about 0.5K-1K is the comms and Flash programming code) is the one that actually does the complete decryption job, it'd be nice to try to port it to 9S08.&amp;nbsp; If you post the source code (or a link to it), I think some of us might volunteer for the task.&amp;nbsp; And, how much RAM does it need?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Mar 2010 17:53:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-Bootloader-with-encryption/m-p/181476#M13226</guid>
      <dc:creator>tonyp</dc:creator>
      <dc:date>2010-03-07T17:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08 Bootloader with encryption</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-Bootloader-with-encryption/m-p/181477#M13227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I will try to port it. I thought, there is already a implementation for that - this was the reason I asked here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Only for information:&lt;/P&gt;&lt;P&gt;The according Application note at the ATMEL site is:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.atmel.com/dyn/resources/prod_documents/doc2541.pdf" rel="nofollow" target="_blank"&gt;http://www.atmel.com/dyn/resources/prod_documents/doc2541.pdf&lt;/A&gt; (documentation)&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.atmel.com/dyn/resources/prod_documents/AVR231.zip" rel="nofollow" target="_blank"&gt;http://www.atmel.com/dyn/resources/prod_documents/AVR231.zip&lt;/A&gt; (sources)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Mar 2010 17:42:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-Bootloader-with-encryption/m-p/181477#M13227</guid>
      <dc:creator>ttom</dc:creator>
      <dc:date>2010-03-09T17:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08 Bootloader with encryption</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-Bootloader-with-encryption/m-p/181478#M13228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try TEA(tiny encpytion A) if your using assembly maybe around less than 1k . and i think motorola has some application note on it, or it was TI. with complete doc and source code i think its the only possible thing to implement on 8-bit, special on bootloader.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Mar 2010 14:30:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-Bootloader-with-encryption/m-p/181478#M13228</guid>
      <dc:creator>rere</dc:creator>
      <dc:date>2010-03-26T14:30:24Z</dc:date>
    </item>
  </channel>
</rss>

