Android PIN Code Protection via JNI Layer Separation
Find Innovative SolutionsGenerate 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
Engineering 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
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.
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.
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
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.
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.
Data Source
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.


