Code protect (not) - Page 1
Forum section: electronics / general

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: April 01, 2011, 11:05:16 am
content: I'm sure most of you have heard third & fourth-hand stories about Chinese guys offering de-protect services for microcontrollers by de-capping.I just met up with a friend who who actually had it done on a recent PIC ( for a legit reason as it happens) - I was amazed at the cost - just GBP120, shipping included.So bear that in mind when considering what it would cost for someone to copy your product...

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 01, 2011, 11:56:39 am
content: any mcu brands? maybe the protection should be within the software itself.

author: scrat
author_rank: Frequent Contributor
timestamp: April 01, 2011, 12:28:02 pm
content: Amazing! So these are not legends, it's really possible and affordable. It must involve not so expensive instruments, I guess...

author: Psi
author_rank: Super Contributor
timestamp: April 01, 2011, 12:38:28 pm
content: With all the knockoff products that appear on the market so quickly it wouldn't surprise me at all if there is equipment in china designed especially to do this. Maybe even automated to a degree.

author: Simon
author_rank: Unknown
timestamp: April 01, 2011, 12:52:58 pm
content: yep it probably happens left right and centre

author: Zero999
author_rank: Super Contributor
timestamp: April 01, 2011, 04:33:15 pm
content: This only adds weight to the the fact that DRM does more to inconvenience honest people more than it does who want to copy other people's ideas.I wouldn't bother using code protection, unless I did it for a company who insisted on it.

author: Simon
author_rank: Unknown
timestamp: April 01, 2011, 04:36:23 pm
content: well to be honest I would, if i made a simple project I'd not want anyone ripping it off. I mean they can go design their own !

author: Zero999
author_rank: Super Contributor
timestamp: April 01, 2011, 07:37:07 pm
content: If it's that easy to design then why bother? You've not lost much, just made someone else's life easier.I'd actually be quite flattered if someone copied my work, especially if they learn from it.

author: Simon
author_rank: Unknown
timestamp: April 01, 2011, 07:54:10 pm
content: yes well some poeple need to make a living and can't aford to give their work away

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 01, 2011, 08:34:03 pm
content: one of solution. make your design ugly.

author: Simon
author_rank: Unknown
timestamp: April 01, 2011, 08:39:01 pm
content: why should I make my design "ugly" ? in electronics terms that would mean making it more complictaed than need be and poorly performing, that costs me more

author: Zero999
author_rank: Super Contributor
timestamp: April 01, 2011, 09:47:22 pm
content: Quote from: Simon on April 01, 2011, 07:54:10 pmWho said anything about giving it away?People sell software, music and films without nasty DRM all the time and aren't giving it away.I don't knowingly buy anything with DRM and I consider code protection or going to great lengths to hide how something works from the user as dishonest in itself.

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 01, 2011, 10:08:26 pm
content: Quote from: Simon on April 01, 2011, 08:39:01 pmi mean, so cloner will not be interested at it. yeah, a complicated design can means "ugly" as well. and about this cloning, i think only successful product will worth cloning. so if you have sold so many of your products, then pirate will start to give attention to your product. and from there, you will do more on making your design "ugly". just like what rigol did to their latest firmware.

author: Lance
author_rank: Frequent Contributor
timestamp: April 01, 2011, 10:51:20 pm
content: Once the devices are de-capped what happens next in getting the code?

author: Psi
author_rank: Super Contributor
timestamp: April 01, 2011, 11:08:37 pm
content: Quote from: Lance on April 01, 2011, 10:51:20 pmi was wondering that, if it's a picture taken of the nand and maybe the state of each bit can be detected from its color or something.Or if its a matter of getting internal access to the nand data/address lines to attach some extra gold wires so the nand can be powered up and read out remotely.

author: Unknown
author_rank: Unknown
timestamp: April 01, 2011, 11:22:52 pm
content: You could just kill the lock/protect bits and read it out via the standard JTAG/in-system programming protocol. But detecting the charge in the flash ROM with an e-beam is also an option.

author: baljemmett
author_rank: Unknown
timestamp: April 01, 2011, 11:43:16 pm
content: Quote from: alm on April 01, 2011, 11:22:52 pmYep, that's the techniquebunnie describedfor getting around it. More secure devices have beefier protection (Flylogic have some nice examples on their blog, I believe) but in the end anybody intent on stealing your code is probably going to find a way eventually. Time's on their side, after all...

