Isotropix Forums

OSL encryption?

Clarisse Scripting related topics

OSL encryption?

Unread postby pschloter » Fri Oct 02, 2020 8:40 am

Is it possible to encrypt a OSL shader so others cannot read/copy it?
pschloter
 
Posts: 19
Joined: Sat Sep 26, 2020 3:53 pm

Re: OSL encryption?

Unread postby sam » Fri Oct 02, 2020 1:08 pm

It's not possible as far as I know. The only way is to compile it to byte code. Technically it won't be encrypted but the source code won't be readable by a typical human being.
Sam Assadian
Isotropix
CEO/Founder
User avatar
sam
 
Posts: 1611
Joined: Fri Jan 25, 2013 11:33 pm

Re: OSL encryption?

Unread postby pschloter » Fri Oct 02, 2020 2:32 pm

Thanks. What is the command to compile / obtain the saved shader?
An encryption feature would be useful.
pschloter
 
Posts: 19
Joined: Sat Sep 26, 2020 3:53 pm

Re: OSL encryption?

Unread postby anemoff » Fri Oct 02, 2020 2:36 pm

Even the OSL compiled files (.oso), which actually contain assembly-like code, are still readable by a human but it requires a little bit more effort.
To compile .osl files you'll need to get or build OSL binaries to use the OSL compiler "oslc".
Check OSL documentation: https://github.com/imageworks/OpenShadingLanguage/
Anthony Nemoff
Isotropix
R&D Engineer
User avatar
anemoff
 
Posts: 362
Joined: Wed Jan 13, 2016 10:10 am

Re: OSL encryption?

Unread postby pschloter » Fri Oct 02, 2020 10:42 pm

Thanks, would it be possible for you to offer encryption of Python and OSL files?
OSLC seems to be platform-specific.
pschloter
 
Posts: 19
Joined: Sat Sep 26, 2020 3:53 pm

Re: OSL encryption?

Unread postby anemoff » Mon Oct 05, 2020 11:09 am

Feel free to submit a feature request, to get it evaluated: https://www.isotropix.com/user/feature

In any case, the scripts source code can never be protected at 100%: they need to be decrypted in memory at some point before execution, so they can still be read unencrypted from the memory, with some effort.

Are there other 3D DCC with such a feature?
Anthony Nemoff
Isotropix
R&D Engineer
User avatar
anemoff
 
Posts: 362
Joined: Wed Jan 13, 2016 10:10 am

Re: OSL encryption?

Unread postby sam » Mon Oct 05, 2020 11:14 am

You don't even need to make a feature request because I'll put my veto on it. As Anthony said it would be very easy to decrypt the source code since both OSL and Python don not support encryption. By putting a simple break point to the library a user could have access to the source.

If you want to hide the source code, then use the C++ API
Sam Assadian
Isotropix
CEO/Founder
User avatar
sam
 
Posts: 1611
Joined: Fri Jan 25, 2013 11:33 pm

Re: OSL encryption?

Unread postby pschloter » Mon Oct 05, 2020 6:45 pm

pschloter
 
Posts: 19
Joined: Sat Sep 26, 2020 3:53 pm

Re: OSL encryption?

Unread postby sam » Mon Oct 05, 2020 7:02 pm

Even though, the python byte code will be readable. As I said, we are not interested by providing such feature. I feel that the whole point of Python and OSL script is to share the source code to be able to modify it.
Sam Assadian
Isotropix
CEO/Founder
User avatar
sam
 
Posts: 1611
Joined: Fri Jan 25, 2013 11:33 pm

Re: OSL encryption?

Unread postby pschloter » Mon Oct 05, 2020 7:25 pm

Got it. Yeah, just challenging when distributing a script to a client.
And C++ isn't a single file for cross platform. So would have been a nice feature to at least have an option for a basic barrier.
pschloter
 
Posts: 19
Joined: Sat Sep 26, 2020 3:53 pm

Next

Return to Scripting