EEVblog Electronics Community Forum

Electronics => Projects, Designs, and Technical Stuff => Topic started by: Arte on June 26, 2022, 07:25:47 pm

Title: What potting compound to use to protect from reverse engineering ?
Post by: Arte on June 26, 2022, 07:25:47 pm
Hello !

I'm developing my first commercial electronics product and I have reason to some believe some people will want to steal the contents of RAM (there is a history of IP theft in that domain). On top of that, I use the RP2040, which doesn't have an internal flash (and thus any form of security measure). Finally, patents are way too expensive for one random guy like me.

Given that, I'm still trying to make it very hard to reverse engineer the device. Aside from any software things like encrypting the firmware in place or making it hell to read the ASM, I was planning to use a potting compound to prevent access to the electrical components.

At first I tried some random epoxy off Amazon (meant to make fantasy jewelry & other mold-based things - Dr Crafty). That didn't work very well. I could scrape off the cured epoxy with a knife, and I could cut it too, and once there was enough of a dent, I could remove it by hand and it would separate from the PCB. So clearly, far from enough adherence to the PCB.

Fine then, maybe I should use something meant for potting compounds as my potting compound. So I got some MG Chemicals 8810 Black Rigid Urethane. Unfortunately that's not working out very well for me either.

(https://i.imgur.com/ARLwWfw.png)

Two observations here: I put what I would consider a "normal" amount of coating on the right PCB, and it would seem bubbles have formed as in, the volume at least tripled. ... In fact the PCB does not fit in its enclosure anymore.
In my subsequent tries, I put few droplets, and I get something that, while having significantly grown in volume, at least doesn't render the PCB unusable. That's a very annoying behavior I didn't expect, and I'm not sure is expected. Also, I would guess that these bubbles lower the resistance, I mean, I can pierce them with a knife...
Secondly, I find this not that hard to remove. It's not as easy as the epoxy I used previously, but I would expect someone determined to be able to remove enough of it to access the interesting parts without any need of resorting to hazardous chemicals, in other words, it doesn't do the job.

We're very far from what I can read about the efficiency of these compounds in places like https://www.eevblog.com/forum/repair/removing-black-little-rubbery-feel-potting-compound/ (https://www.eevblog.com/forum/repair/removing-black-little-rubbery-feel-potting-compound/) where people agree it's very difficult to remove, for instance I read
"To make a long story short: Theres no "chemical" way to remove it without damaging the parts or PCB that i know of.
If it's the soft stuff, you just remove it with a cutter piece by piece, hoping it does not stick to well to the plastic foils around caps etc.
The problem is, once you cleared the PCB, i may be impossible to tear the PCB from the resin underneath without breaking it.

If it's the hard resin: Forget about it. I'm not saying it can't be done, but it's a fools errand. "


So, what am I doing wrong here ? It should be noted that since I was mixing droplets (10 droplets of A, 5 droplets of B...) the 2:1 ratio may not be perfect.. but still. What is this "hard resin" ? Am I using the wrong chemical ? Or just doing things wrong ? On that note, if I could use a chemical that doesn't behave like yeast, that'd really make my life simpler.

Thanks !
Regards, JB
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: ataradov on June 26, 2022, 07:38:18 pm
With RP2040, I'd say forget about it. It does not matter how you coat it, it would be always possible to get access to the traces, so extraction of the firmware is next to trivial. You don't need to remove it all, you don't even need to remove the devices, all you need it to get access to the traces. Using very hard epoxy actually plays into attacker's hand - it can just be milled out. Using a slightly gummy product is more annoying.

And especially if the IP theft is common in the area, then this would not be an obstacle to anyone.

Also, as an attacker, what is the problem with  breaking a PCB? The analysis can be destructive. You can buy multiple device for reverse engineering.

And for the traces you also have XRay, for which your epoxy won't do anything.

Here is how such things are removed in practice: https://youtu.be/Qk8Hg8uCRQE?t=123 The video is about removing the IC using a CNC mill for replacement, but the same principle applies for reverse engineering.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: oz2cpu on June 26, 2022, 07:44:12 pm
you can only slow the one person down, who WILL do it, no matter what,
in that work, you end up spending so much extra time and money into each unit you make..
is it really worth it ?

a good advice , call the epoxy coating you add, weather proof, and thermal improve, and vibration improve..
but dont belive it will secure your ip..

by the way :
eposy mixed with sand, is a pain to remove, it also wear hard on tools and patience
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: coppercone2 on June 26, 2022, 08:08:06 pm
and I don't think all those 'improvements' are true, potting compound can IMO make some stuff less reliable.

you can mail stuff in for circuit RE and depotting, they will have some guy go at it 0.1mm at a time till its nice and clean and then also x-ray it and ID all the chips for you. remember there are 195 countries in the world and most of them are poor and have willing people, you are likely wasting BOM and manufacturing cost. There are probably Chinese X-ray ID databases of IC right now lol
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: Conrad Hoffman on June 26, 2022, 09:17:08 pm
IMO, a waste of time. Almost all epoxies will succumb to a bath of hot NMP. Those that won't can be removed in other ways. Even if you had money for patents, they're nearly useless. The best defense is to make your money and be on to something new before the device is copied.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: Arte on June 26, 2022, 09:47:24 pm
By IP theft being common, I was moreso saying that the people here have zero ethics. For the record the domain is a video game community. So the attacker wouldn't have mad funds either. And yeah I'm aware they only need traces, which is why the area covered in compound here is the chip, the flash, and the traces in between.. But I get what you're all saying.... Also I really don't care about the circuit, only about the algorithm within the chip. In fact even if they have the flash contents, I tried my best at making it hell to reverse engineer the ASM. Now if they can debug the chip, of course none of this helps.

While I'm here - would it help to wire the SWD pins to some net ? If I do that and wire them to say 3V, that would mean the reverse engineer would have to remove the chip from the PCB first, correct ?
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: SiliconWizard on June 26, 2022, 09:57:17 pm
If you want a decent potting compound, have a look at Electrolube. Select what's appropriate: https://electrolube.com/products/encapsulation-resins/

Whether it's useless or not can be an endless debate. I suppose slowing down people, especially if you suspect average DIYers rather than large and well-equipped chinese companies, is better than doing nothing.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: ataradov on June 26, 2022, 09:58:25 pm
All they would need to do is get access to the flash IC or traces and then flash the same firmware on the dev kit. They don't need your hardware to debug.

You will be wasting time on that epoxy effort and it will take an interested party a couple of hours to dump the firmware. Seriously, it is a waste of time.

Also, don't forget to epoxy the other side too, since if the epoxy is too annoying, I'd just go with the mill from the other side and mill out the PCB under the ICs. And you don't need some crazy high tech equipment - a dremel with a grinding stone or burr will do.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: Arte on June 26, 2022, 10:00:54 pm
I can make the firmware depend on the flash ID. (I am so deleting these posts later on) Wouldn't that make pulling the firmware from the flash & using it elsewhere not an option ? And if I force them to take off the chip from the PCB, then if I rely on the shape of the PCB to build a decryption key, the decryption would fail, hence my idea of forcing them to remove the chip from the PCB because the SWD lines are wired to other stuff - would that not be a significant PITA to deal with ?
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: ataradov on June 26, 2022, 10:03:11 pm
I can make the firmware depend on the flash ID. (I am so deleting these posts later on)
It is very trivial to debug. All you have to find is the place that reads the ID from the flash. And this is very easy to correlate with activity on the outside bus. And then it is even easier to patch out the check.

You are reinventing the wheel. None of this will do much to slow down the attacker. External flash with no hardware scrambling == no security.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: james_s on June 26, 2022, 11:35:04 pm
If something is potted, it only encourages me to try to reverse engineer it, and I will say from experience that no matter what you pot it in I will find a way to access the components. I have access to an xray machine and a milling machine, I have a hot air pencil and various picks and scraping tools. I've yet to encounter a potting compound that did more than slow me down a bit, especially if I'm willing to destroy a sample of the device I will get into it. I'm just a hobbyist doing this stuff for fun, imagine how you are going to stop somebody who is really determined and is getting paid to do it.

Make your device as good as you can, offer value added features like top notch support and you will sell them. You cannot stop cloning by force.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: ejeffrey on June 26, 2022, 11:44:13 pm
(I am so deleting these posts later on)

Please don't do that.  I'm not sure if it is officially against the forum rules and a banning offense, but it should be and either way is extremely offensive behavior.  People here are volunteering to help you for free.  Even if you don't like the answer, it is important to leave the record here so that other people searching can find it in the future.  If you want private or professional advice, pay someone for it.  There are plenty of people on these boards who do consulting.  Of course, you probably don't want to pay an hourly consulting rate for someone to tell you what everyone here has already said: potting compound is useless for preventing even casual reverse engineering.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: nctnico on June 26, 2022, 11:48:13 pm
In my experience PU based potting compound adhere much stronger to components. What you could consider is having the electronics potted using a mold so you don't have to use a casing. I have used this method for some products in the past. The trick is to find a company that has the necessary equipment (vacuum chamber) and experience to create a good looking product. In 'my' case the potting was done to make it impossible to tamper with a board without physical damage.

But as others have pointed out: for reverse engineering potting does nothing. Just make sure to market & price your product in a way that you get an optimal ROI. Spending too much time on reverse engineering measures can actually make your profits go away.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: jonpaul on June 27, 2022, 05:55:37 am
 Bonjour à tous....

the chance that the OP really has a truly innovative and new invention is very low, suggest OP could check the field a bit deeper.
 
Potting has been discussed before eg for high voltage modules.
the impression that potting  easy or increases reliability is false.
The active chemicals, heat and mechanical stress during the curing can damage ICs and components and result in a dead device.


We made thousands of potted HV modules. We had a year to debug internal layout, stress relief, epoxy mix, process etc.
Initial yield was 50% and after a year of work we got 95% yield.
A vacuum oven cure cycle and anneal was required, with a proprietary epoxy 100% solids.

Finally beware that epoxy curing agents are active and toxic chemicals, eg aniline, which can cause skin rash, and other health hazards.

Nowadays reverse engineering of a fully potted assembly is with an x-ray, but usually heat will make the encapsulant crumble.
A determined competitor or adversary will always find a method.
Defense is always 10..100x more expensive and difficult than offense.

Bon Chance,

Jon

PS: Je pense que l'OP, M. Arte, est français ? Je vis à Paris...
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: vk6zgo on June 27, 2022, 06:22:04 am
If someone legitimately buys one of your devices, & uses it as intended, they then pretty much know what it does, and can design something which does the same job, even if the "guts" are different, so "reverse engineering" is probably not even necessary.

OK, they might miss one feature of your original design, but if the thing they make is cheaper than yours, it will still sell!
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: David Hess on June 27, 2022, 09:28:34 am
Mix the epoxy potting compound with silica sand.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: coppercone2 on June 27, 2022, 08:54:12 pm
IMO, a waste of time. Almost all epoxies will succumb to a bath of hot NMP. Those that won't can be removed in other ways. Even if you had money for patents, they're nearly useless. The best defense is to make your money and be on to something new before the device is copied.

That sounds like a useful solvent to have around.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: oz2cpu on June 27, 2022, 10:11:59 pm
i once had the idea of a secret bag of poop deep inside the epoxy,
so the dude going carefully thru the epoxy will know how i feel about him,
there is no copyright on this idea if any one like to copy it, feel free,
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: Smokey on June 27, 2022, 10:25:19 pm
Hello !

I'm developing my first commercial electronics product and I have reason to some believe some people will want to steal the contents of RAM (there is a history of IP theft in that domain). On top of that, I use the RP2040, which doesn't have an internal flash (and thus any form of security measure). Finally, patents are way too expensive for one random guy like me.

Given that, I'm still trying to make it very hard to reverse engineer the device. Aside from any software things like encrypting the firmware in place or making it hell to read the ASM, I was planning to use a potting compound to prevent access to the electrical components.

At first I tried some random epoxy off Amazon (meant to make fantasy jewelry & other mold-based things - Dr Crafty). That didn't work very well. I could scrape off the cured epoxy with a knife, and I could cut it too, and once there was enough of a dent, I could remove it by hand and it would separate from the PCB. So clearly, far from enough adherence to the PCB.

Fine then, maybe I should use something meant for potting compounds as my potting compound. So I got some MG Chemicals 8810 Black Rigid Urethane. Unfortunately that's not working out very well for me either.

(https://i.imgur.com/ARLwWfw.png)

Two observations here: I put what I would consider a "normal" amount of coating on the right PCB, and it would seem bubbles have formed as in, the volume at least tripled. ... In fact the PCB does not fit in its enclosure anymore.
In my subsequent tries, I put few droplets, and I get something that, while having significantly grown in volume, at least doesn't render the PCB unusable. That's a very annoying behavior I didn't expect, and I'm not sure is expected. Also, I would guess that these bubbles lower the resistance, I mean, I can pierce them with a knife...
Secondly, I find this not that hard to remove. It's not as easy as the epoxy I used previously, but I would expect someone determined to be able to remove enough of it to access the interesting parts without any need of resorting to hazardous chemicals, in other words, it doesn't do the job.

We're very far from what I can read about the efficiency of these compounds in places like https://www.eevblog.com/forum/repair/removing-black-little-rubbery-feel-potting-compound/ (https://www.eevblog.com/forum/repair/removing-black-little-rubbery-feel-potting-compound/) where people agree it's very difficult to remove, for instance I read
"To make a long story short: Theres no "chemical" way to remove it without damaging the parts or PCB that i know of.
If it's the soft stuff, you just remove it with a cutter piece by piece, hoping it does not stick to well to the plastic foils around caps etc.
The problem is, once you cleared the PCB, i may be impossible to tear the PCB from the resin underneath without breaking it.

If it's the hard resin: Forget about it. I'm not saying it can't be done, but it's a fools errand. "


So, what am I doing wrong here ? It should be noted that since I was mixing droplets (10 droplets of A, 5 droplets of B...) the 2:1 ratio may not be perfect.. but still. What is this "hard resin" ? Am I using the wrong chemical ? Or just doing things wrong ? On that note, if I could use a chemical that doesn't behave like yeast, that'd really make my life simpler.

Thanks !
Regards, JB

By IP theft being common, I was moreso saying that the people here have zero ethics. For the record the domain is a video game community. So the attacker wouldn't have mad funds either. And yeah I'm aware they only need traces, which is why the area covered in compound here is the chip, the flash, and the traces in between.. But I get what you're all saying.... Also I really don't care about the circuit, only about the algorithm within the chip. In fact even if they have the flash contents, I tried my best at making it hell to reverse engineer the ASM. Now if they can debug the chip, of course none of this helps.

While I'm here - would it help to wire the SWD pins to some net ? If I do that and wire them to say 3V, that would mean the reverse engineer would have to remove the chip from the PCB first, correct ?

I can make the firmware depend on the flash ID. (I am so deleting these posts later on) Wouldn't that make pulling the firmware from the flash & using it elsewhere not an option ? And if I force them to take off the chip from the PCB, then if I rely on the shape of the PCB to build a decryption key, the decryption would fail, hence my idea of forcing them to remove the chip from the PCB because the SWD lines are wired to other stuff - would that not be a significant PITA to deal with ?

:)
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: coppercone2 on June 27, 2022, 11:37:23 pm
i once had the idea of a secret bag of poop deep inside the epoxy,
so the dude going carefully thru the epoxy will know how i feel about him,
there is no copyright on this idea if any one like to copy it, feel free,

yes, the guy in a third world country trying to repair the module 10 years after its obsolete is gonna love it :clap:
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: vk6zgo on June 28, 2022, 02:56:19 am
i once had the idea of a secret bag of poop deep inside the epoxy,
so the dude going carefully thru the epoxy will know how i feel about him,
there is no copyright on this idea if any one like to copy it, feel free,

yes, the guy in a third world country trying to repair the module 10 years after its obsolete is gonna love it :clap:
Many products are figuratively speaking, "a bag of poop", so why not literally. ;D

In Oz, we like to think of ourselves as a "first World Country", but I have run into plenty of cases of manufacturers using public domain circuitry, then trying to protect their non-existent IP by sanding the markings off ICs.
It is usually pretty obvious what the device is, after chasing up the surrounding circuitry, but it is an additional cost to the customer.
Encapsulation is just the poop icing on the cake!

Then there are devices which are "unobtainium" except from the manufacturers, who if they are in Europe, may as well be on the moon!
Back in the day, a special IC in an LGT TV transmitter which was still a current design croaked, with a spare "maybe" avaliable in 3 months------A workaround, using discrete components on a VERO board was designed in a couple of days, & in service within a week.

Never discount the ingenuity of a Tech being harassed by his/her Boss!
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: Ice-Tea on June 28, 2022, 06:34:34 am
As other pointed out: probably not worth the time/effort. You're better of investing that energy and $$ either in keeping the product cheap (which potting does not do) so it makes less sense to reverse engineer it or to improve your product continuously so you stay one step ahead.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: AnalogueLove1867 on June 28, 2022, 11:38:21 am
Very disappointed with all the people here openly encouraging the OP to just let other people easily pirate his design.....  :palm:
I have some valuable family items locked in a miniature safe that is bolted onto concrete...
BUT
Somebody could easily break in when I'm at work and open it up with a welder....
So there is no point right? Might as well just leave it out in the front yard for the local meth-head to snatch up lol.
All the other points made by people here...  just bizarre. Anyway, to the point!
https://www.youtube.com/watch?v=1ZCn0xkkQSk (https://www.youtube.com/watch?v=1ZCn0xkkQSk)
https://www.youtube.com/watch?v=h8ycmroFQSs (https://www.youtube.com/watch?v=h8ycmroFQSs)
https://www.youtube.com/watch?v=2LhunhbJ2WI (https://www.youtube.com/watch?v=2LhunhbJ2WI)
https://www.youtube.com/watch?v=IiXuJ4xJL-g (https://www.youtube.com/watch?v=IiXuJ4xJL-g)
And then PC builders have whole how-to videos about directly spray-painting motherboards on youtube.
So you could
!) first spray paint the whole circuit.
2)The cover it with a layer of nail varnish or glue gun etc.
3) Finish off with a second final spray paint.



Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: Ice-Tea on June 28, 2022, 12:05:20 pm
You're going to protect the circuit with...