author: Lance
author_rank: Frequent Contributor
timestamp: April 02, 2011, 03:16:08 am
content: That's true. I wonder if you could have a something inside the device that would destroy the die if exposed to air.

author: Zero999
author_rank: Super Contributor
timestamp: April 02, 2011, 08:43:50 am
content: Quote from: alm on April 01, 2011, 11:22:52 pmHere's an interesting site which describes the process in detail.http://www.cl.cam.ac.uk/~sps32/mcu_lock.htmlYou could also use a UV laser.Quote from: Mechatrommer on April 01, 2011, 10:08:26 pmDon't you miss the days when 'scope manufacturers used to provide service manuals, complete with a schematic and a parts list?I hope someone writes some open source firmware for the Rigol, that way all you do is buy a cheap Rigol, load the new firmware on to it which gives you all sorts of features you can't buy from a top of the range Rigol 'scope.Quote from: baljemmett on April 01, 2011, 11:43:16 pmNonsense, they're not stolen anything. Just because someone breaks the copy protection you still have the code. The only way of stealing it from you is to break into your computer and remove all copies of your hard drive.Also don't forget when they look at the code inside the PIC, all they see is a load of assembler, no labels, comments, C source code, nothing.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: April 02, 2011, 10:57:05 am
content: My guess is the easiest way to read most parts is to disable the protect bits, either by erasing or temporarily by wafer probing. A way to make this harder would be to blow the programming pin protection diodes.I'm surprised more MCU makers haven't offered parts with onboard unique factory serial numbers, as this would provide a fairly simple but robust mechanism to improve security, by encoding the firmware with the unique number, so a copy of the firmware won't work in another part.Some Xilinx FPGAs have a serial number facility to achieve this ('DigitalDNA').A problem is that if a manufacturer starts promoting security as a feature, if it's then hacked they will get a lot of grief from customers. This is why you tend to see very vague and wooly statements about protection in most manufacturers' datasheets.I'm surprised Microchip parts are still vulnerable to such a cheap attack, as they got burned early on with the 16C84, which could be read by simply increasing the programming voltage beyond spec.

author: baljemmett
author_rank: Unknown
timestamp: April 02, 2011, 10:58:09 pm
content: Quote from: Hero999 on April 02, 2011, 08:43:50 amOK, fair point, that was sloppy of me; got caught up and carried away in Simon's concerns, perhapsSubstitute "get at" or "rip off" or whatever as appropriate, but it doesn't really change the point -- if someone wants to see what code you've got your chip running, they can work at it for as long as they please. Once the device is in their hands you can't upgrade the protection to keep pace with their methods; not a busting lot anyone can do about that!QuoteWell, of course, but if all they want to do is sell cheap knock-offs of your design the binary'll do just as well as the source code...

author: Zero999
author_rank: Super Contributor
timestamp: April 03, 2011, 09:35:57 am
content: Quote from: baljemmett on April 02, 2011, 10:58:09 pmIt doesn't matter how much you invest in nasty DRM, people will always find a way to circumvent it.Seriously, wouldn't it be better to be more honest to spend nothing on hiding the code and offer the customer a higher quality product for the same price? You'll sell more if you invest the money in quality, marketing and creating a good brand rather than on subterfuge.QuoteIf your project is such poor quality that no one can distinguish between the high quality original and the cheap knock-off then it's not worth much and you deserve Changhwo and co coping it and churning out a million units a day for a tenth of the price.I think the best way to protect yourself is to build a high quality product, buy a trademark, patents if necessary (not that I completely agree with them) and make sure the code is copyrighted. Then you don't have to rely on underhand practices such as code protection. If someone copies your code and puts it in a cheaper product, they can't use your trademark because that's asking for trouble and if they put it in a cheaper no name product it won't be much competition, well only as much as shitty Mastech DVMs are a competitor to brands like Fluke.

