View previous topic :: View next topic |
Author |
Message |
scanan
Joined: 13 Aug 2004 Posts: 58 Location: Turkey
|
LIB in CCS |
Posted: Thu Dec 18, 2014 4:01 am |
|
|
Hello,
I would like to know if it is possible to make library file like "lcd.lib"
and include while compiling.
I want nobody see the library code. I think mikroC compiler is doing this.
Is it possible in CCS?
cheers _________________ Dr Suleyman CANAN
R&D Electronic Engineer
https://suleymancanan.wordpress.com
Do whatever you do with amateur spirit -
But always feel professional. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9229 Location: Greensville,Ontario
|
|
Posted: Thu Dec 18, 2014 12:49 pm |
|
|
I have to ask 'why ?'
If you're concerned about a 'library' of functions you can easily encrypt them. When 'main' is run, it decrypts them, saves into flash and runs them from there.
Frankly most 'functions' can be easily duplicated. Things like LCD drivers, I2C devices, etc. are 'generic' by nature and very well documented.
That's why I asked 'why'. Heck, even code within a PIC can be 'extracted' given time and money.
Jay |
|
|
ELCouz
Joined: 18 Jul 2007 Posts: 427 Location: Montreal,Quebec
|
|
Posted: Sun Dec 21, 2014 6:31 pm |
|
|
temtronic wrote: | I have to ask 'why ?'
If you're concerned about a 'library' of functions you can easily encrypt them. When 'main' is run, it decrypts them, saves into flash and runs them from there.
Frankly most 'functions' can be easily duplicated. Things like LCD drivers, I2C devices, etc. are 'generic' by nature and very well documented.
Jay |
Probably he's interested in making money with libraries or distributing a trial library before buying...
Quote: | That's why I asked 'why'. Heck, even code within a PIC can be 'extracted' given time and money. |
It's painful once the read protect flag is enabled but doable with some buffer overflow technique...
Requires finesse , patience and maybe sulfuric acid (if you really want to go to the chip die)
See here --> http://www.cl.cam.ac.uk/~sps32/mcu_lock.html
Very OLD (not applicable anymore) but very interesting read! _________________ Regards,
Laurent
-----------
Here's my first visual theme for the CCS C Compiler. Enjoy! |
|
|
scanan
Joined: 13 Aug 2004 Posts: 58 Location: Turkey
|
|
Posted: Fri Dec 26, 2014 9:41 am |
|
|
temtronic wrote: | I have to ask 'why ?'
If you're concerned about a 'library' of functions you can easily encrypt them. When 'main' is run, it decrypts them, saves into flash and runs them from there.
Frankly most 'functions' can be easily duplicated. Things like LCD drivers, I2C devices, etc. are 'generic' by nature and very well documented.
That's why I asked 'why'. Heck, even code within a PIC can be 'extracted' given time and money.
Jay |
I do not want my programmers see the algorithms. I want they just use the function that s it. _________________ Dr Suleyman CANAN
R&D Electronic Engineer
https://suleymancanan.wordpress.com
Do whatever you do with amateur spirit -
But always feel professional. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19520
|
|
Posted: Fri Dec 26, 2014 10:20 am |
|
|
Don't get me wrong, but if you distribute, even as a library, the code is 'infantile' to disassemble.
It only becomes even remotely secure, once programmed into a chip with the code protection enabled.
If you want to supply code without fiddling around, which still allows optimisation, with some slight degree of protection, look at the 'encrypted' include extension. |
|
|
ELCouz
Joined: 18 Jul 2007 Posts: 427 Location: Montreal,Quebec
|
|
Posted: Fri Dec 26, 2014 5:13 pm |
|
|
scanan wrote: | temtronic wrote: | I have to ask 'why ?'
If you're concerned about a 'library' of functions you can easily encrypt them. When 'main' is run, it decrypts them, saves into flash and runs them from there.
Frankly most 'functions' can be easily duplicated. Things like LCD drivers, I2C devices, etc. are 'generic' by nature and very well documented.
That's why I asked 'why'. Heck, even code within a PIC can be 'extracted' given time and money.
Jay |
I do not want my programmers see the algorithms. I want they just use the function that s it. |
Your only real protection is the IP laws and a lawyer to sue your patented algorithm if you see abuse of it.
If you are an external consultant most of the time you sell the algorithm to the company or license it... _________________ Regards,
Laurent
-----------
Here's my first visual theme for the CCS C Compiler. Enjoy! |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9229 Location: Greensville,Ontario
|
|
Posted: Fri Dec 26, 2014 7:50 pm |
|
|
One 'simple' way to somewhat 'protect' your algorithms is to split it into two halves,where each half is really either the high or low nibble of the actual hex code. Once downloaded into the PIC ,your 'main' program calls a function to 'reassemble' the two banks of 'data' into a third 'real' bank of algorithms( callable functions).If you try it on paper it's a fairly simple process and the PIC can handle nibbles very fast. This does require a PIC with fast clock and large memory capacity.
From the hardware side, simply sanding off the laser etched part number is easy and will slow down most 'entry level' hackers.
Frankly I don't know the kind of 'algorithms' need to be 'top secret' considering everything is on the internet these days. Even a sloppy programmer can get a PIC to run 'awkward' code to completion by speeding up the clock! Simply going from 16MHz to 64MHz means it's 4x faster. Reverse engineering a product is easy these days and even if the algoritmn isn't 100% of the original, it only has to give the same result for the same inputs.
As for IP protection and lawyers....well China(and others) don't seem to worry about it, there's BILLIONS of PCs running unpaid for OSes,etc.
In the beginning there was ONE computer program...
..all the rest are just copies,clones,reworks,slightly modified versions.
jay |
|
|
scanan
Joined: 13 Aug 2004 Posts: 58 Location: Turkey
|
|
Posted: Mon Dec 29, 2014 2:24 am |
|
|
Many thanks for your advices,
I am aware that enough time and enough money can do a lot.
But seems that some people are not doing commercial devices and products, and it is not important to protect the codes.
But in my case,
I sold more that 20000 devices made upon PIC18F chips. I have a lot of competitors that try doing the same thing as mine and even they copied my hardware as a whole but the problem is that their devices are not as stable as mine why? Because I have my own way of solving problem that others don't know. That's why I want to protect my routines.
why give easily the know how isn't? _________________ Dr Suleyman CANAN
R&D Electronic Engineer
https://suleymancanan.wordpress.com
Do whatever you do with amateur spirit -
But always feel professional. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19520
|
|
Posted: Mon Dec 29, 2014 2:48 am |
|
|
So use the encrypted include ability.
You generate the include file. Then encrypt it. Distribute this to the people you want to use the code. They can then use this as if it were a normal include file, _but cannot see the code inside_. They can call the functions from their code, but the routines will also not be shown in the assembler listing. It's designed to allow you to distribute code to people, without making it easy for them to crack what you have done.
Normally you generate two files. One with the function prototypes, and comments, that is not encrypted, and one with the actual code, that it. |
|
|
scanan
Joined: 13 Aug 2004 Posts: 58 Location: Turkey
|
|
Posted: Mon Dec 29, 2014 3:02 am |
|
|
Ttelmah wrote: | So use the encrypted include ability.
You generate the include file. Then encrypt it. Distribute this to the people you want to use the code. They can then use this as if it were a normal include file, _but cannot see the code inside_. They can call the functions from their code, but the routines will also not be shown in the assembler listing. It's designed to allow you to distribute code to people, without making it easy for them to crack what you have done.
Normally you generate two files. One with the function prototypes, and comments, that is not encrypted, and one with the actual code, that it. |
THanks Ttelmah,
Ok I encrypted my lib file and included but can't compıle
what more to do to get it work? _________________ Dr Suleyman CANAN
R&D Electronic Engineer
https://suleymancanan.wordpress.com
Do whatever you do with amateur spirit -
But always feel professional. |
|
|
scanan
Joined: 13 Aug 2004 Posts: 58 Location: Turkey
|
|
Posted: Mon Dec 29, 2014 3:25 am |
|
|
OK done,
many thanks Ttelmah _________________ Dr Suleyman CANAN
R&D Electronic Engineer
https://suleymancanan.wordpress.com
Do whatever you do with amateur spirit -
But always feel professional. |
|
|
|