*checks notes*

hot melt? So, the criminal essentially has to put the device in the sun and wait for the goop to drip out? IMO, a commercial product and hot melt don't go together. Ever.

Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: AnalogueLove1867 on June 28, 2022, 12:17:08 pm
You're going to protect the circuit with...

*checks notes*

hot melt? So, the criminal essentially has to put the device in the sun and wait for the goop to drip out? IMO, a commercial product and hot melt don't go together. Ever.

Cool potatoes! Don't Use the hot glue then! Use one of the many other things listed in the vids.
Also The point isn't to prevent all potential humans on the planet from ever reverse-engineering the product for three hundred years.
The point is that you make it HARDER and more INCONVENIANT/TIME-CONSUMING.
And I hate to tell you this... but I have come across products from china that have been pasted over with some sort of thermoplastic that HAS melted.
So yeah, commercial products.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: BreakingOhmsLaw on June 28, 2022, 12:29:32 pm
Epoxy mixed with micro glass beads is very hard to remove. Preferably with a black coloring added.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: Ice-Tea on June 28, 2022, 12:33:23 pm
You're going to protect the circuit with...

*checks notes*

hot melt? So, the criminal essentially has to put the device in the sun and wait for the goop to drip out? IMO, a commercial product and hot melt don't go together. Ever.