author: baljemmett
author_rank: Unknown
timestamp: April 03, 2011, 11:02:03 pm
content: Quote from: Hero999 on April 03, 2011, 09:35:57 amPreciselyI think we are in violent agreement here, as they say. It was Simon's comments upthread about people cloning his work that inspired me to post, mostly just to say "you'll never win that way".Personally I'm just in the software trade, the hardware side of things is purely a hobby (and not one I'm particularly advanced in, either) -- but the biggest products I work on are sold for large installations where customers have no incentive not to be honest. One client did once observe to me that, although they/we wouldn't much appreciate anyone defeating the licensing system (which is there for the customer's security as much as ours), at least it's our product they wanted to use enough to go to that trouble!

author: Simon
author_rank: Unknown
timestamp: April 04, 2011, 06:04:47 am
content: it is a vary varible issue and no I don't agree with over the top stuff like used in the media industry. But I'd take basic steps to make something harder to copy if it wasn't difficult or cost more.

author: DrGeoff
author_rank: Frequent Contributor
timestamp: April 04, 2011, 06:38:48 am
content: Quote from: Lance on April 02, 2011, 03:16:08 amDoesn't all the smoke escape when they take the top off?

author: Simon
author_rank: Unknown
timestamp: April 04, 2011, 06:58:00 am
content: yea, it's never work again

author: Zero999
author_rank: Super Contributor
timestamp: April 04, 2011, 08:56:11 pm
content: That sounds like something the MoD would do to stop North Korea from stealing their secrets.Interesting most military equipment has a destroy sequence enabling the contents of all the memory to be erased and a section in the manual describing the best places to put the explosives to render it inoperable to the enemy.Copying firmware and ICs is nothing new. the USSR would often clone US ICs, see link below.http://www.cpushack.com/soviet-cpus.htmlI'm a supporter of open source software. When I think about how good some open source programs are (OpenOffice, Inkscape, KiCad etc.) I can't help but think it's the future. As the same time I realise it's not the only way (not everyone can make a profit from the open source model) but I firmly believe DRM (including code protection) is clearly not the way to go.Where I work, we give the customer the drawings for their machines, including all the code we write for them and long may the open and transparent policy continue. Don't get me wrong, it's not free, all the information is copyrighted but the fact we share it with our clients is great, after all, it's their machine and the more they can understand it the better for both them and us ( it lowers the support costs).

author: Simon
author_rank: Unknown
timestamp: April 04, 2011, 09:03:25 pm
content: Quote from: Hero999 on April 04, 2011, 08:56:11 pmwell making a one off machine or small quantities for a customer is a little different. They're paying a packet for the the design as much as for the physical machine

author: Zero999
author_rank: Super Contributor
timestamp: April 06, 2011, 04:42:45 pm
content: What would you rather have? A scope which comes complete with schematics and source code or one which is essentially a black box.

author: Simon
author_rank: Unknown
timestamp: April 06, 2011, 05:15:16 pm
content: I'd rather have a free scope end of but i suppose the manufacturers won't quite agree with that.No longer providing manuals and schematics is not about protection. It is more about cutting costs and making things hard to repair so that you buy a new one.

author: bilko
author_rank: Frequent Contributor
timestamp: April 06, 2011, 06:34:03 pm
content: It is not a major cost to provide manuals and schematics on pdf, but then it would be easier for the competition to copy the design, so probably more about protecting the design than cost of distribution.I think that most on this board who have purchased Rigol / Hantek or Tekway it is because of the information available (from here).I bet also that Agilent and Tektronix have lost some market share because some customers have switched because of the 'comfort factor' of having information available. Providing schematics and manuals would greatly enhance customer confidence and loyalty. Why would you want to purchase a scope from a 'clone' manufacturer when you can have the original, unless of course the original was vastly overpriced?

author: ziq8tsi
author_rank: Regular Contributor
timestamp: April 06, 2011, 07:24:43 pm
content: Quote from: Simon on April 06, 2011, 05:15:16 pmCodeprotectionrestriction is the ultimate in making things hard to repair. When the chip fails you cannot obtain a replacement short of writing your own software for it. Should customers not be allowed to make their own backups?We established at the beginning of this thread that the cost of defeating the restrictions is actually quite small for anyone with the resources to become your competitor in the first place. And the assumption that someone who looks at the code intends to "rip it off" on a scale that could hurt you is incredibly paranoid. Far more likely they want to study or modify it for their own personal use.Would you apply the same restrictions to the hardware if it was as cheap and easy to do so? Potting the entire board to make it difficult to copy (and impossible to inspect or repair)? Is there a difference?I am not really convinced that copying by competitors is the motivation for code restriction at all. I think there is an element of fear that the product is not as valuable as it is costly. And a consequent desire to think of, and treat, customers as either "consumers" or "pirates". Sheep or wolves, not fellow humans.

