Skip to content

Commit d9df8af

Browse files
Update 2022.0 to include IP file and API doc Improvements
1 parent 96e09d9 commit d9df8af

File tree

1 file changed

+230
-0
lines changed

1 file changed

+230
-0
lines changed

file.intellectual_property.html

Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<!-- VIEWPORT -->
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<!-- AUTHOR and GENERATOR -->
8+
<meta name="author" content="SketchUp Extensibility Team">
9+
<meta name="generator" content="YARD https://yardoc.org">
10+
<!-- TITLE -->
11+
<title>
12+
File: Protecting Intellectual Property &mdash; SketchUp Ruby API Documentation
13+
</title>
14+
<!-- SHORTCUT ICON -->
15+
<link rel="shortcut icon" type="image/vnd.microsoft.icon"
16+
href="favicon.ico" />
17+
18+
<!-- GENERIC META PROPERTIES -->
19+
<meta name="url" content="https://ruby.sketchup.com/file.intellectual_property.html" />
20+
<meta name="image" content="https://ruby.sketchup.com/images/Ruby.svg" />
21+
<meta name="title" content="File: Protecting Intellectual Property" />
22+
<meta name="name" content="SketchUp Ruby API Documentation" />
23+
<meta name="description" content="Protecting Intellectual Property" />
24+
<!-- OPEN GRAPH META PROPERTIES -->
25+
<meta property="og:site_name" content="SketchUp Ruby API Documentation" />
26+
<meta property="og:type" content="website" />
27+
<meta property="og:image" content="https://ruby.sketchup.com/images/Ruby.svg" />
28+
<meta property="og:image:width" content="60" />
29+
<meta property="og:image:height" content="60" />
30+
<meta property="og:title" content="File: Protecting Intellectual Property" />
31+
<meta property="og:url" content="https://ruby.sketchup.com/file.intellectual_property.html" />
32+
<meta property="og:description" content="Protecting Intellectual Property" />
33+
<!-- TWITTER CARD META PROPERTIES -->
34+
<meta name="twitter:card" content="summary" />
35+
<meta name="twitter:site" content="@sketchup" />
36+
<meta name="twitter:title" content="File: Protecting Intellectual Property" />
37+
<meta name="twitter:description" content="Protecting Intellectual Property" />
38+
<meta name="twitter:image:src" content="https://ruby.sketchup.com/images/Ruby.svg?s=120" />
39+
<meta name="twitter:url" content="https://ruby.sketchup.com/file.intellectual_property.html" />
40+
41+
42+
<!-- STYLESHEETS -->
43+
<link rel="stylesheet" type="text/css"
44+
href="https://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic" />
45+
46+
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
47+
48+
<link rel="stylesheet" href="css/sketchup.css" type="text/css" charset="utf-8" />
49+
50+
<link rel="stylesheet" href="css/rubyapi.css" type="text/css" charset="utf-8" />
51+
52+
<link rel="stylesheet" href="css/rouge.css" type="text/css" charset="utf-8" />
53+
<!-- SCRIPTS -->
54+
<script type="text/javascript">
55+
pathId = "intellectual_property";
56+
relpath = '';
57+
</script>
58+
59+
60+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
61+
62+
<script type="text/javascript" charset="utf-8" src="js/jquery-migrate.js"></script>
63+
64+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
65+
66+
<script>
67+
// Every time this page is loaded, it sends this action to SketchUp, telling
68+
// SketchUp that a new page has loaded that has example snippets that should
69+
// be replaced with code editors. Nothing happens if the page is loaded in a
70+
// regular browser outside of the SketchUp client.
71+
$( document ).ready(function() {
72+
if (typeof sketchup == 'object') {
73+
sketchup.page_loaded();
74+
}
75+
});
76+
</script>
77+
78+
</head>
79+
<body>
80+
81+
<!-- SU - start -->
82+
<header id="navbar" role="banner" class="navbar navbar-fixed-top navbar-inverse">
83+
<div id="api-documentation-header">
84+
<div class="navbar-header">
85+
<a class="logo navbar-btn pull-left" href="https://developer.sketchup.com" title="Home">
86+
<img src="images/sketchup-logo.svg" alt="SketchUp">
87+
</a>
88+
<a class="name navbar-brand" href="/en" title="Home">SketchUp Developer Center</a>
89+
<!-- .btn-navbar is used as the toggle for collapsed navbar content -->
90+
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
91+
<span class="sr-only">Toggle navigation</span>
92+
<span class="icon-bar"></span>
93+
<span class="icon-bar"></span>
94+
<span class="icon-bar"></span>
95+
</button>
96+
</div>
97+
<div class="navbar-collapse collapse">
98+
<nav role="navigation">
99+
<ul class="menu nav navbar-nav">
100+
<li class="first leaf"><a href="https://forums.sketchup.com/c/developers">Community</a></li>
101+
<li class="leaf"><a href="https://blog.sketchup.com/">SketchUp Blog</a></li>
102+
<li class="leaf"><a href="https://www.sketchup.com/download" class="top-menu--download-button">Download</a></li>
103+
<li class="last expanded dropdown">
104+
<a href="https://www.trimble.com" class="trimble-top-menu-item dropdown-toggle" data-target="#" data-toggle="dropdown"><img src="images/trimble-logo-white.svg" alt="Trimble"><span class="caret"></span></a>
105+
<ul class="dropdown-menu">
106+
<li class="first leaf"><a href="https://connect.trimble.com/">Trimble Connect</a></li>
107+
<li class="leaf"><a href="https://www.trimble.com/Corporate/About_Trimble.aspx">About Trimble</a></li>
108+
<li class="last leaf"><a href="https://buildings.trimble.com/">Trimble Buildings</a></li>
109+
</ul>
110+
</li>
111+
</ul>
112+
</nav>
113+
</div>
114+
</div>
115+
</header>
116+
<!-- SU - end -->
117+
118+
119+
<div id="su-content">
120+
121+
<div class="nav_wrap">
122+
<iframe id="nav" src="file_list.html"></iframe>
123+
<div id="resizer"></div>
124+
</div>
125+
126+
<div id="main" tabindex="-1">
127+
<div id="header">
128+
<div id="menu">
129+
130+
<a href="_index.html">Index</a> &raquo;
131+
<span class="title">File: Protecting Intellectual Property</span>
132+
133+
</div>
134+
135+
<div id="search">
136+
137+
<a class="full_list_link" id="class_list_link"
138+
href="class_list.html">
139+
140+
<svg width="24" height="24">
141+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
142+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
143+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
144+
</svg>
145+
</a>
146+
147+
</div>
148+
<div class="clear"></div>
149+
</div>
150+
151+
<div id="content"><div id='filecontents'>
152+
<h1 id="label-Protecting+the+Intellectual+Property+in+your+SketchUp+Extensions">Protecting the Intellectual Property in your SketchUp Extensions</h1>
153+
154+
<p>The code you write in your extensions is your intellectual property. You may choose to open source it or you might want to keep it hidden so no one else can see it. In this guide we’ll explain why hiding it can be tricky and what you need to know to protect your IP.</p>
155+
156+
<h2 id="label-Ruby+code+is+visible.+Period.">Ruby code is visible. Period.</h2>
157+
158+
<p>If you simply distribute your extension in an .rb file, anyone can open that file and see the code you’ve written. This is true even if your ruby file is wrapped in an .rbz file. This obviously isn’t good if you don’t want people to see your code. You can obscure your code through encryption and that’s a good step but even that’s not perfect protection.</p>
159+
160+
<p>Unlike languages like C that must be compiled into machine language, Ruby runs inside an interpreter. Even if you’ve encrypted your code it must be decrypted in order to run. If someone is determined enough, there are ways to expose your Ruby code from within the running process.</p>
161+
162+
<p>So is it hopeless to try to hide your source code? Should you just give up on writing extensions? No! But you should explore the options and choose what works best for you. Read on to learn more.</p>
163+
164+
<h2 id="label-Encryption+can+be+broken">Encryption can be broken</h2>
165+
166+
<p>No encryption is perfect. Like the lock on your door, it’ll keep out the vast majority of people but if someone is determined enough they’ll find a way in. And there are a lot of determined hackers out there. Some are malicious and some just enjoy solving puzzles but the end result is that secure encryption remains a moving target.</p>
167+
168+
<h2 id="label-RBS+and+RBE+options">RBS and RBE options</h2>
169+
170+
<p>Over the years we’ve provided two encrypted file formats for SketchUp extensions: .RBS and .RBE files. RBS (which is no longer offered) used a scrambling technology. RBE is the newer format that uses a more sophisticated encryption. Neither of these have been infallible though and we don’t recommend depending solely on them to protect your code.</p>
171+
172+
<h2 id="label-Encryptors-2C+obfuscators-2C+and+minifiers">Encryptors, obfuscators, and minifiers</h2>
173+
174+
<p>Some extension developers pay for an external encryptor like <a href="https://www.rubyencoder.com/">RubyEncoder</a>. This can be layered on top of the encryption provided by SketchUp or used independently.</p>
175+
176+
<p>Other developers use tools to make their Ruby code harder to understand. Obfuscators make your code more complex, and minifiers remove all unnecessary characters in your code. Both techniques try not to change the functionality of your code but serve to make it harder to read.</p>
177+
178+
<h2 id="label-Compiling+your+code+into+a+C+library">Compiling your code into a C library</h2>
179+
180+
<p>One of the best ways to hide your code is to write it in C and compile it into a library. Unlike with Ruby where you need to distribute your source code, your compiled C code has been translated into machine language binary files. The machine instructions are still human readable with the right tools but they are much more difficult to understand than the original C.</p>
181+
182+
<p>But make no mistake, even this doesn’t completely obscure your logic. Yes, it protects your source code because there’s no way to rehydrate your exact code (including comments and variable names), but a determined hacker can use decompilation to expose your logic. This is true for all software written in compiled code, not just SketchUp extensions. Decompilation is sometimes referred to as turning a sausage back into a pig. There’s only so much that can be done, but with the right tools you can at least get the sausage into the shape of a pig.</p>
183+
184+
<p>Your C extension will still need Ruby code but if you keep your Ruby simple (e.g. just the UI code) then you have less to lose from someone stealing this code.</p>
185+
186+
<h2 id="label-Layering+multiple+levels+of+protection">Layering multiple levels of protection</h2>
187+
188+
<p>As a best practice we recommend layering multiple levels of protection so you don’t have a single point of failure.</p>
189+
190+
<p>Also consider what you are protecting against. Are you protecting your license logic from being tampered with, or are you trying to protect the intellectual property in your source code? Not all risks are equal. Your logic for setting up menus and dialogs is not likely to be as important as your algorithms. Focus on protecting the parts of your product that make it special.</p>
191+
192+
<h2 id="label-Consider+Alternatives">Consider Alternatives</h2>
193+
194+
<p>Would it be acceptable for you to open source your software? There are businesses that make a living out of producing open source software. They earn their income by selling services and support related to the software, despite the fact that their entire source code is open to everyone, legally free to copy and modify. The experience, service, and support of a product is also a vital part of its value.</p>
195+
196+
<h2 id="label-Summary">Summary</h2>
197+
198+
<p>Protecting your software product is a constant arms race, and your time is valuable. You’ll need to decide how important it is to protect your source code. You may also want to keep in mind that not every illegal copy equals a lost sale. Many users of pirated software wouldn&#39;t have paid for it in the first place. Giving your code an open source license and allowing others to freely use it can let you avoid the hassles from hiding your code.</p>
199+
200+
<p>But this isn’t always desirable or even possible. If you need to protect your code from prying eyes, our recommendation for most developers is to use a layered approach. Don&#39;t rely on a single solution. Ideally you have control over at least one of these solutions so you can swap it out if needed. In the end this is a cost/effort/gain balance that will differ from case to case.</p>
201+
202+
<h2 id="label-Further+Reading">Further Reading</h2>
203+
<ul><li>
204+
<p><a href="https://www.rubyencoder.com/faqs-protect-ruby-scripts-FAQs-Security-category-3.html">RubyEncode Security FAQ</a></p>
205+
</li><li>
206+
<p><a href="https://jonskeet.uk/csharp/obfuscation.html">Obfuscation and Decompilation</a></p>
207+
</li><li>
208+
<p><a href="https://stackoverflow.com/a/2478504/486990">Protecting your code from decompilation</a></p>
209+
</li><li>
210+
<p><a href="https://stackoverflow.com/a/19525834/486990">Obfuscators</a></p>
211+
</li><li>
212+
<p><a href="https://blog.ndepend.com/dont-rely-on-someone-else-to-protect-your-software/">NDepend decompilation protection</a></p>
213+
</li><li>
214+
<p><a href="https://security.stackexchange.com/a/107076/87978">Is obfuscation worth it?</a></p>
215+
</li><li>
216+
<p><a href="https://security.stackexchange.com/a/219347/87978">Does obfuscation have a security benefit?</a></p>
217+
</li></ul>
218+
</div></div>
219+
220+
<div id="footer">
221+
Generated by
222+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
223+
</div>
224+
225+
</div>
226+
227+
</div>
228+
229+
</body>
230+
</html>

0 commit comments

Comments
 (0)