Cool potatoes! Don't Use the hot glue then! Use one of the many other things listed in the vids.

One of the things people above testified about that it's really not all that easy? Those things?

Quote
The point is that you make it HARDER and more INCONVENIANT/TIME-CONSUMING.

That's not how a commercial enterprise works. You don't just make it harder to copy your stuff to spite a potential pirate. You do so that the effort/time/money balance tips in your favor. So if you're making 1000 100$ devices and need to add 10$ in development, labor and materials to keep the device 'safe' so that you don't loose 20 sales to copycats (not to mention the various collaterals) you have failed bussiness 101.

Quote
And I hate to tell you this... but I have come across products from china that have been pasted over with some sort of thermoplastic that HAS melted.

I have no idea why you would hate to tell me this but I do know that I don't do bussiness with people that hotmelt their electronics. And yes, I've seen it too.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: Siwastaja on June 28, 2022, 12:42:26 pm
Sorry for being blunt, but quite frankly, you are
* Overestimating your own skills
* Underestimating skills of others
* Overestimating the desire of others to copy your gadget.

In reality, it goes like this:
* Release a product
* If it is uninteresting to large masses or niche, no matter how good, copying won't be a problem
* If it is interesting to large masses, it will be copied, but this will take time
* Only if your gadget is very simple to copy, copies will appear quickly, BUT
* Even if you have some unicorn copy protection system in place, if it cannot be copied, then legal re-implementations will appear nevertheless!

And against legal re-implementations, having patents and a few dozen millions of excess cash per year to protect them, is the only (legal) way.

The actual value of your product is in everything else but the actual implementation (schematics/code): that is, demonstrating a problem, general style of design, marketing, etc. All of this can be legally utilized by others.

What you can and should actually do:
* Concentrate on making a good product - attempts to stop reverse-engineering or copying usually make the product worse for legit customers
* Concentrate on developing and improving new products
* Do not expect your idea to be a nearly infinite cash cow
* In case of infringements, it's also a sign that you have succeeded. Move forward and be even more successful;
* Don't ruin your success by fixating into calculating imaginary "money loss", because many who bought the counterfeit wouldn't have bought the genuine one.

And, regarding potting, it won't help the slightest. It will only hinder casual legit owner who wants to troubleshoot your thing for free instead of complaining, or do an interesting modification. Potting is known to reduce reliability (by inducing component cracking etc) if you don't do it right.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: AnalogueLove1867 on June 28, 2022, 12:59:08 pm
Hey, Mr Ice-Tea
Not easy for waterproofing...
The OP isn't trying to waterproof, he is trying to hide and cover.
Silicone and Nail Polish Seem to tick all the boxes.
Even a spray on foam would do the job.

Are you a communist by any chance lol.
If the OP wants to cover his product with a cheap substance then he will.
If Microsoft wants to keep its operating system code closed source then they will.
CPU and GPU manufacturers make their stuff impossible to reverse engineer.
ICs in a huge number of products are purposely miss-labled or have their labels scratched off.
Etc etc etc...


