保护/加密 R 包代码以进行分发 [英] Protect/encrypt R package code for distribution

查看:103
本文介绍了保护/加密 R 包代码以进行分发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用 R 编写一个包,并想保护/加密代码.基本上,在查看我的包代码时,它应该是加密的并且不可读.我已经读到有人对他的代码(1)进行了加密,但是我没有找到更多关于它的信息.我知道我可以只用 C/C++ 编写代码并编译它,但是我想让它在 R 中并在那里保护".

I am writing a package in R and would like to protect/crypt the code. Basically, when looking into my package code, it should be crypted and not readable. I have read that someone has crypted his code(1), however I haven't found any more information about that. I know I could just write the code in C/C++ and compile it, however I would like to let it in R and just "protect" it there.

我的问题是:这可能吗,这怎么可能?

My question is: Is this possible, how is this possible?

感谢您的回答!

参考:

(1) 链接

推荐答案

您是否尝试关注该线程?

Did you try following that thread?

https://stat.ethz.ch/pipermail/r-help/2011-七月/282717.html

在某些时候,R 代码必须由 R 解释器处理.如果你给某人加密代码,你必须给他们解密密钥,这样 R 才能运行它.也许你可以把钥匙藏在某个地方,希望他们找不到.但是他们必须能够访问它才能以某种方式生成纯文本 R 代码.

At some point the R code has to be processed by the R interpreter. If you give someone encrypted code, you have to give them the decryption key so R can run it. Maybe you can hide the key somewhere and hope they don't find it. But they must have access to it in order to generate the plain text R code somehow.

这适用于您在计算机上运行或查看的所有程序或文件.加密的PDF文件?不,它们只是混淆,一旦您找到解密密钥,您就可以解密它们.即使是用 C 或 C++ 编写的代码以二进制形式分发,也可以通过足够的时间、工具和足够聪明的黑客进行逆向工程.

This is true for all programs or files that you run or view on your computer. Encrypted PDF files? No, they are just obfuscated, and once you find the decryption keys you can decrypt them. Even code written in C or C++ distributed as a binary can be reverse engineered with enough time, tools, and clever enough hackers.

您希望它受到保护,将其保存在您的服务器上,并且只允许通过网络 API 进行访问.

You want it protected, you keep it on your servers, and only allow access via a network API.

这篇关于保护/加密 R 包代码以进行分发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