#avr Logs

Nov 23 2019

#avr Calendar

01:04 AM Thrashbarg: djph: there is a version that's supposed to compile under CP/M, just FYI :P
05:54 AM djph: Thrashbarg_: nice
06:35 AM Thrashbarg_ is now known as Thrashbarg
10:56 AM rue_bed: --
11:42 AM nohit: --
11:45 AM rue_mohr: cool, I queried the teapots runime and it had 8 minutes left
01:53 PM uniqdom: Hello, I'm developing a code for a microcontroller for a company. I'm going to be paid for every firmware programmed. I can influence the board design. This company is going to sell the board to final clients. I will enable the protection bits so they can't read the flash of the MCU. I know it can still be circumvented. What else can I do?
01:54 PM uniqdom: The system has to report json data to a server. Those strings are in my firmware. I'm thinking in encrypting those strings and having the decryption key in a secondary microcontroller based in its unique ID.
01:55 PM uniqdom: So every firmware will be different and associated to a single secondary mcu.
01:55 PM uniqdom: do you see any problem with this plan?
02:06 PM rue_mohr: heh
02:06 PM rue_mohr: the product will probably sell better if its hackable
02:06 PM rue_mohr: usually products do quite well after their death on the market
02:06 PM rue_mohr: take the pixel purse
02:07 PM rue_mohr: untill everyone started liquidating them, they were worthless
02:07 PM rue_mohr: the hacker community got ahold of them and they have never been in more demand
02:11 PM cehteh: yep i wont wory overly much
02:11 PM polprog: depending on the agreement you might have the right to lock the mcus, but you may also have to give the source files to them
02:11 PM polprog: imo not worth the hassle, and what rue said
02:12 PM polprog: if they want more, they will ask you and if they wont wanna to cooperate with you they would hire someone else to rewrite the firmware anyway
02:12 PM uniqdom: they aren't paying me for the code being developed, only per firmware being programmed. So, I don't want them to move me out of the business. Final clients could still be trying to do the same thing.
02:12 PM cehteh: maybe he is more worried about competitios/chinese cloning it
02:12 PM polprog: ah
02:12 PM polprog: the chinese guy will have his own server anyway :p
02:12 PM polprog: with his own protocol
02:13 PM cehteh: and reprogram the thing cheaper
02:13 PM polprog: they can solder in a new mcu anyway
02:13 PM cehteh: lockbits should be good enough, encryption may only work when its asymetric and hard .. which in turn wont work on AVR's
02:14 PM polprog: yeah, dont implement your own encryption
02:14 PM cehteh: you can erase the avr anyway and put new firmware on it
02:14 PM polprog: im sure hvsp/hvpp can circumvent these
02:14 PM polprog: and, if anything elae fails
02:14 PM polprog: else*
02:14 PM polprog: there will always be that one guy who spends years reverse engineering set top boxen
02:14 PM cehteh: i just checked yesterday, services offering extracting firmware from locked mcu for approx 500-1500 $
02:15 PM polprog: not much if you plan to fab thousands
02:15 PM cehteh: then they end up with a binary blob they could use to sell cloned devices
02:15 PM polprog: or RE that
02:15 PM cehteh: but reverse engineering and adding features/encryption /whatever will costs considerably more
02:15 PM cehteh: i mean the blob
02:16 PM polprog: yeah
02:16 PM cehteh: for 1500 you can prolly get some simple things programmed in india or china .. anew
02:18 PM cehteh: also any reasonable encryption/protection will cost you or your client most likely more than 1500
02:19 PM uniqdom: but if the key is based in the serial number of the secondary mcu, a firmware extraction will not work.
02:19 PM cehteh: i'd rather try to go into the other direction, try to make it open as much as possible so that it becomes nonprofitable for anyone else but you and your client
02:19 PM cehteh: it will work
02:21 PM cehteh: sell good hardware/service to competive prices, maybe lockbits set but be prepared that someone may clone it, you can either delay that by making it hard (will cost 10k$'s) so you get the initial profits .. or make it as cheap and open that cloning it wont gain much profit to the one who clones it
02:30 PM Maya-sama is now known as Miyu
02:30 PM Miyu is now known as hackkitten
02:32 PM nohit: uniqdom: re-negotiate your deal
02:33 PM nohit: seems shady
02:34 PM nohit: of course they have to pay for the code
02:34 PM cehteh: about encryption: its really simple, when you put the key under the doormat (aka the attacker has access to it) then its broken
02:35 PM cehteh: if its the serial of the 2nd mcu .. do you give the 2nd mcu to the client? -> broken
02:36 PM uniqdom: yes, it's a bad design.
02:37 PM cehteh: AVR's are not capable of doing any serious encryption, no asymetric, not even symetric, well maybe they can do that, but slowly and with lots of resources
02:37 PM uniqdom: they would have to retrieve the firmware and also reverse engineer to know that the ID was the key.
02:37 PM cehteh: thats almost trivial
02:38 PM cehteh: actually they dont even need to know that they only need to flip one bit in the firmware blob
02:38 PM cehteh: the one where you banch on key checking
02:38 PM uniqdom: what do you mean[?
02:38 PM cehteh: its really futile
02:39 PM uniqdom: I can't understand that
02:40 PM uniqdom: how could a bit change replace an encryption key?
02:40 PM cehteh: no idea what you want to do. but you ship the key, its over, no discussion needed
02:40 PM uniqdom: yes. I grant that to you.
02:41 PM cehteh: any effort you put into that is wasted
02:42 PM cehteh: what you could do is that people need some way to log into the server, then at least as long you in control of the server you can ensure that only one login per account is active at a time
02:43 PM cehteh: some halfway secure challenge reponse auth where you dont transefer secrets in plain might be doable
02:43 PM uniqdom: the server is going to be a public iot server or owned by the clinet
02:43 PM cehteh: the customer need to know his creds, there are no secrets
02:43 PM cehteh: yeah
02:43 PM cehteh: that may work ... but someone else may clone the servers as well
02:44 PM cehteh: anyway i am more about doing this in some open source way
02:45 PM cehteh: sell the hardware to fair prices, have some subscription fee to access the servers, actually it would be cool if the billing thereof would be public as well, then people can see that the servers wont go out of business
02:45 PM cehteh: but thats your client to decide
02:46 PM cehteh: there are so mayn iot startup who failed and leave peole stranded with non working devices, actually thats why i would never ever buy this proprietary crap
02:47 PM cehteh: if i know someone hosts servers but they are open source and i could host them as well, but its like$15/year hey then i wont do it by myself, not worth the efforts
02:47 PM cehteh: but at least i could if that business fails
02:55 PM nohit: he's not selling any hardware
02:55 PM nohit: can't you guys read
02:55 PM cehteh: his client does
02:55 PM nohit: he's doing design work for a company
02:56 PM nohit: with a very shade deal
02:56 PM cehteh: yes
02:56 PM cehteh: i'd rather opt for payed per hour
02:57 PM cehteh: and make some agreement whats possible in sense of firmware protection, anything beyond setting lockbits is a) very expensive b) futile
02:58 PM cehteh: design some safe protocol where the end users have credentials to log into the server (that may just be the serial# of the mcu)
02:58 PM cehteh: well :)
03:16 PM nohit: probably got fed up with your stupid aswers. not the first time when people come here to ask about A, and you give answers about B
03:17 PM cehteh: :D
04:25 PM LFSVeteran: /opt/avr/lib/gcc/avr/8.2.0/../../../../avr/bin/ld: cannot find crtattiny85.o: No such file or directory
04:26 PM LFSVeteran: how can I tell avr-gcc where to look for crtattiny85.o?
04:28 PM Igloo: What command are you running?
04:29 PM LFSVeteran: avr-gcc -L/opt/avr/avr/lib/avr25 -Os -DF_CPU=8000000L -mmcu=attiny85 -c -o avr.o avr.c
04:29 PM LFSVeteran: avr-gcc -L/opt/avr/avr/lib/avr25 -mmcu=attiny85 avr.o -o avr
04:29 PM LFSVeteran: first command goes well
04:29 PM LFSVeteran: second one gives the error
04:29 PM guanche: guys, has anybody ever made a high-voltage parallel programmer, and found that setting the low fuse bit changes the extended bit to the same value?
04:30 PM LFSVeteran: high-voltage programmer...a long long time ago...sorry
04:31 PM guanche: I've been pulling my hairs out for over a week with this
04:31 PM Igloo: That looks similar to what I use. Do you have a crtattiny85.o somewhere? Mine comes from an 'avr-libc' package
04:32 PM guanche: and today I noticed, while reviewing fuse-doctor's pcb, the guy tied the top-most right pin of the DIP-40 package to ground
04:32 PM LFSVeteran: yes it resides in /opt/avr/avr/lib/avr25
04:32 PM LFSVeteran: so how to point to that directory
04:32 PM LFSVeteran: for libraries you can use -L
04:40 PM LFSVeteran: igloo: do you have something similar? https://pastebin.com/raw/6Ugx6Jzn
04:49 PM nohit: is attiny85 one of the new chip ?
04:49 PM nohit: +s
04:50 PM nohit: if it is, you need a atmel pack for it
04:51 PM nohit: http://leonerds-code.blogspot.com/2019/06/building-for-new-attiny-1-series-chips.html
04:51 PM LeoNerd: That's not for a tiny85; those are oooold
04:52 PM LFSVeteran: the tiny85 is a quite time around
11:11 PM day__ is now known as day