OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1718 Discussions

How to protect OpenCL code from stealing?

lebron_j_
Beginner
430 Views

I use OpenCL in my program, and i need to protect opencl code from reading by other users. Compile code to binary maybe the option, but if exist some way to decompile it, this option is useless. I cant allow to somebody steal my opencl code. How i can do opencl protection? Thanks!

0 Kudos
2 Replies
Raghupathi_M_Intel
430 Views

We don't have a way to obfuscate OpenCL code in the current SDK but we are looking at SPIR (http://www.khronos.org/spir). Will that solve your purpose?

Raghu

0 Kudos
LLess
Beginner
430 Views

Raghu, what part of SPIR do you think will help?

The best you can hope is that your kernel code will be converted into bytecode which will make the work a bit more difficult (not a lot).

And honestly, speaking from a point of view of someone who has been doing assembly code for a long time, you can't. From my past experience of if someone want to get your kernel code it is always possible.

It is even easier for OpenCL since the API is fixed and well defined so writing a fake DLL to redirect the calls is not that hard.

The only way to protect it would be for Khronos to decide of some kind of cryptography API with dual keys (like PGP or something like that) that you could use to encrypt the kernels.

I have never seen that (OpenGL shaders, DirectX shaders, and CUDA don't support it either).

Laurent.

0 Kudos
Reply