author: bilko
author_rank: Frequent Contributor
timestamp: April 06, 2011, 08:08:23 pm
content: In my experience, those who do not release code, schematics or other 'service' information to their customers have reason to be embarrassed about the quality of their product design. I have had cause to reverse several products for maintenance purposes and have seen the mess they wanted to hide.

author: Simon
author_rank: Unknown
timestamp: April 06, 2011, 09:31:35 pm
content: I remember the large schematics you used to get with TV's, they were on A2 sheets or bigger, not the cheapest distribution. They also provided troubleshooting information, not the sort of thing they like to let you have now. It's convenient to sell a TV every 2 years to the same person

author: bilko
author_rank: Frequent Contributor
timestamp: April 07, 2011, 12:50:49 am
content: If your TV only lasts 2 years would you buy the same brand ?

author: Lance
author_rank: Frequent Contributor
timestamp: April 07, 2011, 12:53:55 am
content: Quote from: yachtronics on April 07, 2011, 12:50:49 amProbably not, but you probably will anyway. I hate modern electronics practices.

author: Simon
author_rank: Unknown
timestamp: April 07, 2011, 05:37:43 am
content: Quote from: yachtronics on April 07, 2011, 12:50:49 amWell considering that I know that most companies are just rebranding stuff, I know it makes little difference. Unless you spend a lot of money these days who ever you buy from is like playing the lottery. And knowing they are mostly the same.....

author: Zero999
author_rank: Super Contributor
timestamp: April 07, 2011, 09:19:05 pm
content: Quote from: Simon on April 06, 2011, 05:15:16 pmPut it another way, how much would you be willing to add on to the price for the schematics and source code? Can you put a price on it?I think it's something to be expected from high quality test equipment.

author: Wim_L
author_rank: Regular Contributor
timestamp: April 07, 2011, 09:40:30 pm
content: Quote from: Hero999 on April 07, 2011, 09:19:05 pmNot that it would do you much good if all you see on the schematics is a set of boxes representing custom ICs...It's important for another reason though... You may need to know how the machine works. Some measurements and tools are simple. Other measurements are harder, and may be susceptible to normally minor disturbances. I've had cases where having the schematics for a device gave helpful clues on how to improve the reliability of a measurement.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: April 08, 2011, 07:51:26 am
content: I think the main reason for service info for almost anything not being available these days is lack of demand. If availability of service info swayed purchasing decisions for any significant part of the market, manufacturers would be more likely to do it.Equipment is hugely cheaper than it used to be, so repairs are less financially viable.Much more use is made of custom chips and high-density packages, also making repairs less viable.Equipment is much more reliable, so repairs are less likely to be needed in the first place.The bottom line is not enough people want service info to justify providing it.

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 08, 2011, 10:29:47 am
content: maybe competition, or this protection stuff. maybe long time ago, the scenario is... "you build oscilloscope and i build a circuit, i buy your oscilloscope, someone else will buy my circuit", but now the scenario is "you build oscilloscope, i build oscilloscope too! you give me schematic, i'll make it better and sell my oscilloscope better than yours".

author: Zero999
author_rank: Super Contributor
timestamp: April 08, 2011, 04:06:03 pm
content: Quote from: Wim_L on April 07, 2011, 09:40:30 pmWhat custom ICs?I've never opened a Rigol up but by all accounts the components seem to be pretty standard.

author: Simon
author_rank: Unknown
timestamp: April 08, 2011, 05:35:13 pm
content: maybe they mean FPGA's ? you welcome to look in mine any day

author: Zero999
author_rank: Super Contributor
timestamp: April 08, 2011, 05:42:25 pm
content: That's why I said the manual should contain both the schematics and source for firmware. I knew a schematic on its own would be pretty useless.

author: Tony R
author_rank: Regular Contributor
timestamp: April 13, 2011, 11:54:24 pm
content: I am a student now and i don't feel the need to code protect anything, however, if i was trying to make money on my project then yes i probably would, but as for now im trying to make good grades on them.