dneprDroid / tfsecured

Small library for TensorFlow proto model's (*.pb) encryption/decryption
MIT License
81 stars 20 forks source link

TFSecure for Android #6

Open abi98213 opened 4 years ago

abi98213 commented 4 years ago

Hello ! Thank you for this great implementation. How can use the encrypted model in android ? It would be great

dneprDroid commented 4 years ago

I'll add an android example later. That's very simple: 1) just try android projects with statically linked Tensorflow NDK library: https://github.com/search?q=filename%3AAndroid.mk+static+tensorflow.a 2) and add TFSecured dir (source files) to Android.mk 3) and call C++ code from TFSecured

It's possible to rewrite TFSecured via Java and Tensorflow Java API, but it's less secure because disassembling and intercepting/hooking calls of Java code is much easier, than analyzing assembler code from .so binaries. The encryption key of your model can be easily intercepted via Xposed or Frida if you use only Java.