'protecting' a dynamic component?
-
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!
-
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
-
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:
http://sketchucation.com/forums/viewtopic.php?f=323%26amp;t=42923It 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 said:
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
-
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...
encrypted example stairs DC
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
use load for a test...
and then typeJcB.fix_dc
the DC will then work as designed...
if you use
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
-
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:0x0000000aa37190With 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...
-
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...). -
@halroach said:
...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...
@unknownuser said:
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
-
@driven said:
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?
-
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
-
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
-
Hello Driven
I work with SketchUp, 2015.
Advertisement