how to encrypt binary model file with libtorch in an offline environment

we have a model file trained with pytorch python api and deployed offline in client’s computer with libtorch c++ api to do inference, to prevent our competitors to use our model to produce exactly the same result, we need to encrypt the model, that is, the model file can only infered with a given password in the program, rather than just loading the model and pass the picture and get a result

how can we manage to do this, thanks!

1 Like

@xinheblue did you find a solution with Pytorch? We can probably encrypt the .pt with RSA encryption but for now, we didn’t test anything.