Shop OBEX P1 Docs P2 Docs Learn Events
Keeping my propeller code mine? - Page 2 — Parallax Forums

Keeping my propeller code mine?

2

Comments

  • Zap-oZap-o Posts: 452
    edited 2010-06-18 17:42
    smbaker

    You could. The problem is that you wont / should not be able to run the code (as intended) stored after the decrypted address. Because it was scrambled from the computer.

    First make a binary file using the propeller tool then take that file and encrypt it. Then load it to the 24LC256 address located after the decrypter program.
  • RaymanRayman Posts: 14,889
    edited 2010-06-18 17:50
    I wonder if you can use ideas from PKI to do it... Maybe you could use Chip's "real random" object as a basis to create random public and private keys.
    Send the public key to an external, protected-code PIC that encrypts desired code with the public key and sends to the Prop.
    The Prop then uses the private key to decrypt and execute...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Apps:· http://www.rayslogic.com/propeller/Programming/Programming.htm

    My Prop Info: ·http://www.rayslogic.com/propeller/propeller.htm
    My Prop Products:· http://www.rayslogic.com/Propeller/Products/Products.htm
  • John AbshierJohn Abshier Posts: 1,116
    edited 2010-06-18 17:57
    Locks, physical or software, keep basically honest people honest. If someone wants to steal code and is willing to invest required resources, they can break any copy protection. If I buy your product I have a copy of the key. If your drawing is correct and the key is only 16 bits, then a brute force attack is trival. If the key is 128 bits as mentioned on a previous post, then brute force is not viable. But you have to send the key to the Propeller, I think I would try to attack by capturing the key as it is sent to the propeller. A good product at a reasonable price (a reasonable price can be quite large) with good support will be successful. Spend you time getting to market ahead of the other guys and developing the next version or next product. You could embed a unique serial number in each unit and record who it was licensed to. If a software audit showed duplicate serial numbers, that would be evidence of copying.

    John Abshier
  • heichheich Posts: 26
    edited 2010-06-18 18:09
    Maybe this can help?

    datasheets.maxim-ic.com/en/ds/DS2401.pdf

    Regards

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Are you looking for a professional PCB/Schematichs software?

    Kicad: GPL. You can do Schematics, PCBS, Gerber interfaces, 3d-views and more
    www.lis.inpg.fr/realise_au_lis/kicad/

    Search in Parallax Forums Using Google
    www.google.com/advanced_search?q=+site:forums.parallax.com&num=20&hl=en&lr=
  • Zap-oZap-o Posts: 452
    edited 2010-06-18 18:13
    John Abshier
    Damn you are right!

    looks like my idea is a bust...
  • BigFootBigFoot Posts: 259
    edited 2010-06-18 18:18
    I agree with Phil,

    The best way to protect your products is to keep developing new ones. By the time
    someone reverse engineers one you have released another.

    Russ
  • smbakersmbaker Posts: 164
    edited 2010-06-18 18:26
    Rayman said...
    I wonder if you can use ideas from PKI to do it... Maybe you could use Chip's "real random" object as a basis to create random public and private keys.
    Send the public key to an external, protected-code PIC that encrypts desired code with the public key and sends to the Prop.
    The Prop then uses the private key to decrypt and execute...

    Once it's on the prop and in plaintext, it can be attacked (trivially via the emulator example). By extension, if there exists a mechanism for getting the plaintext onto the prop, then the mechanism can be attacked.

    I do recall research from some years back where only very small chunks of code where decrypted at a time. For example, using the protected PIC decrypt a sliding windows of one basic block of bytecode and send only that block to the prop. When the prop finishes executing that block, decrypt the next block and send it over. One could imagine all sorts of tricks employed, for example the protected PIC could understand program flow and refuse to decrypt blocks out of order. Attempting to decrypt a block that would not normally be executed could instruct the PIC to self-destruct (old-style satellite TV cards used to do this; the head office would send a code that essentially meant "if you can decrypt this, burn yourself out"). It would still be just an obfuscation technique though; a determined hacker could and would eventually get all of the plaintext.

    One only has to look at the problems locking down PC software to realize that it's a problem that has no good solution without hardware support. Serial numbers / key algorithms are usually reverse engineered relatively quickly by the hackers and keygen programs released, often times even the same day the software is released. The only solutions that really worked reasonably well used hardware dongles with the application code heavily obfuscated and instrumented to frequently check the dongle and fail if it was detected.

    As John Abshier said, it's all a matter of keeping the honest people honest.
  • RaymanRayman Posts: 14,889
    edited 2010-06-18 18:37
    smbaker said...

    Once it's on the prop and in plaintext, it can be attacked (trivially via the emulator example).
    True.· Never mind.· I guess there is no way to do it without something burned into the Prop...

    I suppose epoxying the Prop and·some other chip·together is the only way to do it...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Apps:· http://www.rayslogic.com/propeller/Programming/Programming.htm

    My Prop Info: ·http://www.rayslogic.com/propeller/propeller.htm
    My Prop Products:· http://www.rayslogic.com/Propeller/Products/Products.htm
  • whiskypapa3whiskypapa3 Posts: 3
    edited 2010-06-18 19:36
    You could always use one of Dr. Whisky's 'Write Only" EEproms. I have a cigarbox full of them if you need some samples..

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Geezer Power!!
  • hover1hover1 Posts: 1,929
    edited 2010-06-18 20:10
    Just for a second, I thought "Mark, is that you? Trying to protect Dr. Jim's amazing Servo Controller Software"
    But alsa..no.
    Zap-o, It's looks like you have put a lot of work into your code, and I hope you work the protection out. I just brought this up as a little humor that seasoned forum user might like. MIT selling 16 servo controller software, when 32 servo software is available in the OBEX, for free!
    Sorry for the OT, but I couldn't resist. tongue.gif
    Jim
    Zap-o said...


    @ John - my code is almost a year of mathematical equations derived from myself and a scientist, people are lazy and could so easily copy. My code is special just because of the time I put in to it and I think protecting it to some minimal degree should be a natural reaction.

  • heaterheater Posts: 3,370
    edited 2010-06-18 20:47
    If you really have a Propeller code mine why bother protecting some little bits of code?

    Just give out the code for free or the binaries with your hardware product. You can always go back to the code mine and get some more code[noparse]:)[/noparse]

    But seriously, protecting code on the Prop has been talked to death here over the years. It can't be done in anyway more effectively than hanging a "No Entry" sign over your open front gate.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • WBA ConsultingWBA Consulting Posts: 2,935
    edited 2010-06-18 21:40
    You could always pot the assembly after it is built. Only those who would hack into it no matter what would give it a second thought. The enclosure in the picture actually contains a controller PCB and an RFID antenna PCB. (the potting is mid-cure, hence the wavy wet look areas)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Andrew Williams
    WBA Consulting
    WBA-TH1M Sensirion SHT11 Module
    My Prop projects: Reverse Geo-Cache Box, Custom Metronome, Micro Plunge Logger
    1707 x 886 - 628K
  • heichheich Posts: 26
    edited 2010-06-18 21:49
    Andrew

    ¿Wath did you use to encapsulate that box?

    It looks like... a mixture of polyester resin and finger perspiration?

    Regards

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Are you looking for a professional PCB/Schematichs software?

    Kicad: GPL. You can do Schematics, PCBS, Gerber interfaces, 3d-views and more
    www.lis.inpg.fr/realise_au_lis/kicad/

    Search in Parallax Forums Using Google
    www.google.com/advanced_search?q=+site:forums.parallax.com&num=20&hl=en&lr=
  • hover1hover1 Posts: 1,929
    edited 2010-06-18 23:06
    Problem is, a hot air gun,·dental pick and an hour will yield the secret components.

    Not that I've ever done that. tongue.gif

    That was with 3M potting components. Others may be harder to crack.

    Jim
    WBA Consulting said...
    You could always pot the assembly after it is built. Only those who would hack into it no matter what would give it a second thought. The enclosure in the picture actually contains a controller PCB and an RFID antenna PCB. (the potting is mid-cure, hence the wavy wet look areas)

  • localrogerlocalroger Posts: 3,452
    edited 2010-06-18 23:47
    I like Holly's idea, though it would be time consuming. It is indeed possible to completely disable an EEPROM and to do it one byte at a time. I know this because a competitor of ours once stored the count of trucks passing over a highway scale in such an EEPROM, updating it as each truck passed. Problem was, this scale saw about 1,200 trucks a day and with that part it meant failure every 6 months. The counter would simply stop counting one day -- the chip couldn't write a new value to it. Everything else in the system worked, and replacing the EEPROM solved the problem. (Our competitor was charging the state $800 for a new PCB each time this happened. We charged them $1.20 plus the service call time and travel.)
  • James NewmanJames Newman Posts: 133
    edited 2010-06-19 00:11
    Remove the eeprom, add a battery and ship with code already loaded. You would need the prop to go into the lowest current draw when "off" and wait for an "on" switch before restarting all your cogs and bumping the speed up. An easy way to swap batteries without disconnecting power will be needed, (Power supply on while swapping, secondary battery parallel, super cap, etc.) along with a low battery alarm. If a customer looses the program, they will need to send you the unit to reload. If the unit is large, make the battery and prop sit on a removable board or something. You could leave the eeprom with a program that would load all outputs into a failsafe mode, and displays to the user that they need to have it reloaded. If a battery charger can be built into the unit, that would be ideal.

    I repair cnc machines for a living, and most use batteries to retain parameters and data. I bet they wish it was as cheap a small board that could cost less than $10 to replace, maybe $60 or so to overnight-early am ship it...

    The customer/application will ofcourse be down longer than if the program was stored on eeprom and could simply be reset... but companies tend to stick it to the paying customer to (fail to) prevent the few pirates anyway...
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-06-19 01:31
    Ignoring for a moment the obvious practical issues, James Newman's idea is the only one I've seen yet that could provide a modicum of security -- that is, unless there's an undocumented reset/bootload mode built into the Prop that doesn't clobber the RAM and allows it to be read back out.

    -Phil
  • $WMc%$WMc% Posts: 1,884
    edited 2010-06-19 02:52
    Have You looked at what Bill Gates went through with windows?

    Bill spent a lot of time and money trying to hide his code.

    First the US Government and the Monopoly gimmick. After that Linux(the euro free Smile) Then Apple Mac.

    I see MAC running commercials, trying to make Bill look bad and stupid. I think the one with the Billions of Dollars is the smarter one.(just my opinion)

    The problem Bill faced was:Is this code that good that I should let it consume me to hide it. (and spend millions to do it), or should I just move on to write something better?(and make Billions)

    decisions,decisions,decisions

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Truth is out there············___$WMc%___···························· BoogerWoods, FL. USA


    want speed?·want·to use the Propeller?·want to stay with BASIC___www.propbasic.com___


    You can feel stupid by asking a stupid question or You can be really·stupid by not asking at all.

    ·
  • James NewmanJames Newman Posts: 133
    edited 2010-06-19 03:22
    I think $WMc%'s point is that people won't steal your software, they'll simple write better... [noparse];)[/noparse]

    Now I feel the need to show some linux attitude... so you should opensource your software! I'm so glad that people like Issac Newton and the like didn't make their formulas proprietary... to the contrary they published them. Mankind can not even begin to comprehend how much technology is stifled by "intellectual property".
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-06-19 03:22
    Grind the name of the chips, pot them, and don't tell anyone what's inside. That will delay them for a start. But seriously, there is no real way to prevent it on most micros with electron microscopes. The Russians did that to the Z80, so it depends on your market, and how much you overcharge for your product.

    Just look at the DVD movie prices now. It is hardly worth the trouble so more people would rather be honest. There will always be the one who wants it for free.

    PS. Don't tell anyone you have protected it, or you will open up a game to break it! No-one bothered with breaking the Spin Interpreter until Chip put out the challenge. Sure, some wanted to know what functions were there, but not actually break the code.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
    · Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz

    Post Edited (Cluso99) : 6/19/2010 3:27:03 AM GMT
  • James NewmanJames Newman Posts: 133
    edited 2010-06-19 03:42
    Yet another side note: I've come across a few boards with all the chip markings filed off, and quite simply it sucks. If/when your company goes under, or stops supporting this product, it may still need service.

    In my line of work, I care nothing for trying to steal the ip of these boards. I simply want to get a machine running again so that our customer can use the machine that belongs to them. It might not be so bad if companies never shutdown, or supported everything they ever made... but that's not the case.

    The good companies let you buy the schematics, documentation, etc for your machine.

    I repair boards that cost thousands of dollars, most of the time with a few hours of work and some cheap chips. When schematics aren't provided my chances go down and my time spent up. When I have no documentation, no software, and the chips are filed down... the customer buys a board. (If we can find one.)

    Lol, just a few months ago I ripped the entire control electronics out of a brandnew never used gundrill. The reason was that siemens wanted to charge something like $20k to modify the software slightly to allow it to face the back of the stock. Including labor, parts, etc it cost about the same, but now their machine does what it needs to, and they have better support.

    Just some things to think about... [noparse];)[/noparse]
  • SkyKitSkyKit Posts: 9
    edited 2010-06-19 03:56
    Zap-0

    Most of the time, skilled - well trained·engineers will not copy your code, they are plenty of projects to make money honestly. People·who use to steal someone's code is who can't write their own code, neither dissasembly or create a propeller emulator.

    This is my experience. I have some microcontroller (not propeller) based products on the market. I have about 4 loyal competitors, all of then creates its own·products and none of us have copied the other's products. But there is a fifth who, among others, copied one of my outdated designs's code burned inside a protected PIC microcontroller.··He marketed the copy with small hardware changes and·he use my own tools to configurate "its" product.

    He'll never can dissasemble the code to upgrade nothing. He just sell the product in a small niche that do not demand recent features added to new versions of my products.

    After that, all of my new designs incude a MAxim DS2401. You can use the encription or the battery it is feasible to your product and you can be confident that if·you atract one·thousand copiers, maybe one of them is cappable of dissasemble your code and bypass your protection and that guy, likelly do not want to deal with IP lawyers and ,likelly again, will write his own code to sell its products freely in·the market.
  • HollyMinkowskiHollyMinkowski Posts: 1,398
    edited 2010-06-19 15:54
    Zap-o said...
    Perhaps I need to design a PIC chip to keep the memory for the propeller?

    Every time I get a few spare minutes I do some work on a
    project of mine. It combines a prop with an ATmega1284p
    and I have been wondering just how hard it would be to load
    the prop from 32kb of the mega's 128kb flash. This would
    eliminate the cost of the eeprom and also add a bit of protection
    for the prop's code. I would have to make the mega look just
    like a 32kb eeprom at boot, might have to bring up the mega
    first and let it control the 3.3v to power up the prop.

    But, it's always possible to simply read the I2C data as it flows
    to the prop....so the data is always exposed by this.

    I wish the prop had internal eeprom or flash... I really really do!
  • potatoheadpotatohead Posts: 10,261
    edited 2010-06-19 16:26
    Given what's been written on this topic, I'm curious about the devices with protection that is acceptable. What means are used? Seems to me, a few hundred dollars gets the code no matter what! How is that protection seen as acceptable then?

    It's too bad we don't have more of a handle on quantum effects. A Schrodingers Cat type device would be handy here. If it's unobserved, it's state is unknown, preventing some self-destruct hardware from operating. Once observed, it is known, and poof! [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!
    8x8 color 80 Column NTSC Text Object
    Wondering how to set tile colors in the graphics_demo.spin?
    Safety Tip: Life is as good as YOU think it is!

    Post Edited (potatohead) : 6/19/2010 4:31:34 PM GMT
  • HollyMinkowskiHollyMinkowski Posts: 1,398
    edited 2010-06-19 16:42
    @James Newman

    That idea, of using a super cap to keep a prop alive a
    long time while running at low speed is one of the reasons
    I just bought two 400 Farad super caps to play with.

    I figured the same thing, that I could load the prop and just
    remove the eeprom from the board. It seems to me it would
    be devilishly difficult to get the contents of the prop memory
    from it while it was kept running wink.gif

    I keep trying to decide if I should spring for a 4000 Farad cap.
    I saw them at Mouser for about 250.00 ... that's an awful lot
    of money for a single 2.7v cap.

    Of course, a pak of 4 D-cell sized alkalines wired to deliver 3.0v
    would keep an idling prop alive for a long time. But you would need
    to deliver two battery packs to the end user, and instructions
    on how to quickly change packs while a backup cap kept the
    prop alive.

    The super cap could just recharge quickly whenever the
    board had power, a rechargeable lion pack might do the same but
    I wonder how long a life such batteries have.
  • HollyMinkowskiHollyMinkowski Posts: 1,398
    edited 2010-06-19 17:16
    @James Newman
    "Yet another side note: I've come across a few boards with all the chip markings filed off, and quite simply it sucks"

    I wonder if there exists a device that you can attach to a chip
    and have it analyze it and tell you what it is?

    Perhaps it could do resistance readings, inject low level signals and see the
    results..etc

    I use a probe that you press against the contacts of a sm device
    and it tells you if its a resistor or cap and tells you the value..so
    something like that only much more sophisticated.
  • LeonLeon Posts: 7,620
    edited 2010-06-19 17:19
    James Newman said...
    I think $WMc%'s point is that people won't steal your software, they'll simple write better... [noparse];)[/noparse]

    Now I feel the need to show some linux attitude... so you should opensource your software! I'm so glad that people like Issac Newton and the like didn't make their formulas proprietary... to the contrary they published them. Mankind can not even begin to comprehend how much technology is stifled by "intellectual property".

    Actually, Newton sat on his work on the calculus for some years, and when Leibnitz published his own findings, falsely claimed that Leibnitz had stolen his ideas.

    XMOS has a good protection technique to get round a similar problem with external program memory (flash rather than EEPROM) being required - 8k of on-chip OTP memory and encryption instructions in the instruction set. I've heard that at least one company is selling XMOS chips with their own markings on them, as if they were their own ASICs. They are probably using that built-in copy protection.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM

    Post Edited (Leon) : 6/19/2010 5:32:10 PM GMT
  • HollyMinkowskiHollyMinkowski Posts: 1,398
    edited 2010-06-19 17:24
    Leon, I saw a documentary (British) a while ago about Newton.
    He was a strange guy, into alchemy and all sorts of strange stuff.

    Interesting that Newton and Leibnitz both had the same idea to
    create calculus at about the same time. This seems to happen often.
    It's like an ideas time has just come and so it is just floating around
    out there for smart people to pick up on.
  • LeonLeon Posts: 7,620
    edited 2010-06-19 17:34
    I saw that program, but I knew of the controversy a long while ago. Interestingly, it's Leibnitz's notation that we mostly use today, although Newton's notation with a variable having one or more dots above it is still sometimes used for differentiation wrt time.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM
  • PliersPliers Posts: 280
    edited 2010-06-19 17:56
    If you waste pin 30. Perhaps by applying a killer voltage to it (pin 30).
    Could someone still read the EEprom?

    I should have done some research.
    I don't think the EEprom is in the prop chip.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    1110001110001110110101010000111110001110001110010101011

    Post Edited (Pliers) : 6/19/2010 6:11:19 PM GMT
Sign In or Register to comment.