How to add the encryption and decryption model part of the program

How to add the encryption and decryption model part of the program in deepstream5 。
PS: Can trt engine files be cracked?

• Hardware Platform (Jetson / GPU)
• DeepStream Version5.0
• JetPack Version (valid for Jetson only)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)

what do you mean “cracked”?

You could modify the trt engine load in nvinfer plugin

What file in /opt/nvidia/deepstream/deepstream do you suggest? Is there any examples that you recommend? What documentation would be good to reference while putting the question “how to add encryption and decryption” to a deepstream application?

This is an excellent question from RayZhang and I am very interested to hear from the Nvidia moderators about the specific resources, examples, and development path that a developer should take to implement this question in a deepstream application.

Thanks in advance!

Hi @superelectron,
I mean, you could modify function - deserializeEngine() below, this function is to read the TRT engine file and deserialize it to create TRT nvinfer1::ICudaEngine.
You can firstly encrypt the TRT engine, e.g. just adding watermark in the TRT engine, and in this function, you read the TRT engine file and decrypt it, then deserialize it to create TRT nvinfer1::ICudaEngine.

File : /opt/nvidia/deepstream/deepstream/sources/libs/nvdsinfer/nvdsinfer_model_builder.cpp


/* Deserialize engine from file */
std::unique_ptr<TrtEngine>
TrtModelBuilder::deserializeEngine(const std::string& path, int dla)
{
....
}
1 Like

May I Know, how to add watermark in engine file and also remove it before deserializing. some sample will be helpful. Thanks

Hi muhammadrizwanmunawar,

Please help to open a new topic. Thanks