Wow, I wonder why "commercial enterprises" do that? Big mystery!

Who do you do business with lol.

Are you a self proclaimed "small business owner CEO" ?
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: AnalogueLove1867 on June 28, 2022, 01:04:15 pm
Epoxy mixed with micro glass beads is very hard to remove. Preferably with a black coloring added.


Like these? https://www.ebay.com.au/itm/284262072378?chn=ps&_ul=AU&norover=1&mkevt=1&mkrid=705-139619-5960-0&mkcid=2&itemid=284262072378&targetid=&device=c&mktype=pla&googleloc=9070827&poi=&campaignid=15791083372&mkgroupid=&rlsatarget=&abcId=9300816&merchantid=119412128&gclid=CjwKCAjwzeqVBhAoEiwAOrEmzW2JX_tao6E-nY7lpUCXwuQQ8IMz-tp_r6eZ2o36KUHAUzoW7t5JKhoCmBwQAvD_BwE (https://www.ebay.com.au/itm/284262072378?chn=ps&_ul=AU&norover=1&mkevt=1&mkrid=705-139619-5960-0&mkcid=2&itemid=284262072378&targetid=&device=c&mktype=pla&googleloc=9070827&poi=&campaignid=15791083372&mkgroupid=&rlsatarget=&abcId=9300816&merchantid=119412128&gclid=CjwKCAjwzeqVBhAoEiwAOrEmzW2JX_tao6E-nY7lpUCXwuQQ8IMz-tp_r6eZ2o36KUHAUzoW7t5JKhoCmBwQAvD_BwE)

Honestly that is a pretty cool idea.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: AnalogueLove1867 on June 28, 2022, 01:12:20 pm
Sorry for being blunt, but quite frankly, you are
* Overestimating your own skills
* Underestimating skills of others
* Overestimating the desire of others to copy your gadget.

In reality, it goes like this:
* Release a product
* If it is uninteresting to large masses or niche, no matter how good, copying won't be a problem
* If it is interesting to large masses, it will be copied, but this will take time
* Only if your gadget is very simple to copy, copies will appear quickly, BUT
* Even if you have some unicorn copy protection system in place, if it cannot be copied, then legal re-implementations will appear nevertheless!

And against legal re-implementations, having patents and a few dozen millions of excess cash per year to protect them, is the only (legal) way.

The actual value of your product is in everything else but the actual implementation (schematics/code): that is, demonstrating a problem, general style of design, marketing, etc. All of this can be legally utilized by others.

What you can and should actually do:
* Concentrate on making a good product - attempts to stop reverse-engineering or copying usually make the product worse for legit customers
* Concentrate on developing and improving new products
* Do not expect your idea to be a nearly infinite cash cow
* In case of infringements, it's also a sign that you have succeeded. Move forward and be even more successful;
* Don't ruin your success by fixating into calculating imaginary "money loss", because many who bought the counterfeit wouldn't have bought the genuine one.

And, regarding potting, it won't help the slightest. It will only hinder casual legit owner who wants to troubleshoot your thing for free instead of complaining, or do an interesting modification. Potting is known to reduce reliability (by inducing component cracking etc) if you don't do it right.

In other words, Just let Chinese people put you out of business. No problem! Easy as!
It is amazing just how much damage this does.
Hell, A guy on the 4hv.org forum had an efficient zero-voltage switching USB powered tesla-coil design directly ripped off and
sold on ebay as thousands of units by a manufacturer from Zhejiang.
So some rando guy was snooping on an obscure forum for months just to find that perfect schematic lol.
Pathetic.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: KaneTW on June 28, 2022, 02:10:55 pm
Worrying about IP is pointless.

Any determined attacker will reverse engineer your shit. If it's not feasible to reverse engineer, they'll reimplement it based on the behavior of the device.

I work on a VR computer and the hardware, software and firmware is open source. It doesn't need to be. But anyone who cares will copy it anyway if they want to, no matter how much effort you spend on protecting it. This way you have public prior art so people can't patent troll you, you don't need to worry about protecting your patent, and you contribute to the advancement of the field.

The actual worth of your product lies in your know-how and reputation. If you have a product targeted at enthusiasts, they'll be pretty miffed about protection as it's a waste of their time if they want to look at something in detail.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: Siwastaja on June 28, 2022, 02:18:05 pm
In other words, Just let Chinese people put you out of business.

No, you are doing it all by yourself.

Quote
Pathetic.

Yes, posting on discussion forum and fighting back using duplicate accounts when you don't agree, instead of trying to learn something, is pathetic. Please just go away. Thank you in advance.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: tooki on June 28, 2022, 03:47:49 pm
Why not use another microcontroller with internal flash you can copy-protect? The RP2040 isn’t that spectacular, IMHO.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: Alex Eisenhut on June 28, 2022, 04:51:13 pm
Well, if you're serious about protecting your IP, follow in the footsteps of IBM's trusted cryptographic security modules.

Things like "For example, the IBM 4758 embedded a conductive mesh within the epoxy-like package; internal circuitry monitored the electrical properties of this mesh — properties which physical tamper would hopefully disrupt. Devices can also monitor for temperature extremes, radiation extremes, light, air, etc."

https://www.cs.dartmouth.edu/~sws/pubs/hsm-draft.pdf (https://www.cs.dartmouth.edu/~sws/pubs/hsm-draft.pdf)

Or nuke it from orbit, the only way to be sure.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: james_s on June 28, 2022, 05:05:58 pm
Very disappointed with all the people here openly encouraging the OP to just let other people easily pirate his design.....  :palm:

The point is that if someone wants to pirate it, they're going to do so and trying to stop them is a waste of time that in many cases will actually encourage somebody to reverse engineer it. I know when I see something has been potted I start to wonder what's in there that they don't want me to see, so I will reverse engineer it to find out, trust me, the epoxy potting does nothing to stop me, it may slow down the process a little but nothing more. You are disappointed that people are pointing out the folly of putting a massive secure lock on a door that is made of cardboard. As a method of security it is like sanding the numbers off ICs, it just makes me laugh that somebody actually thought that would accomplish anything and took the time to do it. It creates an interesting puzzle out of an otherwise mundane circuit.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: bson on June 28, 2022, 06:04:24 pm
No need to mill even.  Just drill a hole.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: Simon on June 28, 2022, 06:34:59 pm
I can make the firmware depend on the flash ID. (I am so deleting these posts later on) Wouldn't that make pulling the firmware from the flash & using it elsewhere not an option ? And if I force them to take off the chip from the PCB, then if I rely on the shape of the PCB to build a decryption key, the decryption would fail, hence my idea of forcing them to remove the chip from the PCB because the SWD lines are wired to other stuff - would that not be a significant PITA to deal with ?

If you delete your posts we will end up banning you, this is an open forum where we share information freely not just for the benefit of the person asking but also for others to read later and benefit without having to re-ask. If this is that top secret then go away and solve it by yourself - hint, you can't.

So you are hell bent on protecting your firmware (not RAM as stated) and you picked a device that is inherently designed to be plugged into a USB port and act as a USB hard drive  :palm: :-DD

I suggest you just get to grips with the fact that if someone wants to copy it they will, if you are really that bothered don't just use the latest shiny gadget and then try to solve your problem by the back door with great difficulty - oh and warning, if this is how you plan to do designs don't even think of anything that has to pass EMC testing or your products will all be 90% hacked on bits after to fix the mess you made in the first place to get it past regulatory testing! I take it you have thought about that bit too as you plan to sell it?

