https://github.com/kazuhito00/onnx-model-encrypt-sample
ONNXモデルをpyca/cryptographyを用いて暗号化/復号化するサンプル
https://github.com/kazuhito00/onnx-model-encrypt-sample
cryptography onnx
Last synced: 11 months ago
JSON representation
ONNXモデルをpyca/cryptographyを用いて暗号化/復号化するサンプル
- Host: GitHub
- URL: https://github.com/kazuhito00/onnx-model-encrypt-sample
- Owner: Kazuhito00
- License: apache-2.0
- Created: 2022-03-19T14:56:16.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-03-19T15:20:27.000Z (over 4 years ago)
- Last Synced: 2023-03-04T13:14:50.652Z (over 3 years ago)
- Topics: cryptography, onnx
- Language: Jupyter Notebook
- Homepage:
- Size: 88.5 MB
- Stars: 12
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# onnx-model-encrypt-sample
ONNXモデルを[pyca/cryptography](https://github.com/pyca/cryptography)を用いて暗号化/復号化するサンプルです。
※Pythonスクリプトで実施する都合上、気休め程度です。
セキュリティを考慮した運用を考える場合、復号化するプログラムはC++等で実行ファイルを作成することをおすすめします。
# Requirement
* cryptography 36.0.2 or later
* onnxruntime 1.10.0 or later
# Usage
サンプルの実行方法は以下です。
各プログラムを実行後に任意のパスワードを入力してください。
暗号化実施時には「resnet50-v1-12.dat」(ONNXモデルを暗号化したもの)を出力し
復号化実施時には「resnet50-v1-12.dat」を読み込みます。
```bash
python encrypt_sample.py
Password:
```
```bash
python decrypt_sample.py
Password:
```
# Reference
* [pyca/cryptography](https://github.com/pyca/cryptography)
# Author
高橋かずひと(https://twitter.com/KzhtTkhs)
# License
onnx-model-encrypt-sample is under [Apache-2.0 License](LICENSE).