Android PIN Code Protection via JNI Layer Separation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Android platform's PIN code encryption logic is vulnerable to interception when transmitted from the Java layer to the C layer due to ease of decompiling and analysis of the user interface, which compromises security.

Innovation Solution

Implementing a method that uses the Java Native Interface (JNI) to interact between the Java and C layers, generating a password-storage-class-instance, and employing encryption and decryption events to securely handle PIN code input and storage, ensuring the PIN code is not intercepted during transmission.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If the PIN code is transmitted from the Java layer to the C layer for encryption, then the encryption function can be implemented, but the PIN code may be intercepted during transmission

Engineering Contradiction:
ImprovePIN code securityVSAvoidinterception risk
Core Design Contradiction:
ReliabilityVSObject-affected harmful factors

Solution Approach 1:

The patent extracts the PIN code data from the Java layer and processes it through the JNI interface to the C layer, separating the data input function (Java) from the encryption function (C). This extraction allows the PIN code to be securely transmitted only when needed for encryption, rather than being continuously exposed in the Java layer.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The JNI (Java Native Interface) acts as an intermediary between the Java layer and C layer. It provides a controlled transmission channel that allows the PIN code to be passed securely from Java to C for encryption, preventing direct exposure while maintaining the necessary communication between layers.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Difficulty of detecting and measuring

If the PIN code encryption logic is placed on the C layer, then decompiling and analysis become difficult, but the PIN code transmission from Java to C layer remains vulnerable

Engineering Contradiction:
Improvedecompiling difficultyVSAvoidtransmission interception
Core Design Contradiction:
Difficulty of detecting and measuringVSObject-affected harmful factors

Solution Approach 1:

The patent segments the PIN code handling process into distinct phases: input in Java layer, controlled transmission via JNI, and encryption in C layer. This segmentation ensures that each layer performs its specific function without exposing the PIN code unnecessarily, making both decompiling and interception more difficult.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent implements preliminary security measures by establishing the JNI interface and encryption framework before the PIN code is actually transmitted. The C layer is prepared with encryption logic in advance, so that when the PIN code arrives via JNI, it is immediately processed securely without being exposed in the Java layer.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS10628607B2Method for protecting pin code on android platform
Publication Date: 2020.04.21 FEITIAN TECHNOLOGIES CO LTD
  • US10628607B2 patent drawing
  • US10628607B2 patent drawing
  • US10628607B2 patent drawing

AI summary

The disclosure provides a method for protecting PIN code on Android platform, including: introducing, by Java layer, start event to C layer after invoked by upper layer; invoking, by C layer, Java layer via JNI to generate a password-storage-class-instance after receiving start event, and invoking Java layer after receiving a handle returned by Java layer to monitor input from user; storing, by Java layer, PIN code data into a instance memory when Java layer monitors PIN code data from user, updating storage location identification, and introducing encrypting event to C layer; introducing, by Java layer, confirming event to C layer when Java layer monitors confirmation information from user; accessing, by C layer, the instance via handle to encrypt the PIN code data when receiving encrypting event; and accessing, by C layer, the instance via handle to decrypt the encrypted data in instance memory to obtain PIN code.