Seriously if you plan to sell anything, you have just left out 90% of the thought process that would be needed for such a device and honed in on one thing that you are now trying to fix as an afterthought rather than as part of the design making it ten times harder. Why don't you just use a real microcontroller that lets you lock access to the flash/rom/program memory after it is programmed, sure people can probably still find a way in if they really want to but you will have stopped most people by using the features of the product without any Frankensteinian afterthought mash ups.

As for it being so terrible for you to post such sensitive things on here that you need to delete them..... This forum is littered with questions from me about the design of military equipment - not that you would know any different unless I admitted it and even where I have you still have no idea what it is! To quote a line from yes minister - "You need tact and finesse you burke!" There are way of asking questions, but they don't involve asking people to just solve it for you. You are not the first to ask this, and the answer does not change, unless it's that valuable that you are going to spend serious money on counter measures, don't bother. Banking equipment is one of the few examples that use potting countermeasures that are probably just gilding the lily on other methods. As for military - I gather that they just blow it up if they have to abandon it....
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: Simon on June 28, 2022, 06:40:01 pm
Why not use another microcontroller with internal flash you can copy-protect? The RP2040 isn’t that spectacular, IMHO.

The RP2040 is just another processor (OK 2 processors) on a chip with RAM and some but not many peripherals. It almost feels like - oh shit we can't get ARM-A processors as all the tiny process fabs are full, lets do something almost as easy to use that can be made on a bigger process and so easy to use it will obliterate Arduino, and judging from the little investigating I have done they have indeed come up with a nice solution and it's not even a microcontroller as it has no ROM/Flash. Very clever idea, totally not aimed at being aimed at tamper proof, it's aimed at people that can't do real microcontrollers or people that want very fast development and don't mind a few compromises - I'm half interested myself, particularly for logging data.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: Arte on June 28, 2022, 10:07:59 pm
Right, it's not sensitive, and I should've been more precise in saying I would get rid specifically of the part that says how exactly I'm making it harder. Or rather, used a fake username so people don't just stumble on this post. My mistake I guess. I didn't think this would cause such a reaction; also, I don't find it very mature to set such a description in stone when I ask how good is [doing exactly this and that to make it harder to hack a device] is before even letting me reply to how I'm not supposed to remove information from others. Figuring out how a device's encryption in place works once you've reached the firmware can be difficult and is a lot less difficult if there's a description of how exactly it works... with these messages this exchange may have caused me more harm than good  :(


For the record, I'm not trying to protect it from the chinese, I'm trying to protect it from specific people with DIY-level skills and basic disassembly skills. Like, I litterally have in mind the identities of the people that I would expect to try to steal it / damage the product for fun. I don't expect the attackers to be competent, and not significantly more than me, which isn't a high bar. So the approach so far has just been making it so I would hate my life if I was the one trying to reverse engineer it. ... That's about it. I don't think I need mad security ? But enough so you can't just stroll in and clone the device / RE the firmware update protocol (I made a custom firmware updater) enough to build an update that destroys the device beyond recovery and spread it, and potting sounded like a good fit. I would sure hate to have to deal with that.


I know damn well security is the RP2040's weakness, but if anyone has a microcontroller with 2 cores at this speed, 2 PIOs with 4 SMs (or equivalent - I make use of all of them) a usb device/host capabilities, that's widely available and was available for the past 2 years, for ~1$, then please enlighten me. A STM32F405 is $11 on JLC and is in stock every now and then.
An atmega32u4 is $10 and is almost out of stock. I'm by no means a professional, I'm a software developer and I've been learning the basics of all the tangential stuff that goes into making a commercial product to be able to turn a better algorithm (that can hardly be inferred from looking at the IO as it's a matter of prediction) in a niche field into a product that will probably only sell a few thousands. And from however little understanding I have, the RP2040 is currently for small fish like me not only a good option, it's virtually the only option and is litterally 5x better than other options I've looked into. I'm dead serious, if you have better proposals, I'm all ears, I'm not happy at all with having to use it. I was dreading the security aspects from day one.


Also frankly, I think you're nice merely hiding shit in the epoxy.
My previous ideas involved having the device recognize it's being messed with and have it spoof a keyboard+mouse on plug-in, having it attempt to escape whichever virtual machine it's into by clicking in the common places to do that, and then attempt to do fun things in the terminal such as submitting web searches about the crimes of the CCP.


Anyway I'm sorry this is causing a fight. Call me incompetent because I am, but I didn't find a suitable alternative to the RP2040 in terms of capabilities vs price point and I'm trying to make the best of a bad situation.

Edit: I forgot to mention it but I'm not sure what you mean with costly ? If epoxy is like, 30$ for 1L and I need at most a mL to cover the part of the board I care about, that's not very expensive, is it ? Or will the epoxy break a non negligible amount of boards ?

Edit2: I also keep finding it insane how dissonant conversations about removing epoxy from boards (ex the one I linked initially where someone just says to give up on removing hard epoxy) are from those about whether adding epoxy helps.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: eugene on June 28, 2022, 10:18:07 pm
I'm going to guess that your code will use only a small fraction of the available flash. You could obfuscate it by filling the remaining available memory with complex code that never gets called. That won't stop anyone from simply copying the entire mess, but it can make it more trouble than it's worth to uncover whatever it is you're trying to hide.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: ataradov on June 28, 2022, 10:26:09 pm
Edit2: I also keep finding it insane how dissonant conversations about removing epoxy from boards (ex the one I linked initially where someone just says to give up on removing hard epoxy) are from those about whether adding epoxy helps.
There is a difference between cleaning up the board you want to keep intact and just removing enough to get access to the SPI pins to dump the firmware.

Epoxy will make it absolutely annoying if you have one unique board you want to repair. This is not your case.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: Arte on June 28, 2022, 10:53:19 pm
oh and warning, if this is how you plan to do designs don't even think of anything that has to pass EMC testing or your products will all be 90% hacked on bits after to fix the mess you made in the first place to get it past regulatory testing! I take it you have thought about that bit too as you plan to sell it?

However surprising as that may be, I did. I looked into the regulations I had to comply with for the EU market, and as far as I understand, that would be CE and its EMC and RoHS components; and I saw that the CE specifications were... non quantitative. Which on one side I find baffling, and the other, not surprising.

I read the 2014/30/EU directive, and took away that I had to respect the following, write a document and add CE/RoHS on my devices:

1. General requirements
Equipment shall be so designed and manufactured, having regard to the state of the art, as to ensure that:
(a) the electromagnetic disturbance generated does not exceed the level above which radio and telecommunications equipment or other equipment cannot operate as intended;
(b) it has a level of immunity to the electromagnetic disturbance to be expected in its intended use which allows it to operate without unacceptable degradation of its intended use.

2. Specific requirements for fixed installations
A fixed installation shall be installed applying good engineering practices and respecting the information on the intended use of its components, with a view to meeting the essential requirements set out in point 1.

