Git Product home page Git Product logo

tzmon's Introduction

DOI

TZMon: Improving mobile game security with ARM trustzone

The TZMon is the security framework for a mobile game application.

This framework is specially designed for an integrity check, secure update, abusing detection, data hiding, and timer synchronization using ARM TrustZone.

TZMon uses AOSP(Android Open Source Project) as a Normal OS and OPTEE as a Secure OS.

Target Board is hikey960. Refer to the link for more information. [here]

There are two modes for TZMon; SIM_MODE, and TARGET_MODE.

A TARGET_MODE use hikey960 board as a mobile environment. SIM_MODE can make applying and verifying TZMon easy.

The simulation environments are as like below:

  • Mobile Game Apps (including TZMon library): Android Studio Simulator
  • TZMon Trusted Application: hikey960 board
  • S2B (for connection with the simulator and the target board): Linux machine (independent of kernel version and linux distro)
  • Update Server (for secure update protocol): Linux machine (independent of kernel version and linux distro)

Getting Started with tzMon

Prerequisites

  • Preparing for the mobile game source code.
  • Applying the JNI environment to the game.
  • Adding permission option to the AndroidManifest.xml file.
  <uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" tools:ignore="ProtectedPermissions" />
  <uses-permission android:name="android.permission.INTERNET" />
  • Allowing usage access in the smart-phone or simulator.

  • Execution update_server and S2B. (for SIM_MODE): update_server and s2b are running on linux machine. Two application must use same port number
  ./update_server [port_number]
  ./s2b_server [port_number]

Usage

  1. Loading the TZMon library formed as JNI.
  static {
    System.loadLibrary("tzMonJNI");
  }
  1. Declaration of TZMon API to the game source and compile game source.
  public native boolean tzmonInitKeyNFlag();
  public native boolean tzmonCheckAppHash();
  public native boolean tzmonSecureUpdate();
  public native boolean tzmonAbusingDetection();
  public native boolean tzmonSyncTimer();
  public native boolean tzmonHidingSetup();
  public native int tzmonGetHKey(String data);
  1. Create app/src/main/include directory and copy openssl and optee directories.
  2. Create app/src/main/libs and jni directory.
  3. Create app/src/main/jni/armeabi-v7a and x86 and copy libcrypto.a, libssl.a libteec.a files.

  1. Compile mobile game. (ctrl + F9)
  2. Execution of javac to create JNI header file. (If success, it creates header file in jni directiry)
  3. Create Android.mk file
# Android.mk
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE := ssl
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libssl.a
LOCAL_EXPORT_C_INCLUDES := include
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := crypto
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libcrypto.a
LOCAL_EXPORT_C_INCLUDES := jni/include
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := teec
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libteec.a
LOCAL_EXPORT_C_INCLUDES := jni/include
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := tzMonJNI
LOCAL_SRC_FILES := tzmonMain.cpp
LOCAL_SRC_FILES += tzmonCrypto.cpp
LOCAL_SRC_FILES += tzmonSocket.cpp
LOCAL_SRC_FILES += tzmonUtil.cpp
LOCAL_SRC_FILES += tzmonTEEC.cpp
LOCAL_CFLAGS := -DSIM_MODE
LOCAL_CFLAGS += -DUSE_FIXAPPHASH
LOCAL_LDLIBS := -llog
LOCAL_LDLIBS += -ldl
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_STATIC_LIBRARIES += ssl
LOCAL_STATIC_LIBRARIES += crypto
LOCAL_STATIC_LIBRARIES += teec
include $(BUILD_SHARED_LIBRARY)
  1. Copy TZMon library source code in the jni directory. Refer to the link

Publications

Jeon, S., & Kim, H. K. (2021). TZMon: Improving mobile game security with ARM trustzone. Computers & Security, 102391.

@article{jeon2021tzmon,
  title={TZMon: Improving mobile game security with ARM trustzone},
  author={Jeon, Sanghoon and Kim, Huy Kang},
  journal={Computers \& Security},
  pages={102391},
  year={2021},
  publisher={Elsevier}
}

About

This program is authored and maintained by Sanghoon Jeon.

Email: [email protected]

GitHub@kppw99

tzmon's People

Contributors

kppw99 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.