# US 2018/0025177 A1 · Method for protecting pin code on android platform

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2018/0025177 A1
- Document ID: US20180025177A1
- Status: Published application
- Kind: A1
- Application number: 15/710,590
- Filed: 2017-09-20
- Published: 2018-01-25
- Earliest claimed: 2015-04-22
- Assignees: Feitian Technologies Co., Ltd.
- Applicants: Feitian Technologies Co., Ltd.
- Inventors: ZHOU LU; HUAZHANG YU
- Web page: https://patentgrep.com/patent/US20180025177A1

## CPC

- G06F 21/6245: {Protecting personal data, e.g. for financial or medical purposes}
- G06F 21/31: User authentication
- G06F 21/602: {Providing cryptographic facilities or services}
- G06F 21/78: to assure secure storage of data (address-based protection against unauthorised use of memory G06F12/14; record carriers for use with machines and with at least a part designed to carry digital markings G06K19/00)
- G06F 21/83: input devices, e.g. keyboards, mice or controllers thereof
- H04L 9/3226: {using a predetermined code, e.g. password, passphrase or PIN (network architectures or network communication protocols for supporting authentication of entities using passwords in a packet data network H04L63/083)}
- H04L 9/3228: {One-time or temporary data, i.e. information which is sent for every authentication or authorization, e.g. one-time-password, one-time-token or one-time-key}
- G06F 2221/031: Protect user input by software means
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

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.

## Claims

### Claim 1

A method for protecting a personal identification number (PIN code) on an Android platform, comprising:
step S1) invoking, by a Java layer, a C layer via a Java native interface (JNI), and introducing a start event to the C layer;
step S2) invoking, by the C layer, the Java layer via the JNI after the start event is received by the C layer;
step S3) generating, by the Java layer, a password-storage-class-instance, and returning a handle of the password-storage-class-instance to the C layer;
step S4) invoking, by the C layer, the Java layer via the JNI after the handle of the password-storage-class-instance is received by the C layer;
step S5) monitoring, by the Java layer, input from a user; if it is monitored that PIN code data is input by the user, storing the PIN code data currently input by the user into a data memory of the password-storage-class-instance, and updating a storage location identification in the password-storage-class-instance, invoking the C layer via the JNI, introducing an encrypting event to the C layer, and executing step S6; if it is monitored that confirmation information is input by the user, invoking the C layer via the JNI, introducing a confirming event to the C layer, and executing step S7;
step S6) accessing, by the C layer, the password-storage-class-instance via the handle of the password-storage-class-instance, looking up the PIN code data currently input by the user according to the storage location identification in the password-storage-class-instance, encrypting the found PIN code data currently input by the user to obtain current encrypted data, storing the current encrypted data into the data memory of the password-storage-class-instance, deleting the found PIN code data currently input by the user, and returning to the step S5;
step S7) accessing, by the C layer, the password-storage-class-instance according to the handle of the password-storage-class-instance, and decrypting all of the encrypted data stored in the data memory of the password-storage-class-instance to obtain a PIN code input by the user.

### Claim 2 (depends on 1)

The method as claimed in claim 1, wherein, before the step S5, the method further comprises:
displaying, by the Java layer, an interface for user inputting by invoking a display function in the password-storage-class-instance;
the monitoring, by the Java layer, the input from the user comprises: monitoring, by the password-storage-class-instance of the Java layer, the input from the user.

### Claim 3 (depends on 1)

The method as claimed in claim 1, wherein, before the step S5, the method further comprises:
generating, by the Java layer, a password-keyboard-class-instance, relating the password-keyboard-class-instance to the password-storage-class-instance, and invoking a display function in the password-keyboard-class-instance to display an interface for user inputting.

### Claim 4 (depends on 1)

The method as claimed in claim 1, wherein, the step S1 further comprises:
generating, by the Java layer, a password-keyboard-class-instance, and invoking a display function in the password-keyboard-class-instance to display an interface for user inputting;
before the step S5, the method further comprises: relating, by the Java layer, the password-keyboard-class-instance to the password-storage-class-instance.

### Claim 5 (depends on 3)

The method as claimed in claim 3, wherein, the monitoring, by the Java layer, the input from the user comprises:
monitoring, by the password-keyboard-class-instance of the Java layer, the input from the user;
the storing the PIN code data currently input by the user into the data memory of the password-storage-class-instance, and updating the storage location identification of the password-storage-class-instance comprises:
invoking, by the password-keyboard-class-instance of the Java layer, the password-storage-class-instance, storing the PIN code data currently input by the user into the data memory of the password-storage-class-instance, and updating the storage location identification in the password-storage-class instance.

### Claim 6 (depends on 1)

The method as claimed in claim 1, wherein, the step S5 further comprises:
if the Java layer monitors cancel information being input by the user, invoking the C layer via the JNI and introducing a cancel event to the C layer; accessing, by the C layer, the password-storage-class-instance according to the handle of the password-storage-class-instance after the cancel event is received by the C layer, and deleting all of the encrypted data in the data memory of the password-storage-class-instance.

### Claim 7 (depends on 6)

The method as claimed in claim 6, wherein, after the step S7, the method further comprises:
invoking, by the C layer, the Java layer via the JNI, and releasing, by the Java layer, the password-storage-class-instance;
after the accessing, by the C layer, the password-storage-class-instance according to the handle of the password-storage-class-instance, and deleting all of the encrypted data in the data memory of the password-storage-class-instance, the method further comprises:
invoking the Java layer via the JNI, and releasing, by the Java layer, the password-storage-class-instance.

### Claim 8 (depends on 1)

The method as claimed in claim 1, wherein, the step S5 further comprises:
if the Java layer monitors deleting information being input by the user, looking up and deleting the latest PIN code data input by the user according to the storage location identification after the storage location identification in the password-storage-class-instance is decreased progressively, and returning to the step S5.

### Claim 9 (depends on 1)

The method as claimed in claim 1, wherein, the encrypting the found PIN code data currently input by the user comprises:
encrypting the found PIN code data currently input by the user by using a pre-stored key according to a preset algorithm after the found PIN code data currently input by the user is filled with a random number;
the decrypting all of the encrypted data stored in the data memory of the password-storage-class-instance comprises:
decrypting all of the encrypted data stored in the data memory of the password-storage-class-instance by using the pre-stored key according to the preset algorithm.

### Claim 10 (depends on 1)

The method as claimed in claim 1, wherein, after the C layer receives the start event, the method further comprises:
generating a current key;
the encrypting the found PIN code data currently input by the user comprises:
encrypting the found PIN code data currently input by the user by using the current key according to a preset algorithm after the found PIN code data is filled with a random number;
the decrypting all of the encrypted data stored in the data memory of the password-storage-class-instance comprises:
decrypting all of the encrypted data stored in the data memory of the password-storage-class-instance by using the current key according to the preset algorithm;
after all of the encrypted data stored in the data memory of the password-storage-class-instance is decrypted to obtain the PIN code input by the user, the method further comprises:
deleting the current key.

### Claim 11 (depends on 1)

The method as claimed in claim 1, wherein after all of the encrypted data stored in the data memory of the password-storage-class-instance is decrypted to obtain the PIN code input by the user, the method further comprises:
sending the PIN code input by the user to a smart key device for authentication.

### Claim 12 (depends on 1)

The method as claimed in claim 1, wherein, the storing the current encrypted data into the data memory of the password-storage-class-instance, and deleting the found PIN code data currently input by the user, comprises:
covering the found PIN code data currently input by the user with the current encrypted data.

### Claim 13 (depends on 1)

The method as claimed in claim 1, wherein before the Java layer invokes the C layer via the JNI and introduces the encrypting event to the C layer, the method further comprises:
determining, by the Java layer, whether a length of data to be encrypted reaches a preset length, if yes, invoking the C layer and introducing the encrypting event to the C layer;
otherwise, returning to the step S5;
after the Java layer stores the PIN code data currently input by the user into the data memory of the password-storage-class-instance, the method further comprises:
updating the length of the data to be encrypted;
after the Java layer invokes the C layer via the JNI and introduces the confirming event to the C layer, the method further comprises:
initializing, by the Java layer, the length of the data to be encrypted.

### Claim 14 (depends on 1)

The method as claimed in claim 1, wherein after all of the encrypted data stored in the data memory of the password-storage-class-instance is decrypted to obtain the PIN code input by the user, the method further comprises:
deleting all of the encrypted data.

### Claim 15 (depends on 14)

The method as claimed in claim 14, wherein the deleting all of the encrypted data comprises:
updating all of the encrypted data stored in the data memory of the password-storage-class-instance as preset data.

### Claim 16 (depends on 14)

The method as claimed in claim 14, wherein the deleting all of the encrypted data comprises:
updating all of the encrypted data stored in the data memory of the password-storage-class-instance as random numbers.