That's it. No seriously that's it.
What to take away from this ? What level qualifies as the one above which radio and telecommunications equipment or other equipment cannot operate as intended ? What electromagnetic disturbance can I expect in the context of its intended use (some guy's bedroom) ? How am I qualified to judge that with a background in mathematics and software engineering ?

From there I see two paths:
- Buy a 100$ EMC tester, test and go "well clearly the level are so low it's not a problem, also it still works when I run it next to my microwave and my CRT, must be good lmao. Also all my components are RoHS, Farnell and JLC said so"
- Respect a harmonized standard. Having looked at previous versions (the 2015 iirc) it's utterly impossible to verify them without highly specialized equipment and asking a lab to test for you costs an arm - by an arm I mean a significant % of the projected gross sales for the lifetime of the device. Oh yeah and, if I understood this correctly, YOU HAVE TO BUY THE LATEST HARMONIZED STANDARD TO EVEN KNOW WHAT YOU'RE SUPPOSED TO COMPLY WITH.

So, yeah. I'm going with the first option so far. I am in good faith doing all I reasonably can to ensure this device is compliant, and the (self-certified) directive - I was previously mentionning I wasn't that surprised - seems to be written to... allow people to do this. I guess the fact you buy what you have to comply with really highlights the fact major companies and individuals aren't held to the same standards.
For comparison, my peers don't even bother with compliance and have been selling to the EU without it (one has self certified the NA equivalent)
As far as I understand, the CE compliance is an obligation of results - also you have to write something to demonstrate you tried. You don't get fined until there's a problem and it's shown your device was not, in fact, CE, and you claimed it was. If you know your device is so basic EMC worries are out of the question (because it's litterally a mcu, a flash, a crystal, basic components and contacts), then you hardly care.

If anyone wants to pitch in on that - though it's not the initial subject - I would welcome it. I've been extremely confused learning about compliance, and I'm trying my best to play by the rules as much as a one man operation allows.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: james_s on June 29, 2022, 12:05:01 am
There was an excellent writeup someone posted here a few weeks ago about the original Xbox security fiasco and the mistakes that Microsoft repeatedly made. If you want to stop someone from reverse engineering your device you have to put a great deal of thought into security and engineer it to be secure from the ground up and even then it is likely someone will crack it eventually if there is any reason to do so.

You're going to do what you're going to do, but just trust me on the fact that epoxy does nothing for security. It is almost trivial to get into it. I would wager that I can heat it up sufficiently to peel the blank PCB away leaving the components set in the epoxy with all pins exposed in about 15 minutes using nothing more than my reflow hotplate. You are wasting your time.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: Arte on June 29, 2022, 12:35:26 am
There was an excellent writeup someone posted here a few weeks ago about the original Xbox security fiasco and the mistakes that Microsoft repeatedly made. If you want to stop someone from reverse engineering your device you have to put a great deal of thought into security and engineer it to be secure from the ground up and even then it is likely someone will crack it eventually if there is any reason to do so.

You're going to do what you're going to do, but just trust me on the fact that epoxy does nothing for security. It is almost trivial to get into it. I would wager that I can heat it up sufficiently to peel the blank PCB away leaving the components set in the epoxy with all pins exposed in about 15 minutes using nothing more than my reflow hotplate. You are wasting your time.

Well fuck my life and fuck the chip shortage. My first design used a STM32F407, back when they were $3 on JLC.

In all seriousness you've all made your point very clear. I can't say I'm happy with how things are, but thanks for clarifying them. I'll just have to accept how it is...
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: Smokey on June 29, 2022, 04:37:09 am
There was an excellent writeup someone posted here a few weeks ago about the original Xbox security fiasco and the mistakes that Microsoft repeatedly made. If you want to stop someone from reverse engineering your device you have to put a great deal of thought into security and engineer it to be secure from the ground up and even then it is likely someone will crack it eventually if there is any reason to do so.

...

https://nostarch.com/xboxfree
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: ataradov on June 29, 2022, 04:50:02 am
https://nostarch.com/xboxfree

There is a short and to the point summary  https://xboxdevwiki.net/17_Mistakes_Microsoft_Made_in_the_Xbox_Security_System . Highly recommended for anyone inventing their own security scheme.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: exmadscientist on June 29, 2022, 05:04:05 am
Three key elements to not getting screwed immediately by clones:

1. Don't choose a dishonest Contract Manufacturer. If you choose the wrong one, they'll start undercutting you with your own design! This is bad. It is hard to audit a CM and ensure they're honest, but, believe it or not, most of them are. (It's often the subcontractors that are trouble.)

2. Price your product fairly. No one wants to manufacture it themselves. We'd rather buy it! So price it such that we can justify just buying it. That might mean tiered pricing or all those other horrid schemes. They're awful, but if they keep your product afloat, we all win.

3. Have some key value-add that's difficult to copy, but not in the design itself. Like how it's tested or adjusted/calibrated. Or simply a (believable) guarantee of reliability. This is huge! If I can get the Chinese clone working with 10 hours of labor, that will mean nothing to hobbyists, but everything to professionals who have the money to pay for better.

And if anyone reading this thread still thinks epoxy potting compound actually does anything useful to solve this problem, I have one product name for you: Dynasolve 185.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: ejeffrey on June 29, 2022, 07:04:41 am
For the record, I'm not trying to protect it from the chinese, I'm trying to protect it from specific people with DIY-level skills and basic disassembly skills.

That basically sounds like a lot of the people on this thread who are telling you this won't work.

Quote
Like, I litterally have in mind the identities of the people that I would expect to try to steal it / damage the product for fun. I don't expect the attackers to be competent, and not significantly more than me, which isn't a high bar.

The issue is that their job is easier than yours so if they are "not much more competent than you" they are going to win.  That goes double if they are doing it "for fun".  Even with no countermeasures it might not be economical for someone to clone your product commercially if it is as niche as it sounds.  But if the people you are worried about do this for fun you have no chance and obstacles only serve as encouragement.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: Siwastaja on June 29, 2022, 07:43:30 am
For the record, I'm not trying to protect it from the chinese, I'm trying to protect it from specific people with DIY-level skills and basic disassembly skills.

That basically sounds like a lot of the people on this thread who are telling you this won't work.

Yes, because those are the best customers. They give you free visibility and any modifications etc. they are able to do increase the usefulness of the device and thus, sales.

Also actual counterfeits can increase visibility and sales. Battle against counterfeits is really interesting, it is not in the interest of Adidas or Nike to completely remove all counterfeiting from the world. They understand how the business works. Most important is to remove counterfeits being sold for full price through channels which make people think they are legit, because such people would buy the real thing and it is direct loss.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: Ice-Tea on June 29, 2022, 10:12:08 am
Final comment from me: you're giving a prospectice counterfeiter a free bonus feature compared to your product. You can service theirs.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: RogerThat on June 29, 2022, 11:13:24 am
Arte, I'm developing a product in France as well....with some innovation in it. You can protect your invention, in France, cheap by using a "Enveloppe Soleau": https://fr.wikipedia.org/wiki/Enveloppe_Soleau
I've been recommended it but not done it yet so don't know the exact details.

If you sell directly to customers you need only to conform to the 2014/30/EU (it's up to you to make sure it OK, it's called self declaration) and/or RED if it contains a radio transmitter. Google around on similar equipment and check their user manual, should be written which standard they conform to. EMC houses charges you roughly 1200€ per day for use of their facility including one engineer. If you product is well built it's one or two visits.

Forget potting as others have said. Honestly it is a bit paranoid to think someone would hack your product and steal the IP. I mean, someone with the equipment and knowledge to do it would probably find it easier to just copy the way it works with their own code. If you are first to release the product with your IP it will anyway be know as the "original product" and the others as clones...no one wants a clone unless it's the only thing they can afford.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: JuniorJack on June 29, 2022, 03:50:15 pm
Hey,

STM32 chips at least have backup domain that keep RTC and small chunk of RAM on. You can keep you 'algorithm' in there, not in flash, and copy to executable RAM when you chip is on. All you need is small CR2032 battery to keep RAM alive. There is no known method to dump battery backed SRAM if the debug interface is disabled.

But with your chip choice, you will need to do some digging in the horrible datasheet to see if you can execute in one of the RAM banks, low power mode not drain your battery and hold the RAM contents.

