How can I prevent unautorized person from dowloding software in my chip

Started by sanketbarot, September 13, 2007, 09:03:05 PM

Previous topic - Next topic

sanketbarot

Hello friends...


I am searching the solution for, How can I prevent unauthorized person from dowloding software in my chip...
I am using 89V51RD2BN.. so when I will reset he chip chip always wait for U responce and then go for User code..

so how can  prevent unautorized person??????

sanketbarot

Hi..
I have just read the serial number option..
Does it mean that once I will program the serila number nobody other than who knows the serial numerbcant peroform the ISP and if security bit is programmed then even parallel programming.

Only one can do is Erase the entire chip.

but when I write a serial number still can I perfor the IAP and what prcaution should I take when programming serial number....

Or is there any other method...

Jan Waclawek

If I understand you right, you want to prevent further ISP programming altogether.

If this is the case, you should perhaps update the bootloader to the newest V7 (not on NXP website, but on the main flashmagic website) and then set to "run user code" - in that way, only parallel programming is possible.

If this is not what you wanted, please describe more clearly.

JW

sanketbarot

Ya you are some what right..

I dont want that unauthorized person can not perform ISP.. but my other requirement is that autorized person can peform the ISP. if i got properly then if i use the nwe bootloader then even autorize person can not perform the ISP...

So wht can be the solution.


Jan Waclawek

But, what exactly do you want to prevent the unauthorised person to do?
If the password is not set, he cannot do anything (except autobauding) if he does not know the password, can he?

JW

sanketbarot

See once i have programmed the IC I have send it to the filed...

So Now I want that unautorized person should not have access to perform ISP....
but if there is a bug and once i have corrected it then my authorized person have access to perform the ISP..

For Ex. Suupose I program a serial number then.....
My autorized person can perfrom the ISP by knowing the serial Number..
But unautorized can't perform the ISP unless resetting the serial number. but once it will be reset unautorized can perform ISP...
So I think this would be not the perfact solution....

So other can be  I have to control x/Tx lines ....etc..

Like that Is there any solution like unautorized person can't perfor the ISP....



Jan Waclawek

Quote from: sanketbarot on September 17, 2007, 05:38:18 AM
My autorized person can perfrom the ISP by knowing the serial Number..
But unautorized can't perform the ISP unless resetting the serial number. but once it will be reset unautorized can perform ISP...

Your authorised person does not need to reset the serial number, it's enough to get the serial number verified. (Or, alternatively, after having reset it, he can write it again).

But, of course, once he knows it, he can reset it, too, leaving the device "open". But then, if you allow your authorised person to  reprogram the device, you are giving him the hexfile anyway, so he must have some degree of confidence from you.

Of course higher levels of protection can be established, too; but you then need to either rewrite the default bootloader (it's possible as it is in Flash, too); or to write your own, using IAP. You can then go even for encryption of the hexfile etc., all sorts of paranoia... :-)

JW

sanketbarot

hi...

1) Where can I get information about bootloader. i.e. How to write my own bootloader and how to program it etc......
2) How can I write my own IAP.
3) what does mean encryption of the Hex file..

Where can I have information about all this data..
Now I am very Excited to know all this thing....

erikm

every time I see a thread like this a proverb comes to mind:
"thief think everyone steals"

I see no reason to 'protect' object code.  It is, at least, 5 times faster to recreate code from scratch that trying to do it from a disassembly.

Erik
erik

Jan Waclawek

Quote from: erikm on September 18, 2007, 06:18:43 AM
I see no reason to 'protect' object code.  It is, at least, 5 times faster to recreate code from scratch that trying to do it from a disassembly.
Ooooh, you are very mistaken, sir.

But let's not discuss the topic in all it's width, we did this so many times. Let's just concentrate on this very case.

Consider the following:
1. I make product A consisting of some hardware H, a microcontroller M and firmware F. I sell it to X, Y and Z for $$$.
2. Having earned some money, and being enthusiastic enough, I work on improvement of firmware and produce firmware F1. It took me some time to arrive at this moment, so I want to reclaim some of my expenses. I decide to sell the upgrade firmware for $$ and expect that at least X and Y will buy it; that's 2$$ to pay my bills.
3. X buys the upgrade (binary) for $$, but he knows Y and Z well and sells them the upgrade for $ each.
4. X starts cloning the hardware into H', to sell for $$ apeace to P, Q and R; with the fresh new upgrade F1 bundled. I sell no more hardware H for $$$ nor upgrade F1 for $$, and have no hope of future sales even if I produce improved firmwares F2, F3 etc., as they get cloned as easily as F1 did.

JW

Jan Waclawek

Quote from: sanketbarot on September 17, 2007, 09:01:12 PM
hi...

1) Where can I get information about bootloader. i.e. How to write my own bootloader and how to program it etc......
2) How can I write my own IAP.
3) what does mean encryption of the Hex file..

Where can I have information about all this data..
Now I am very Excited to know all this thing....
This is an extensive topic and you shall do your reading.

1. The details on how to reprogram the boot block (block 1) are not published by NXP. I worked it out based on the similarity with a SST chip (I dare to say, it's the same chip). Please go through the archives here and on 8052.com to get the details. But, this is maybe the longest way to go. First, I'd recommend to start with familiarising with the IAP interface provided by the default bootloader - see the datasheet. Learn to reprogram a single sector (128 bytes) in the user block using the IAP, first.

2. How to write a bootloader in general: you need to establish a protocol (or simply take the same protocol as the default bootloader uses), write a receiver for the packets, process the received packets, program (burn) data accordingly (see item 1 above), transmit response. Optionally, perform autobauding at the start (not necessary for an application with fixed crystal frequency).

3. When you mastered item 2 above, you can try to encrypt the transmitted data - for inspiration, read appnotes "DES bootloader" and "AES bootloader" from Atmel. Although AVR-specific, the underlying principles that apply for any microcontroller, are well explained there.

JW

sanketbarot

Thank you,
Mr. jan I will check it out

And Mr. Erik, its not like sombody is going to steal my code. but I dont want unauthorized person to access my unit without my permission, because on the feild what is going on we may be not aware of that and we come to know only when problems occur. so By every mean I am trying to protetc my unit from unauthorized person access.

sanketbarot

I Have used the IAP functions given in the datasheet. but I have used it to program 2 or 3 bytes.

But as you have suggested I will check it out how can I convert it in to bootloader.



thank you