How to protect shader code in a release product
2015-12-17 11:59
281 查看
Option 1:
Obfuscate your source and continue to use clCreateProgramWithSource. Remove all comments and make variable and function names meaningless. This will still work on all platforms and devices.
Option 2:
Only ship binary and use clCreateProgramWithBinary. The downside is that you'll have to pre-compile your program for all supported platforms and devices ahead of time and if your user has an unsupported device, you won't run on their hardware.
Option 3:
Wait for OpenCL SPIR to be available everywhere. This is a portable intermediate representation that is lower-level than source but higher level than binary. It is not well supported yet, so not really an option yet.
maybe
Use separate files and encrypt them with a text encryption
library, perhaps?
You could also roll your own encryption/decryption
scheme using a key, depending on how secure you want the files to be.
Even if you were to embed the shaders in the application
itself, a tool as simple as unix "strings" can be used to extract them.
that binary shaders in OpenGL are meant to reduce shader compile time, not for portable re-distribution.
Obfuscate your source and continue to use clCreateProgramWithSource. Remove all comments and make variable and function names meaningless. This will still work on all platforms and devices.
Option 2:
Only ship binary and use clCreateProgramWithBinary. The downside is that you'll have to pre-compile your program for all supported platforms and devices ahead of time and if your user has an unsupported device, you won't run on their hardware.
Option 3:
Wait for OpenCL SPIR to be available everywhere. This is a portable intermediate representation that is lower-level than source but higher level than binary. It is not well supported yet, so not really an option yet.
maybe
Use separate files and encrypt them with a text encryption
library, perhaps?
You could also roll your own encryption/decryption
scheme using a key, depending on how secure you want the files to be.
Even if you were to embed the shaders in the application
itself, a tool as simple as unix "strings" can be used to extract them.
that binary shaders in OpenGL are meant to reduce shader compile time, not for portable re-distribution.
相关文章推荐
- 安卓开发之安卓AIDL的使用
- 哪些公认的健康食品其实并非那么健康?为什么?
- Linux中opendir的函数结构体详解
- 设计模式学习---单例模式
- 堪称最好的A*算法
- QT之QCustomPlot(二)
- Python 基本类型操作
- Apache HttpClient
- psutil一个基于python的跨平台系统信息跟踪模块
- 关于高可用架构的思考(1-历史与纲要)
- 使用intelliJ idea14创建web项目
- 用C写一个顺序表的简单操作
- LoadRunner中循环操作
- 自定义控件
- 夺命雷公狗----Session入memcached
- 预防XSS攻击,(参数/响应值)特殊字符过滤
- iOS的UDID废用以及UUID配合keychain的替换方案实现
- Redis监控软件Redis-stat
- 用eclipse创建maven项目老是出现这个错误 'Creating maven-archetype-quickstart' has encountered
- RecycleView的使用