And off course this solution will be support nightmare and huge problem for your customers. As other posters suggested, best security is no security - e.g. Open Source or excellent customer support.

Good luck, K.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: ejeffrey on June 29, 2022, 04:30:48 pm
Arte, I'm developing a product in France as well....with some innovation in it. You can protect your invention, in France, cheap by using a "Enveloppe Soleau": https://fr.wikipedia.org/wiki/Enveloppe_Soleau
I've been recommended it but not done it yet so don't know the exact details.

Legal IP protection is of very little use for small manufacturers serving niche markets.  The total $$$ available in those markets are just not high enough to warrant enforcement action.  This sort of tool is useful if you are a small company that is worried that a big company is going to steal your invention where if they do you could potentially win a very large judgement against them.  The Enveloppe Soleau in particular seems like it only establishes priority date and right to use, not any sort of exclusivity.  So it prevents someone from finding out about your idea, but patenting it first and then suing you for infringement.


Quote
Forget potting as others have said. Honestly it is a bit paranoid to think someone would hack your product and steal the IP. I mean, someone with the equipment and knowledge to do it would probably find it easier to just copy the way it works with their own code. If you are first to release the product with your IP it will anyway be know as the "original product" and the others as clones...no one wants a clone unless it's the only thing they can afford.

It definitely happens.  Take a look at the Saleae logic analyzer and the Jlink programmer for some examples in the DIY electronics space, although in these cases it isn't so much an instance of cloners dumping the firmware to copy it (although they do), but that they are making compatible devices that work with the original client software.  Both products are sold at prices far above their hardware cost in order to include a license for the client software which is far more development cost than the hardware which is basically trivial.  Also to your point of "no one wants a clone unless its the only thing they can afford" -- both products are sold well above the price that hobbyists and even many small businesses are willing to pay, so there is a clear market for clones.

It also is possible to make reasonably secure hardware.  I don't think anyone here is claiming otherwise.  There are tamper resistance processors and security chips, there are devices that allow encrypted firmware with secure key storage and so on.  It is quite complicated to design a product like this, easy to screw up, has a number of downsides, and even then it is not foolproof but it can stop a lot of reverse engineering.  It's rarely worth the effort for the type of product the OP seems to be working on but it is possible.  Filing the markings off of chips and epoxy potting are just not effective ways to do this.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: SiliconWizard on June 29, 2022, 06:03:55 pm
I mean, someone with the equipment and knowledge to do it would probably find it easier to just copy the way it works with their own code. If you are first to release the product with your IP it will anyway be know as the "original product" and the others as clones...no one wants a clone unless it's the only thing they can afford.

I do not agree with that. You need to consider your audience there, and as the OP mentioned, worried about the average "audience" copying the product if it's too easy to do, while the audience probably has no means of doing anything a bit too involved, even if that bit looks trivial to the seasoned engineers here. And if it's that easy to implement without even needing to copy it, then so be it, but I don't buy this either. You're largely overestimating the capabilities of people in general, and probably of the OP's audience in particular.

As I got it, it's a bit of a "niche" product. Niche products do not have the same appeal nor are the same targets for cloning/copying as more "mainstream" products. Just my 2 cents.

Other than that, I would agree with the fact the RP2040, or any MCU with external code memory for that matter, would not be the ideal choice, but I can understand the rationale if it fits the requirements otherwise, as it's cheap and reasonably available as of now, as opposed to many other MCUs out there.

An idea would be to encrypt the ciritical Flash content, and decrypt it at boot time. That would imply running most of the code (at least the "critical parts") from RAM, but given the RP2040 has a comfortable amount of it, that should be doable.

The encryption could be using a key unique to each product. See if the RP2040 has some kind of unique ID or serial number, I don't remember that. If so, you could devise an encryption scheme based on this. That would imply encrypting the Flash content at programming time, during production. That's also largely doable. While not hacker-proof much, this scheme would probably make it hard enough for your average joe to figure out, to be a better protection than potting.

Again, we are talking about making it tough for the average joe here, not about making the device impossible to hack. No approach can do that anyway.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: free_electron on June 29, 2022, 06:22:38 pm
Three key elements to not getting screwed immediately by clones:

1. Don't choose a dishonest Contract Manufacturer. If you choose the wrong one, they'll start undercutting you with your own design! This is bad. It is hard to audit a CM and ensure they're honest, but, believe it or not, most of them are. (It's often the subcontractors that are trouble.)

2. Price your product fairly. No one wants to manufacture it themselves. We'd rather buy it! So price it such that we can justify just buying it. That might mean tiered pricing or all those other horrid schemes. They're awful, but if they keep your product afloat, we all win.

3. Have some key value-add that's difficult to copy, but not in the design itself. Like how it's tested or adjusted/calibrated. Or simply a (believable) guarantee of reliability. This is huge! If I can get the Chinese clone working with 10 hours of labor, that will mean nothing to hobbyists, but everything to professionals who have the money to pay for better.

And if anyone reading this thread still thinks epoxy potting compound actually does anything useful to solve this problem, I have one product name for you: Dynasolve 185.

<- this.

think about it .. What gets copied ? stuff that is way overpriced for what it is. Things with enormous profit margins and high volume

What is there to gain by copying a product if you can make only 5$ a piece with a TAM (total accessible market) of 1000 pieces ?
making 1$ per piece with a TAM of 1 million starts getting attractive...(you need to look at the investment of time and money to do the legwork. )

Note that there is a difference between copying a physical product (hardware needs to be built and sold) and immaterial stuff (software). Copying software is a different can of worms.
Know your product and its place in the market. Who would copy it , in what quantity and what can they make in terms of profit ?

That being said : why on earth do you use a processor where the firmware can be copied by just plonking the external flash in a cheapo programmer ? at least use a processor with on board flash that is locked.
that's giving it away...


Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: mikeselectricstuff on June 29, 2022, 06:29:59 pm
I'm going to guess that your code will use only a small fraction of the available flash. You could obfuscate it by filling the remaining available memory with complex code that never gets called. That won't stop anyone from simply copying the entire mess, but it can make it more trouble than it's worth to uncover whatever it is you're trying to hide.
And if necessary provide proof that someone has copied it.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: Simon on June 29, 2022, 09:19:23 pm
oh and warning, if this is how you plan to do designs don't even think of anything that has to pass EMC testing or your products will all be 90% hacked on bits after to fix the mess you made in the first place to get it past regulatory testing! I take it you have thought about that bit too as you plan to sell it?

However surprising as that may be, I did. I looked into the regulations I had to comply with for the EU market, and as far as I understand, that would be CE and its EMC and RoHS components; and I saw that the CE specifications were... non quantitative. Which on one side I find baffling, and the other, not surprising.

I read the 2014/30/EU directive, and took away that I had to respect the following, write a document and add CE/RoHS on my devices:

1. General requirements
Equipment shall be so designed and manufactured, having regard to the state of the art, as to ensure that:
(a) the electromagnetic disturbance generated does not exceed the level above which radio and telecommunications equipment or other equipment cannot operate as intended;
(b) it has a level of immunity to the electromagnetic disturbance to be expected in its intended use which allows it to operate without unacceptable degradation of its intended use.

2. Specific requirements for fixed installations
A fixed installation shall be installed applying good engineering practices and respecting the information on the intended use of its components, with a view to meeting the essential requirements set out in point 1.

