Protect the code


Closed Thread
Results 1 to 24 of 24
  1. #1
    Join Date
    Mar 2007
    Posts
    30

    Default Protect the code

    Hi all!

    Do you know if there's a way to protect the code from being read, and duped?
    It's safe?

    EDIT:
    I've found my answers, it's just setting the CP bit on, but, it's REALLY safe?

    Luca
    Last edited by oslinux; - 2nd April 2007 at 19:08.

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    100% safe ... NO.

    The program can be retrieved. But it takes some extremely knowledgable people to do it. There are even some places that will do it for you for about $5000. The reputable ones require a statement in writing that you are the original owner of the program (but that's just for their protection, not yours).

    Some of the really old chips like 12C and some 16C are much easier, and can be done cheaper.
    <br>
    DT

  3. #3
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi,

    (Copy Protection in Modern Microcontrollers).

    See this link:
    http://www.cl.cam.ac.uk/~sps32/mcu_lock.html

    The latest paper on this subject:
    http://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-630.html

    Semi-invasive attacks – A new approach to hardware security analysis
    Sergei P. Skorobogatov
    April 2005, 144 pages
    http://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-630.pdf

    Best regards,

    Luciano

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Here's some nasty little devices that can just read the protected chips without destroying them.

    http://www.semiresearch.com/index.php?-1226852084
    http://www.semiresearch.com/index.php?-89148003
    <br>
    DT

  5. #5


    Did you find this post helpful? Yes | No

    Default Bad, really bad news.

    I thought it was almost impossible, i had read about microscopic readings of the memory and stuff like that, but this are really bad news, it even isnt that expensive!!! if you consider you could charge 5000 for one copy like DARREL already said.

    So this piece of crap can copy 877A, is it safer to move to 18F?

    A little thought... "had someone bought this thing? maybe its microcontroller is a 877A and we can copy it just to f...k them!" JAJAJA.
    Last edited by Josuetas; - 2nd April 2007 at 23:52.

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Talking

    Hi,

    If you do not sleep at night ...

    you can also use the Writecode function , and destroy a part of the code ... if the circuit is out of its original board !!! Not too difficult to realize ...

    just a "concours Lépine" idea ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  7. #7
    Join Date
    Jun 2007
    Posts
    26


    Did you find this post helpful? Yes | No

    Default frying an IO for code protect

    I have almost finished a very complicated and time consuming project. Code protection is very important to me. But I do not feel I can trust the code protect feature in the pic. so now what ?

    What do you guys think of frying an IO and having a simple code that says if this io is low then erease the pic, that sort of thing ? the IO would have to goto no where otherwise the pepole who are trying to make a clone would try to find out what it is for. Normally an IO that is tied no where goes high, becuase of the internal pullup. but if we could only fry that part then it might be able to read low.

    The thing is the code would need to be descrete, otherwise these copy cats would see it easy.

  8. #8
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263


    Did you find this post helpful? Yes | No

    Default

    The subject of code protection came up in one of the classes I attended at Microchip's 2007 Masters Conference earlier this month.

    According to the information I received, if the CP bit is set: So far, no one has come up with a way to beat it short of a physically invasive method--microscopic examination of the die.

    Russ
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

  9. #9
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    It figures Microchip would say something like that.

    But with devices like those linked in post #4.
    I'm not sure how they can keep a straight face when they do.

    They keep changing they're links, so if they don't work goto

    http://www.semiresearch.com

    and select "Secure MCU Readers" from the menu.
    <br>
    DT

  10. #10
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Every time someone builds a better mouse trap.
    Someone else builds a better mouse.
    Dave
    Always wear safety glasses while programming.

  11. #11
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    966


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by RussMartin View Post
    The subject of code protection came up in one of the classes I attended at Microchip's 2007 Masters Conference earlier this month.

    According to the information I received, if the CP bit is set: So far, no one has come up with a way to beat it short of a physically invasive method--microscopic examination of the die.

    Russ
    I have heard these quotes before. All I know of cracking devices is, that it's as simple as burgling a house. When you leave home, you put the biggest padlock you have on your door and bolt it down. When a burglar strikes, he reverses the procedure. The last time I read up on this topic, I learnt about using devices out of spec (power/timing) to beat various protection schemes. The power glitch is one very interesting technique and is sucessfully used by 8051 hackers. A related phenomenon is when you have the flash being corrupted by mere power on/off cycles. BTW : the Rst pin in the 8051 family usually is the VPP pin. Doesn't that say enough? I am almost sure that most flash micros are prone to this type of failure.

  12. #12
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    It figures Microchip would say something like that.

    But with devices like those linked in post #4.
    I'm not sure how they can keep a straight face when they do.
    Well, I'm not going to assume that the Microchip people are in the same class as sleazy used car salesmen. As I wrote, the statement was qualified with "so far". However, I've forwarded the link with a question to my FAE, and I'll report back his reply when I get it.

    They keep changing they're links, so if they don't work goto

    http://www.semiresearch.com

    and select "Secure MCU Readers" from the menu.
    <br>
    I notice that the list of target devices for both readers is still very, very short. (You have to wonder why it takes one device to do the '877 and the other to do the '877A.)

    I've E-mailed them for price information, availability, warranty/guarantee information, and asked if they will provide free upgrades as other PICs become supported. I note that their sales office is in China and their lab is in Lithuania.

    -----------------

    My understanding is that IP (intellectual property) theft right now is worst (and rampant) in China and in India: In China because IP theft is almost a way of life in engineering and technology, and in India (Jerson, correct me if this is wrong) because their laws and court system have not kept pace with the development of technology.
    Last edited by RussMartin; - 28th August 2007 at 06:07.
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

  13. #13
    Join Date
    Aug 2007
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    http://www.mcucrack.com/ and http://www.waferstar.com/en/index.shtml doing this job for all microcontrollers.

    I know some devices extract code from AT51/52 micro.
    Just insert microcontroller, Press start button, and all code save in 24c64 in 4 min.
    I always protect microcontroller to apply 24v 10ma power source only once to eny pin of PORT0 ( that are not used )with respect ground , No one extract code after this.
    Last edited by NF9Ω; - 28th August 2007 at 06:54.
    Thought-habits can harden into character. So watch your thoughts.

    (__)

  14. #14
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by NF9Ω View Post
    http://www.mcucrack.com/ and http://www.waferstar.com/en/index.shtml doing this job for all microcontrollers.
    Zhonghai (the first link) uses what they call "intruded crack"--that involves going in and looking at the physical die. Not much protection against that. Wafer (the second link) doesn't seem to show anything on cracking. What did I miss on that site?

    I always protect microcontroller to apply 24v 10ma power source only once to eny pin of PORT0 ( that are not used )with respect ground , No one extract code after this.
    This sounds interesting. Can you describe why and how this works to protect code? Does this prevent just reading the code? What about the invasive ("intruded crack") approach--can't someone still recover the code by microscopic examination of the die?
    Last edited by RussMartin; - 28th August 2007 at 07:17.
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

  15. #15
    Join Date
    Aug 2007
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    If you write to weferstar for code recovery they will quote rates.

    No one can escape from microscopic examination of the die.
    Thought-habits can harden into character. So watch your thoughts.

    (__)

  16. #16
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    966


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Russ Martin
    My understanding is that IP (intellectual property) theft right now is worst (and rampant) in China and in India: In China because IP theft is almost a way of life in engineering and technology, and in India (Jerson, correct me if this is wrong) because their laws and court system have not kept pace with the development of technology.
    In India, the laws are in place, but implementation is a different game altogether. Today, India is moving way ahead in terms of R&D and many companies favour indigenous development. I would say, part of that effort involves looking at superior products for inspiration. But, yet, there are folks who make their living using plain old cracking of ics for their living. They have even got so brazen as to advertise themselves in local magazines in the past. The charges of hacking the code is proportional to the benefit you would get by hacking it (thats how it works).

    I do not know if burning a port pin helps, but it sounds good to me. At least it won't be read by these flimsy techniques. Obviously, the port you blow should be directly linked to the programming data port - isn't it?

  17. #17
    Join Date
    Jun 2007
    Posts
    26


    Did you find this post helpful? Yes | No

    Default programing port

    Ya that would be the most secure, if you fry the data pin for example. I heard of a guy who did that and never ruined a chip yet. But that prevents you from firmware updates and such. I am using the 18F6722, I'm wondering if that chip is even able to crack yet. I understand the older chips are easy. But from my understanding, the newer chips you can't crack them with the power glitch. Is this true ?

  18. #18
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263


    Did you find this post helpful? Yes | No

    Thumbs down

    Here's the answer I received from my E-mail inquiry:

    Hello Russ,

    - Flash PIC Reader-Copier I / II price is 12000,- EUR
    AVR I Reader is 15000,- EUR

    - Please reffer to the web site www.semiresearch.com

    - Guarantee is 12 month, no updates available.

    Regards,
    Anatoli Vulf
    Radiolinija,UAB
    Jasinskio str.17, Vilnius, LT-01111, Lithuania
    Web: http://www.semiresearch.com
    Email: [email protected]
    GSM +37069910000
    Tel. +37052685564
    Fax +37052122757


    Since a Euro right now is about US$1.36, that puts the PIC readers at over US$16,000 each. That strikes me as exorbitant, since the model I reads only 11 devices and the model II reads only 4.
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

  19. #19
    Join Date
    Mar 2004
    Location
    UK-Midlands
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    Hello,

    My friend is about to send a sample of his product using an 18F2620. I know he has paid good money for a professional software writer to write his code. Now after me showing him this thread he is worried!

    He is about to send a sample for evaluation to a medium size company based in the UK. With the potential for them to purchase and resell. This company seems respectable! But it has its own R&D department. In the view of the forums users (Crystal Ball time) should he be worried? Is there anything else other than the inbuilt code protection he could do?

    I have little experience of this as I have the perfect code protection!!! Anything I have written is so poor to be of any value to anyone else……

    Thanks,
    Bob

  20. #20
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263


    Did you find this post helpful? Yes | No

    Exclamation "Danger, Will Robinson!"

    Quote Originally Posted by BobP View Post
    My friend is about to send a sample of his product using an 18F2620. I know he has paid good money for a professional software writer to write his code. Now after me showing him this thread he is worried!

    He is about to send a sample for evaluation to a medium size company based in the UK. With the potential for them to purchase and resell. This company seems respectable! But it has its own R&D department. In the view of the forums users (Crystal Ball time) should he be worried? Is there anything else other than the inbuilt code protection he could do?
    Foremost, your friend should have an attorney (in the UK, that's a solicitor, right?) who specializes in intellectual property (IP) and can advise and assist him.

    I can't speak for others, but I no longer sell any design outright; I retain ownership and license the product to the client.
    Last edited by RussMartin; - 28th August 2007 at 17:42.
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

  21. #21
    Join Date
    Mar 2004
    Location
    UK-Midlands
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    Thanks RussMartin,

    I think if there was a problem it would be argued that they have written their own code independently and it would be up to the original inventor to prove otherwise. Knowing what UK solicitors charge this would be very costly to contest. I understand a copy of the code and design is logged with his Solicitor. But not sure if this will be of any use?

    One thought I had was to have a bit of code embedded to make the unit do something slightly unusual that could be measured externally when a pin is grounded. Would this help prove that the copy was a copy and not a similar but different bit of software?

    Also if his code for the purpose of the evaluation could be time limited somehow? Any suggestions?
    I am sure George (the inventor) will be looking at this page with anticipation…

    Thanks again,
    Bob

  22. #22
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263


    Did you find this post helpful? Yes | No

    Default

    BobP, see my private message to you.
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

  23. #23
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi,

    See this link:
    http://en.wikipedia.org/wiki/Non-disclosure_agreement

    * * *

    If your product is sold to the public, then you have only one way to protect it:
    http://www.ipo.gov.uk/design/d-apply...uld-abroad.htm

    Best regards,

    Luciano

  24. #24
    Join Date
    Mar 2004
    Location
    UK-Midlands
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    Thanks Luciano and Russ,

    The Non Disclosure Agreement is something I have already advised George to do. It shows you are aware of the methods of protecting your product and you take it seriously.

    But my worry would be if agreement is broken the cost of legal proceedings if you loose... Hello skid row.

    Thankyou for the links as it give more useful information on NDA's and is something else to help in protecting our ideas.

    Bob

Similar Threads

  1. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  2. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  3. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  4. F452 Code Protect
    By onur in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th August 2006, 09:18
  5. Setting Code Protect and Data Protect
    By Peter1960 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 29th March 2006, 00:35

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts