5

I've done some research online but I haven't been able to come up with any answer. I know this has been asked at least thrice, as I've viewed those posts, linked here:

First Question
Second Question
Third Question

However, it's been 5, 7, and 9 years since those questions have been asked, and technology is obviously rapidly evolving :) I don't know much about R, and I haven't worked with it for a long time, and so I ask those of you who know better and have more experience if you know of anything that would be useful to me.

If there's nothing that exists now, how hard would it be to create? The reason I ask is that the company I work for would like to obfuscate the proprietary code before it goes out. I would have the full 40 hours a week to work on creating it, and so time and/or difficulty isn't a major concern.

Thanks!

Alex Eastman
  • 305
  • 1
  • 10
  • 3
    My personal frank advice: If you want to create & distribute closed-source highly-restrictive software, don't use R! R and its downstream packages are open-source, and I count that as one of R's great advantages over other powerful but closed-source products (like e.g. SAS, SPSS). A very relevant post on R bloggers: [How GPL makes me leave R for Python:-(](https://www.r-bloggers.com/how-gpl-makes-me-leave-r-for-python/). – Maurits Evers Jun 24 '20 at 22:44
  • Unfortunately I don't have a choice. We're using code that was made in R and freely distributed. To change this would be near impossible since it's entirely data analysis. I understand your point though. – Alex Eastman Jun 25 '20 at 02:21
  • 1
    If the code was freely distributed previously, then why do you feel the need for code obfuscation now? GPL licenses (which as far as I know is what R and most R packages use) are all copy-left licenses. This will restrict what kind of distribution rights you can impose on derivative work. I think this may be one for the legal team of your company. – Maurits Evers Jun 25 '20 at 04:18
  • 1
    We don't have a legal team. It's a small company (< 15 people) and I'm only an intern. I'll let my boss know your thoughts though :-) – Alex Eastman Jun 25 '20 at 13:55

1 Answers1

1

Found this: I'm not sure about the security, but this is definitely a deterrent and would take (I think) some fairly concentrated effort to crack. There is a byte code compiler for R based on the paper linked below. There is a method in library(compiler), which comes standard with R, that allows you to compile an R script to byte code. In the same library, you can load in the source files and use them as you'd like.

A Byte Code Compiler for R

Alex Eastman
  • 305
  • 1
  • 10