That's it. No seriously that's it.
What to take away from this ? What level qualifies as the one above which radio and telecommunications equipment or other equipment cannot operate as intended ? What electromagnetic disturbance can I expect in the context of its intended use (some guy's bedroom) ? How am I qualified to judge that with a background in mathematics and software engineering ?

From there I see two paths:
- Buy a 100$ EMC tester, test and go "well clearly the level are so low it's not a problem, also it still works when I run it next to my microwave and my CRT, must be good lmao. Also all my components are RoHS, Farnell and JLC said so"
- Respect a harmonized standard. Having looked at previous versions (the 2015 iirc) it's utterly impossible to verify them without highly specialized equipment and asking a lab to test for you costs an arm - by an arm I mean a significant % of the projected gross sales for the lifetime of the device. Oh yeah and, if I understood this correctly, YOU HAVE TO BUY THE LATEST HARMONIZED STANDARD TO EVEN KNOW WHAT YOU'RE SUPPOSED TO COMPLY WITH.

So, yeah. I'm going with the first option so far. I am in good faith doing all I reasonably can to ensure this device is compliant, and the (self-certified) directive - I was previously mentionning I wasn't that surprised - seems to be written to... allow people to do this. I guess the fact you buy what you have to comply with really highlights the fact major companies and individuals aren't held to the same standards.
For comparison, my peers don't even bother with compliance and have been selling to the EU without it (one has self certified the NA equivalent)
As far as I understand, the CE compliance is an obligation of results - also you have to write something to demonstrate you tried. You don't get fined until there's a problem and it's shown your device was not, in fact, CE, and you claimed it was. If you know your device is so basic EMC worries are out of the question (because it's litterally a mcu, a flash, a crystal, basic components and contacts), then you hardly care.

If anyone wants to pitch in on that - though it's not the initial subject - I would welcome it. I've been extremely confused learning about compliance, and I'm trying my best to play by the rules as much as a one man operation allows.

Simple answer: "get a lawyer", that is why test houses exist. They will tell you what the law means and what you need to do, it will cost, and you do it. Yes regulations are a pain in the ass, they never tell you how to do it, only what the outcome should be.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: Simon on June 29, 2022, 09:24:55 pm
Right, it's not sensitive, and I should've been more precise in saying I would get rid specifically of the part that says how exactly I'm making it harder. Or rather, used a fake username so people don't just stumble on this post. My mistake I guess. I didn't think this would cause such a reaction; also, I don't find it very mature to set such a description in stone when I ask how good is [doing exactly this and that to make it harder to hack a device] is before even letting me reply to how I'm not supposed to remove information from others. Figuring out how a device's encryption in place works once you've reached the firmware can be difficult and is a lot less difficult if there's a description of how exactly it works... with these messages this exchange may have caused me more harm than good  :(


Well that explains it all.... no seriously, I have no idea what that says.

Quote

I know damn well security is the RP2040's weakness, but if anyone has a microcontroller with 2 cores at this speed, 2 PIOs with 4 SMs (or equivalent - I make use of all of them) a usb device/host capabilities, that's widely available and was available for the past 2 years, for ~1$, then please enlighten me. A STM32F405 is $11 on JLC and is in stock every now and then.
An atmega32u4 is $10 and is almost out of stock. I'm by no means a professional, I'm a software developer and I've been learning the basics of all the tangential stuff that goes into making a commercial product to be able to turn a better algorithm (that can hardly be inferred from looking at the IO as it's a matter of prediction) in a niche field into a product that will probably only sell a few thousands. And from however little understanding I have, the RP2040 is currently for small fish like me not only a good option, it's virtually the only option and is litterally 5x better than other options I've looked into. I'm dead serious, if you have better proposals, I'm all ears, I'm not happy at all with having to use it. I was dreading the security aspects from day one.

So an atmega32u4 will do it but you picked a 2x133MHz M0+ over an 8 bitter at 16MHz? The new series of AVR are quite nice, PM me if you want some, I have stock.

Quote
Also frankly, I think you're nice merely hiding shit in the epoxy.
My previous ideas involved having the device recognize it's being messed with and have it spoof a keyboard+mouse on plug-in, having it attempt to escape whichever virtual machine it's into by clicking in the common places to do that, and then attempt to do fun things in the terminal such as submitting web searches about the crimes of the CCP.

err, while you ended up boardering on madness the idea or pretending to be another device is not bad at all.

Quote
Anyway I'm sorry this is causing a fight. Call me incompetent because I am, but I didn't find a suitable alternative to the RP2040 in terms of capabilities vs price point and I'm trying to make the best of a bad situation.


No fight, we are just trying to educate you, everyone has to start somewhere, you seem to have bitten off more than you can chew.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: Arte on June 29, 2022, 09:59:45 pm

Quote

I know damn well security is the RP2040's weakness, but if anyone has a microcontroller with 2 cores at this speed, 2 PIOs with 4 SMs (or equivalent - I make use of all of them) a usb device/host capabilities, that's widely available and was available for the past 2 years, for ~1$, then please enlighten me. A STM32F405 is $11 on JLC and is in stock every now and then.
An atmega32u4 is $10 and is almost out of stock. I'm by no means a professional, I'm a software developer and I've been learning the basics of all the tangential stuff that goes into making a commercial product to be able to turn a better algorithm (that can hardly be inferred from looking at the IO as it's a matter of prediction) in a niche field into a product that will probably only sell a few thousands. And from however little understanding I have, the RP2040 is currently for small fish like me not only a good option, it's virtually the only option and is litterally 5x better than other options I've looked into. I'm dead serious, if you have better proposals, I'm all ears, I'm not happy at all with having to use it. I was dreading the security aspects from day one.

So an atmega32u4 will do it but you picked a 2x133MHz M0+ over an 8 bitter at 16MHz? The new series of AVR are quite nice, PM me if you want some, I have stock.


No, it won't do. I'm using both cores and all 4 PIOs, though I might be able to make do with one core at least as fast with some more complicated orchestration of tasks if I give up on some features (particularly dreading the loss of the PIOs - it's almost like I have 6 real time threads right now which lets me not mind interrupts whatsoever...) . I was just pointing out how fucked the situation was while I was developing this, that the MCU in the Arduino Micro would be $10. My first go at it used a STM32F407VET6, and I was dreading having to do what I ended up doing very easily and reliably with the PIOs, and at that point, it cost $3 on JLC.
Now it costs $14. And it wasn't in supply for the longest time anyway.

For context the whole board now costs a few dollars. So, someone was mentionning business 101 earlier, when looking at my options, the RP2040 just blew all the others extremely bad. Yes, I lose on security, but I had to lose on something, and between no internal flash and several dollars extra per board for a niche product, the decision was very quickly made. Now just because I've gave up on good security doesn't mean I wouldn't like to try to make it harder for the potentially malicious average joe to mess with it. I thought potting was a good addition; most people here say it's not and I thank you for your input.
I'm not hellbent on security or I wouldn't have given up conventional (internal flash, security bit, etc) security in the first place. I always knew and accepted this was the huge downside of the RP2040. Doesn't mean I don't want to make it as hard as I can reasonably make it given the circumstances.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: Simon on June 30, 2022, 05:44:15 pm
well yes things are hard right now supply chain wise. I went for an MCU that was definitely not used on the arduino and didn't seem to have a great following, why try to compete with the masses for stock? and still I would not get any more for 18 months if I ordered today.
Title: Re: What potting compound to use to protect from reverse engineering ?
Post by: SiliconWizard on June 30, 2022, 06:14:32 pm
Times are tough indeed when it comes to getting ahold of semiconductors.
And with the uncertainties and rampant inflation, the incentive for people to just counterfeit products is getting IMO higher than usual, so I can understand the OP's concerns.