Skip to main content

Encryption

torchpipe comes with built-in simple encryption functionality.

tip

Please specify the IPIPE_KEY key (greater than 8 characters, 16 characters recommended) when compiling torchpipe to enable the relevant functionality:

# The following key is just an example. Please do not use this key.
IPIPE_KEY=9876tfyghyughyuihjk python setup.py bdist_wheel
# or IPIPE_KEY=9876tfyugkjhyuihjk pip instal -e .

Example

python -m torchpipe.utils.encrypt a.onnx a.onnx.encrypted

Usage

usage: encrypt.py [-h] input output

The output file with the .encrypted suffix can be used with TensorrtTensor.

Encryption Security

We use symmetric encryption, as well as some frame selection and obfuscation strategies for encryption in our source code. The encryption strategy may change with version updates and other factors. Please specify the key IPIPE_KEY (greater than 8 bits, 16 bits is optimal) when compiling torchpipe. We only provide basic encryption functionality. You can implement the entire encryption and decryption part yourself to achieve more secure protection.