'protecting' a dynamic component?

'protecting' a dynamic component?

Postby halroach » Sat Apr 23, 2016 9:00 pm

Is there a way to 'protect' a dynamic component - so as to limit who can use it?
Sort of like what is done with paid for plugins?

Maybe a way to integrate the functionality of the dynamic component with that of a ruby script so it would only work when the script is installed/licensed...

I don't have much experience with scripting, but I am interested in learning!
0
User avatar
halroach 
 

Re: 'protecting' a dynamic component?

Postby driven » Sat Apr 23, 2016 11:54 pm

Theoretically, you could write a ruby to make the dynamic component for single session use...

when the user saves or closes the model, the dynamic attributes could be stripped or nobbled...

if reopened on the same or another licensed computer, the plugin could restore the attributes...

but, I'm only thinking out loud...

john
0
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

Re: 'protecting' a dynamic component?

Postby halroach » Thu Jul 28, 2016 12:31 pm

Hi John,

I'm sorry I didn't write earlier. My own question got lost in the depths of the internet ;).

Would you know how to program something like what you've suggested, if it's at all feasible...

I have seen this code by TIG which basically strips all dynamic components in a model of their attributes:
viewtopic.php?f=323&t=42923

It works pretty well, but I wouldn't know how to turn that into something practical and automatic, so to speak + how to connect that with licensing...

Thanks!

Yoni

driven wrote:Theoretically, you could write a ruby to make the dynamic component for single session use...

when the user saves or closes the model, the dynamic attributes could be stripped or nobbled...

if reopened on the same or another licensed computer, the plugin could restore the attributes...

but, I'm only thinking out loud...

john
0
User avatar
halroach 
 

Re: 'protecting' a dynamic component?

Postby driven » Fri Jul 29, 2016 2:27 pm

my thinking is that it's relatively easy to 'break' a DC so that it won't work...

it is also easy to share encrypted/broken DC's...

one way is to 'transfer' the attributes to a new 'encrypted' dictionary...

if you import this 'encrypted' DC into SU, it will not work, but if you 'decrypt' it using you 'secret' key, it will...

frozen.skp

you can check if it has any dynamic attributes and even if you use ruby you won't know what they are...

i.e. this random example ["_vhMZmDddZ_0dYeZMOmZ", "WhMZmlddZ"]

if you load this ruby into Ruby Console

encrypt_dc.rb

and then type
Code: Select all
JcB.fix_dc

the DC will then work as designed...

encyptDC.gif


if you use
Code: Select all
JcB.break_dc
it will encrypt all DC's in the model...

This is only part of the puzzle and you still need to implement a 'License Strategy'...

it would need to tie the lic to the encryption key and implement 'model observer' triggering of the encryption code...

think of all the ways people can extract a working version and write code to block it happening...

john
0
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

Re: 'protecting' a dynamic component?

Postby halroach » Sat Jul 30, 2016 9:55 pm

Hi John,

This looks very interesting!
I got it to work on my own DC, but not on the one you sent.

With the 'Frozen' DC you sent:
I loaded the script. opened the file, and ran the command 'JcB.fix_dc'
and I get the following in the ruby console:
#<Sketchup::DefinitionList:0x0000000aa37190>

With my own DC it worked, I could see it encrypting and decrypting many lines in the console... though it hung sketchup for like 20-30 seconds during encryption and a little shorter during decryption... That could be a problem.

Maybe encrypting just a little portion of the DC (specific attributes) would be enough?

I'll keep playing with it...
0
User avatar
halroach 
 

Re: 'protecting' a dynamic component?

Postby halroach » Sat Jul 30, 2016 10:05 pm

Also,

What would prevent if someone just right clicks the DC and "save as" to some folder, before any encryption was taking place...
I imagine there would need to be some matching done between something in the individual DC and something in the ruby... but could anything like that be done? Could you have a DC searching for code "outside" of "itself"? (I'm not sure I'm making much sense...).
0
User avatar
halroach 
 

Re: 'protecting' a dynamic component?

Postby driven » Sun Jul 31, 2016 1:16 am

halroach wrote:...I got it to work on my own DC, but not on the one you sent...


I may have attached the wrong one as it was a quick proof of principle, and I had made a few...

What would prevent if someone just right clicks the DC and "save as" to some folder


there are lots of situations where the 'raw' DC could be 'pirated', but if they start out encrypted they need your ruby for them to work...

that gives you an advantage as you can add observers. etc... to react to events...

any copy event is a potential threat and may be the price you have to pay for the convenience you gain using DC's in favour of bespoke geometry creation...

john
0
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

Re: 'protecting' a dynamic component?

Postby halroach » Fri Aug 19, 2016 12:49 pm

driven wrote:that gives you an advantage as you can add observers. etc... to react to events...


What kind of observers are there? and what kind of events for example could one react to in ruby that would be relevant in our case? (I'm new to this field...)

I'm also thinking, assuming one doesn't encrypt all the attributes, but just "necessary ones" - (since it seems to take a very long time just for one DC, and I'm thinking of models with hundreds of DCs of different types...) Would it be possible to target the "plugin" at specific DCs with specific attributes only?
0
User avatar
halroach 
 

Re: 'protecting' a dynamic component?

Postby TNTDAVID » Tue Oct 04, 2016 2:04 pm

Hello,

I am delighted to see that a subject is open for the protection of dynamic components.

Before asking my questions, here are the results of tests in GIF:



Driven why it does not work as in your picture?

Thank you

David
0
* Nouveau !!!
Découvrez notre nouveau Plugin Click-Cuisine 2, pour créer vos cuisines 3D !
User avatar
TNTDAVID 
PluginStore Author
PluginStore Author
 

Re: 'protecting' a dynamic component?

Postby driven » Tue Oct 04, 2016 9:26 pm

hi David...

are you still running SU v8 ?

if so it may be a ruby 2 issue with my example...

I've had no time to follow up on this concept [sorry yoni] ...

john
0
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

Re: 'protecting' a dynamic component?

Postby TNTDAVID » Wed Oct 05, 2016 1:17 pm

Hello Driven ;)

I work with SketchUp, 2015.
0
* Nouveau !!!
Découvrez notre nouveau Plugin Click-Cuisine 2, pour créer vos cuisines 3D !
User avatar
TNTDAVID 
PluginStore Author
PluginStore Author
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Dynamic Components

Who is online

Users browsing this forum: No registered users and 1 guest

Visit our sponsors: