Method for realizing Android virtual keyboard based on hardware protection, virtual keyboard and medium
By employing a hardware-protected secure keyboard SDK in the Android system and implementing two-way authentication and encryption with the server, the security shortcomings of virtual keyboards are resolved, achieving a higher level of security and privacy protection.
Patent Information
- Application Number
- CN202411053698.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2024-11-26
AI Technical Summary
The existing virtual keyboard in Android systems has security deficiencies when inputting sensitive data. These include the default keyboard being vulnerable to side-channel attacks, risks associated with key generation and storage, and the risk of plaintext information leakage during the initialization process. Furthermore, the software-based keystore system is easily cracked.
A hardware-protected secure keyboard SDK is used for two-way authentication with the server. The secure keyboard key is obtained and imported through a secure channel, the encrypted keyboard UI is rendered, and the encrypted key values entered by the user are recorded. The hardware-protected keystore system is used for encryption and decryption.
It improves the security of virtual keyboards, prevents key leakage and plaintext information from being obtained by hook programs, enhances the ability to resist attacks, and ensures the security and privacy protection of input information.
Smart Images

Figure CN119026189A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of financial security communications, and more specifically, relates to a method for implementing an Android virtual keyboard based on hardware protection, a virtual keyboard and a medium. Background Art
[0002] In today's increasingly digital production and life, Soft POS is becoming a common payment terminal. SoftPOS is a new payment collection channel that uses smartphones or tablets as payment terminals, and the secure keyboard is an indispensable part of the SoftPOS solution, which is used to receive the cardholder's PIN or PAN input and provide sufficient and reliable security for the user's input information. In addition, various banking applications, payment applications, etc. have a strong dependence on secure keyboards, so a sufficiently secure and technically mature virtual keyboard solution is urgently needed.
[0003] Using the default keyboard of the Android system as the input interface for sensitive data can easily lead to sensitive data leakage. First, the layout of the default keyboard is regular, which is vulnerable to side channel attacks; second, the input information is not encrypted, and it is easy for the hook program to obtain the input plaintext information, thus leading to information leakage.
[0004] Even if ordinary custom virtual keyboards have randomly arranged key layouts and may encrypt user input information based on certain cryptographic methods, this level of security keyboard still cannot solve two important security weaknesses: one is the generation and storage of keys. Even if the keys are hard-coded into the SO layer, they are still at risk of being decompiled and cracked; second, the keyboard key initialization process must include the process of establishing a mapping relationship between the plaintext key value and the key index. If this process is monitored by a hook program or a Trojan program, the plaintext value of the key can still be obtained, resulting in information leakage.
[0005] At present, some secure keyboards adopt the Android keystore system as a secure keyboard solution for key storage and encryption and decryption services. This type of solution has a higher security level, but it lacks the corresponding secure keyboard server and does not identify whether the current system uses a hardware-protected keystore. The keystore based on software implementation can be cracked through the root device. This is one reason. Secondly, similarly, because there is no server to initialize the keyboard layout, the mapping relationship between the plaintext key value and the key index included in the secure keyboard initialization process is still at risk of being hooked and cracked. Summary of the invention
[0006] In view of the above defects or improvement needs of the prior art, the present invention proposes a method for implementing an Android virtual keyboard based on hardware protection, a virtual keyboard and a medium, and implements a set of Android virtual keyboard solutions based on hardware protection with higher security.
[0007] To achieve the above object, according to one aspect of the present invention, a method for implementing an Android virtual keyboard based on hardware protection is provided, comprising:
[0008] The secure keyboard SDK performs two-way authentication with the secure keyboard server, and after the two-way authentication is completed, a secure channel is established between the secure keyboard SDK and the secure keyboard server;
[0009] Through the secure channel, the secure keyboard SDK obtains the secure keyboard key and secure keyboard configuration issued by the secure keyboard server;
[0010] The secure keyboard SDK imports the secure keyboard key through a keystore interface based on hardware protection, and renders a secure keyboard UI based on the secure keyboard key and the secure keyboard configuration;
[0011] The secure keyboard SDK receives key information input by the user, records and outputs key value ciphertext encrypted by the secure keyboard key.
[0012] In some optional implementation schemes, the secure keyboard SDK performs two-way authentication with the secure keyboard server, including:
[0013] After the secure keyboard SDK confirms that the requested secure keyboard server is a real and credible server through the preset certificate signature information of the secure keyboard server, it requests a random number from the secure keyboard server, and carries the identity information of the secure keyboard SDK, so that the secure keyboard server verifies the identity of the secure keyboard SDK by verifying the identity information, and after the verification is passed, the secure keyboard server obtains the random number, generates a true random number through the encryption machine interface, and returns the true random number to the secure keyboard SDK, wherein the identity information includes the application package name information and keystore signature information of the secure keyboard SDK configured by the secure keyboard server, and the Google official root public key is configured in the secure keyboard server;
[0014] The secure keyboard SDK generates an RSA public-private key pair based on the hardware-protected keystore system, and issues a certificate to generate certificate chain information for the RSA public-private key pair based on the true random number and the system built-in root certificate of the Android device, and sends the certificate chain information to the secure keyboard server to request the secure keyboard server to issue a secure keyboard key, so that the secure keyboard server uses the Google official root public key to verify the certificate chain information, and after parsing the certificate chain information to obtain the true random number and the keystore system for hardware support determination information, the secure keyboard server generates the secure keyboard key and the transmission protection key based on the encryption machine interface, encrypts the secure keyboard key with the transmission protection key, and then uses the certificate chain information to retrieve the RSA public key, encrypts the transmission protection key with the RSA public key, and encapsulates the encrypted ciphertext key and returns it to the secure keyboard SDK, wherein the certificate chain information includes the true random number and the determination information of whether the current keystore system is based on hardware support, and the encrypted ciphertext key includes the encrypted secure keyboard key and the encrypted transmission protection key;
[0015] The secure keyboard SDK imports the ciphertext key into the keystore key system supported by the hardware, and encapsulates the KMS service based on the keystore interface to provide encryption and decryption interface services.
[0016] In some optional implementation schemes, after sending the certificate chain information to the secure keyboard server to request the secure keyboard server to issue a secure keyboard key, the method further includes:
[0017] The certificate chain information is sent to the secure keyboard server, so that the secure keyboard server compares whether the true random number sent by the secure keyboard server to the secure keyboard SDK is consistent with the true random number sent by the secure keyboard SDK to the secure keyboard server, and determines whether the environment of the secure keyboard SDK is a keystore system based on hardware support. When the true random number sent by the secure keyboard server to the secure keyboard SDK is inconsistent with the true random number sent by the secure keyboard SDK to the secure keyboard server, the secure keyboard SDK is deemed to be illegal. After determining that the environment of the secure keyboard SDK is not a keystore system based on hardware support, it is determined that the security conditions of the secure keyboard SDK are not met, an error message is returned to the secure keyboard SDK, and any other subsequent interface services are rejected.
[0018] In some optional implementation schemes, the secure keyboard SDK obtains the secure keyboard key and secure keyboard configuration issued by the secure keyboard server through the secure channel, including:
[0019] The secure keyboard SDK requests the secure keyboard server to send a secure keyboard key and a secure keyboard configuration, so that the secure keyboard server initializes the key arrangement of the secure keyboard, establishes an index relationship between key positions, key values, and key image resources, and uses the secure keyboard key to encrypt the key values and key image resources, randomly shuffles the encrypted keys, and returns the randomized key information as the secure keyboard configuration to the secure keyboard SDK.
[0020] In some optional implementation schemes, the secure keyboard SDK imports the secure keyboard key through a hardware-protected keystore interface, and renders a secure keyboard UI based on the secure keyboard key and the secure keyboard configuration, including:
[0021] The secure keyboard SDK initializes the secure keyboard UI and uses RecycleView or GridView as a key container;
[0022] After decrypting the key image resources using the KMS decryption service and drawing the key UI using the Graphic interface, the entire secure keyboard UI with randomly arranged keys is displayed and the system is prohibited from taking screenshots or recording screens.
[0023] In some optional implementation schemes, the secure keyboard SDK receives key information input by a user, records and outputs key value ciphertext encrypted by the secure keyboard key, including:
[0024] The secure keyboard SDK receives key information input by the user, records the key ciphertext value triggered by the user, and after the user completes the input, splices the overall input ciphertext in the order of the user input and outputs it.
[0025] In some optional implementation schemes, before the secure keyboard security configuration is issued by the secure keyboard server, the secure keyboard server encapsulates the KMS encryption and decryption interface service based on the hardware encryption machine interface.
[0026] In some optional implementation schemes, the step of splicing and outputting the entire input ciphertext in the order of user input includes:
[0027] After obtaining the complete ciphertext value of the keystroke triggered by the user, request decryption from the secure keyboard server, so that the secure keyboard server uses the KMS based on the encryption machine interface to decrypt and obtain the plaintext value input by the user;
[0028] Alternatively, after obtaining the complete ciphertext value of the keystroke triggered by the user, a decryption request is made to the secure keyboard SDK, and the KMS interface based on the hardware keystore is used for decryption to obtain the plaintext value input by the user.
[0029] According to another aspect of the present invention, there is provided an Android virtual keyboard based on hardware protection, comprising: a secure keyboard SDK, wherein the secure keyboard SDK is used to execute the steps of any one of the above methods.
[0030] According to another aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of any one of the above methods are implemented.
[0031] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects compared with the prior art:
[0032] The present invention uses a key management system based on security chip protection, encapsulates a set of security keyboard SDK modules, combines with the security keyboard server service developed based on the hardware encryption machine, establishes a secure channel between the two parties, generates and sends security keyboard keys and security keyboard configurations by the security keyboard server, and the security keyboard SDK renders and generates a security keyboard UI and records user input information in ciphertext, thus forming a set of Android virtual keyboard solutions based on hardware protection, which has better security. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a flowchart of a method for implementing an Android virtual keyboard based on hardware protection provided by an embodiment of the present invention;
[0034] Figure 2 This is a schematic diagram of a secure channel establishment process provided by an embodiment of the present invention;
[0035] Figure 3 This is a schematic diagram of a secure keyboard UI rendering and input monitoring recording process provided by an embodiment of the present invention;
[0036] Figure 4 It is a complete flow chart of completing input and decryption using a secure keyboard SDK in a normal manner provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0038] The technical terms used in the present invention are as follows:
[0039] SDK Software Development Kit Software Development Kit
[0040] UI User Interface
[0041] KMS Key Management System
[0042] DER Distinguished Encoding Rules
[0043] TLS Transport Layer Security
[0044] SSL Secure Socket Layer
[0045] RSA is an internationally accepted public key cryptographic system and asymmetric encryption and decryption algorithm.
[0046] AES Advanced Encryption Standard is an advanced encryption standard, a symmetric encryption algorithm
[0047] POS Point of Sale Multifunctional Sales Terminal
[0048] PIN Personal Identification Number Personal Identification Number
[0049] PAN Primary Account Number Trading account primary account number
[0050] The present invention provides a complete set of solutions, including a secure keyboard SDK, a corresponding secure keyboard server, and completes the establishment of a secure channel based on two-way authentication. The secure keyboard server sends a secure keyboard key and a secure keyboard configuration, and the secure keyboard SDK imports the key, renders and displays the keyboard UI according to the configuration, monitors the key information input by the user, records the key ciphertext and outputs the final output ciphertext, and the secure keyboard SDK and the secure keyboard server provide a decryption interface service.
[0051] like Figure 1 FIG. 1 is a flow chart of a method for implementing an Android virtual keyboard based on hardware protection provided by an embodiment of the present invention. Figure 1 The method shown includes the following steps:
[0052] S101: The secure keyboard SDK performs two-way authentication with the secure keyboard server, and after the two-way authentication is completed, a secure channel is established between the secure keyboard SDK and the secure keyboard server;
[0053] S102: The secure keyboard SDK obtains the secure keyboard key and secure keyboard configuration sent by the secure keyboard server through the secure channel;
[0054] S103: The secure keyboard SDK imports the secure keyboard key through the keystore interface based on hardware protection, and renders the secure keyboard UI based on the secure keyboard key and the secure keyboard configuration;
[0055] S104: The secure keyboard SDK receives key information input by the user, records and outputs the key value ciphertext encrypted by the secure keyboard key.
[0056] Furthermore, if Figure 2 As shown, the process of establishing a secure channel of the present invention comprises the following steps:
[0057] 1. The secure keyboard SDK presets the TLS certificate signature information of the secure keyboard server;
[0058] 2. The secure keyboard server configuration integrates the application package name information of the secure keyboard SDK and the keystore signature information used to sign the application;
[0059] 3. The secure keyboard server is configured with the Google official root public key, and regularly checks and updates the Google official root public key;
[0060] 4. The secure keyboard SDK is initialized and requests a random number from the secure keyboard server (also known as the server), along with the secure keyboard SDK's own identity information (package name and signature information). The secure keyboard SDK uses the technical means of certificate locking (SSL / TLS Pinning) to confirm that the requested server is a genuine and credible server. The server verifies the identity of the secure keyboard SDK by verifying the identity information transmitted by the secure keyboard SDK.
[0061] 5. After verification, the server generates a true random number through the KMS encryption machine interface;
[0062] 6. Return the true random number from the server to the secure keyboard SDK;
[0063] 7. The secure keyboard SDK generates an RSA public and private key pair based on the hardware-protected keystore system and issues a certificate for the public key based on the server-side random number and the system-built-in root certificate of the Android device. The certificate contains the true random number obtained in the previous step and the determination information of whether the current keystore system is based on hardware support;
[0064] 8. The secure keyboard SDK sends the certificate chain information to the server and requests the secure keyboard key to be issued;
[0065] 9. The server uses the configured Google root public key to verify the certificate chain sent by the secure keyboard SDK layer by layer, and parses the certificate information to obtain the true random number previously sent by the server, as well as the determination information of whether the keystore system is hardware-supported. The server compares the true random number previously sent to the secure keyboard SDK with the true random number sent by the secure keyboard SDK. If the comparison fails, the secure keyboard SDK is deemed to be illegal. The server determines whether the secure keyboard SDK environment is a hardware-backed keystore system. If not, the secure keyboard SDK is deemed to have failed to meet the security conditions, returns an error message, and refuses any subsequent interface services.
[0066] 10. If the conditions of the secure keyboard SDK are met in the previous step, the server starts to generate a secure keyboard key and an AES session key based on the encryption machine interface service;
[0067] 11. The server uses the AES session key to encrypt the secure keyboard key, then uses the certificate information sent by the secure keyboard SDK to retrieve the RSA public key, and uses the RSA public key to encrypt the AES session key;
[0068] 12. The server encapsulates the encrypted ciphertext into a wrapped key ciphertext according to the DER sequence encoding method and returns it to the secure keyboard SDK. The encrypted ciphertext key includes the encrypted secure keyboard key and the encrypted transmission protection key.
[0069] 13. The secure keyboard SDK uses the WrappedKeyEntry interface to import ciphertext keys directly into the hardware-supported keystore key system;
[0070] During the entire key transmission and key import process, no plaintext key material appears, and security is fully guaranteed.
[0071] 14. The secure keyboard SDK encapsulates the KMS service based on the keystore interface and provides encryption and decryption interface services.
[0072] like Figure 3 The figure shows the UI rendering and user input monitoring and recording process of the present invention. The triggering of the process must be based on the establishment of a secure channel, and includes the following steps:
[0073] 1. The secure keyboard SDK requests the secure keyboard server to send the secure keyboard configuration;
[0074] 2. The server initializes the key layout and establishes the index relationship between key positions, key values, and key image resources;
[0075] 3. The server uses the secure keyboard key to encrypt the key value and key image resources;
[0076] 4. The server randomly shuffles the encrypted key list and returns the randomized key list information as the secure keyboard configuration to the secure keyboard SDK.
[0077] 5. The secure keyboard SDK initializes the secure keyboard UI and uses RecycleView or GridView as the key container;
[0078] 6. The secure keyboard SDK decrypts the key image resources by using the KMS decryption service and uses the Graphic interface to dynamically draw the key UI;
[0079] There is no plain text key value here. Only the binary data of the image appears in the memory and cannot be intuitively identified.
[0080] 7. After the secure keyboard SDK is rendered, the entire secure keyboard UI with randomly arranged keys will be displayed and the system will be prohibited from taking screenshots or recording screens;
[0081] 8. The secure keyboard SDK monitors key click events. When the user triggers an input event, the secure keyboard SDK records the ciphertext value of the key click triggered by the user;
[0082] 9. After the user completes the input, the secure keyboard SDK outputs the ciphertext value of the complete user input information.
[0083] like Figure 4 The following is a complete process of using the secure keyboard SDK to complete input and decryption, including the following steps:
[0084] 1. The secure keyboard SDK requests the server to send the secure keyboard configuration information;
[0085] 2. The server generates secure keyboard configuration information;
[0086] Among them, it should be noted that the sending of the secure keyboard configuration can be silently triggered in the background of the secure keyboard configuration information SDK in advance, so that the caller can instantly render successfully when calling to display the secure keyboard, avoiding delays and waiting due to network reasons. The specific sending timing is not elaborated in the present invention.
[0087] 3. The server returns the secure keyboard configuration information to the secure keyboard SDK;
[0088] 4. The secure keyboard SDK caller (usually an Android application that has integrated the SDK) calls the secure keyboard SDK to display the secure keyboard interface;
[0089] 5. The secure keyboard SDK loads the latest secure keyboard configuration information and completes UI rendering;
[0090] 6. The secure keyboard SDK displays the secure keyboard and prohibits the system from taking screenshots and recording the current interface;
[0091] 7. The user enters information, triggering the key events monitored by the secure keyboard SDK;
[0092] 8. The secure keyboard SDK monitors user key events through the callback interface and records the corresponding key ciphertext information;
[0093] 9. After the user completes all input, the secure keyboard SDK outputs the complete ciphertext value of the user input information;
[0094] 10. After the user obtains the complete ciphertext of the input information, he can choose to use the SDK decryption interface for decryption; he can also use the server-side decryption interface service for decryption.
[0095] Among them, the secure keyboard SDK encapsulates the KMS encryption and decryption interface service based on the hardware-protected keystore interface; the server encapsulates the KMS encryption and decryption interface service based on the hardware encryption machine interface.
[0096] At this time, it is usually recommended to use the server interface for decryption, and the decryption of user sensitive information is preferably not performed on the client, but it is recommended to transmit the ciphertext information to the business system background, and through the background interface docking, the server calls the decryption interface on the server to decrypt. This invention will not be repeated.
[0097] The present application provides an implementation of an Android virtual keyboard system based on hardware protection, including: a hardware-based keystore system on the Android device side, which provides key import and encryption and decryption services; a secure keyboard SDK, which is responsible for rendering the secure keyboard UI, monitoring and recording the ciphertext of user input information; and a secure keyboard server. A secure channel needs to be established between the secure keyboard SDK and the secure keyboard server based on two-way authentication. The secure keyboard server generates and sends the secure keyboard key and secure keyboard configuration. The secure keyboard SDK imports the key through the hardware-protected keystore interface, and renders the secure keyboard UI through the secure keyboard configuration. The rendering and information recording of the secure keyboard are encrypted based on the secure keyboard key. The secure keyboard SDK and the secure keyboard server provide a keyboard input information decryption interface service.
[0098] Furthermore, the Android device side needs to include a keystore system based on hardware protection. The secure keyboard SDK and secure keyboard server of the present invention will exclude non-hardware-protected devices during the secure channel establishment phase. As an Android device side module, the secure keyboard SDK prohibits the device side from recording and taking screenshots of the secure keyboard interface.
[0099] Furthermore, the secure keyboard server includes a KMS service interface based on a hardware encryption system or soft algorithm, provides the ability to generate and encrypt keyboard keys, and implements configuration management of the secure keyboard SDK integrator (that is, the application that integrates the SDK), such as configuring the package name, keystore signature information for signing the application, etc.
[0100] Furthermore, a secure channel needs to be established between the secure keyboard SDK and the secure keyboard server to complete the distribution of the secure keyboard key generated by the secure keyboard server to ensure encryption and decryption services for subsequent secure keyboard input information. The establishment of the secure channel is based on TLS encrypted two-way authentication to ensure that the identities of both parties in the communication are authentic.
[0101] Furthermore, the secure keyboard SDK presets the certificate signing information of the secure keyboard server and authenticates the secure keyboard server through the SSL / TLSPinning certificate locking method; the secure keyboard server configures the package name of the application where the secure keyboard SDK is located, as well as the keystore signature information used to sign the application, and the secure keyboard server uses this to authenticate the identity of the secure keyboard SDK, thereby completing two-way authentication.
[0102] Furthermore, the secure keyboard server needs to pre-install the Google official root public key and regularly check and update the Google official root public key to verify the certificate chain information reported by the secure keyboard SDK and identify whether the device environment where the secure keyboard SDK is located is authentic and trustworthy and whether a hardware-backed keystore system is applied.
[0103] The present application also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a disk, an optical disk, a server, an App application store, etc., on which a computer program is stored. When the program is executed by a processor, a method for implementing an Android virtual keyboard based on hardware protection in a method embodiment is implemented.
[0104] It should be pointed out that, according to the needs of implementation, the various steps / components described in this application can be split into more steps / components, and two or more steps / components or partial operations of steps / components can be combined into new steps / components to achieve the purpose of the present invention.
[0105] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for implementing an Android virtual keyboard based on hardware protection, characterized in that: include: The secure keyboard SDK performs two-way authentication with the secure keyboard server, and after the two-way authentication is completed, a secure channel is established between the secure keyboard SDK and the secure keyboard server; Through the secure channel, the secure keyboard SDK obtains the secure keyboard key and secure keyboard configuration issued by the secure keyboard server; The secure keyboard SDK imports the secure keyboard key through a keystore interface based on hardware protection, and renders a secure keyboard UI based on the secure keyboard key and the secure keyboard configuration; The secure keyboard SDK receives key information input by the user, records and outputs key value ciphertext encrypted by the secure keyboard key.
2. The method according to claim 1, characterized in that The secure keyboard SDK performs two-way authentication with the secure keyboard server, including: After the secure keyboard SDK confirms that the requested secure keyboard server is a real and credible server through the preset certificate signature information of the secure keyboard server, it requests a random number from the secure keyboard server, and carries the identity information of the secure keyboard SDK, so that the secure keyboard server verifies the identity of the secure keyboard SDK by verifying the identity information, and after the verification is passed, the secure keyboard server obtains the random number, generates a true random number through the encryption machine interface, and returns the true random number to the secure keyboard SDK, wherein the identity information includes the application package name information and keystore signature information of the secure keyboard SDK configured by the secure keyboard server, and the Google official root public key is configured in the secure keyboard server; The secure keyboard SDK generates an RSA public-private key pair based on the hardware-protected keystore system, and issues a certificate to generate certificate chain information for the RSA public-private key pair based on the true random number and the system built-in root certificate of the Android device, and sends the certificate chain information to the secure keyboard server to request the secure keyboard server to issue a secure keyboard key, so that the secure keyboard server uses the Google official root public key to verify the certificate chain information, and after parsing the certificate chain information to obtain the true random number and the keystore system for hardware support determination information, the secure keyboard server generates the secure keyboard key and the transmission protection key based on the encryption machine interface, encrypts the secure keyboard key with the transmission protection key, and then uses the certificate chain information to retrieve the RSA public key, encrypts the transmission protection key with the RSA public key, and encapsulates the encrypted ciphertext key and returns it to the secure keyboard SDK, wherein the certificate chain information includes the true random number and the determination information of whether the current keystore system is based on hardware support, and the encrypted ciphertext key includes the encrypted secure keyboard key and the encrypted transmission protection key; The secure keyboard SDK imports the ciphertext key into the keystore key system supported by the hardware, and encapsulates the KMS service based on the keystore interface to provide encryption and decryption interface services.
3. The method according to claim 2, characterized in that After sending the certificate chain information to the secure keyboard server to request the secure keyboard server to issue a secure keyboard key, the method further includes: The certificate chain information is sent to the secure keyboard server, so that the secure keyboard server compares whether the true random number sent by the secure keyboard server to the secure keyboard SDK is consistent with the true random number sent by the secure keyboard SDK to the secure keyboard server, and determines whether the environment of the secure keyboard SDK is a keystore system based on hardware support. When the true random number sent by the secure keyboard server to the secure keyboard SDK is inconsistent with the true random number sent by the secure keyboard SDK to the secure keyboard server, the secure keyboard SDK is deemed to be illegal. After determining that the environment of the secure keyboard SDK is not a keystore system based on hardware support, it is determined that the security conditions of the secure keyboard SDK are not met, an error message is returned to the secure keyboard SDK, and any other subsequent interface services are rejected.
4. The method according to claim 3, characterized in that The secure keyboard SDK obtains the secure keyboard key and secure keyboard configuration issued by the secure keyboard server through the secure channel, including: The secure keyboard SDK requests the secure keyboard server to send a secure keyboard key and a secure keyboard configuration, so that the secure keyboard server initializes the key arrangement of the secure keyboard, establishes an index relationship between key positions, key values, and key image resources, and uses the secure keyboard key to encrypt the key values and key image resources, randomly shuffles the encrypted keys, and returns the randomized key information as the secure keyboard configuration to the secure keyboard SDK.
5. The method according to claim 4, characterized in that The secure keyboard SDK imports the secure keyboard key through a keystore interface based on hardware protection, and renders a secure keyboard UI based on the secure keyboard key and the secure keyboard configuration, including: The secure keyboard SDK initializes the secure keyboard UI and uses RecycleView or GridView as a key container; After decrypting the key image resources using the KMS decryption service and drawing the key UI using the Graphic interface, the entire secure keyboard UI with randomly arranged keys is displayed and the system is prohibited from taking screenshots or recording screens.
6. The method according to any one of claims 1 to 5, characterized in that: The secure keyboard SDK receives key information input by the user, records and outputs the key value ciphertext encrypted by the secure keyboard key, including: The secure keyboard SDK receives key information input by the user, records the key ciphertext value triggered by the user, and after the user completes the input, splices the overall input ciphertext in the order of the user input and outputs it.
7. The method according to claim 6, characterized in that Before the secure keyboard security configuration is issued by the secure keyboard server, the secure keyboard server encapsulates the KMS encryption and decryption interface service based on the hardware encryption machine interface.
8. The method according to claim 7, characterized in that The step of splicing the entire input ciphertext and outputting it in the order of user input includes: After obtaining the complete ciphertext value of the keystroke triggered by the user, request decryption from the secure keyboard server, so that the secure keyboard server uses the KMS based on the encryption machine interface to decrypt and obtain the plaintext value input by the user; Alternatively, after obtaining the complete ciphertext value of the keystroke triggered by the user, a decryption request is made to the secure keyboard SDK, and the KMS interface based on the hardware keystore is used for decryption to obtain the plaintext value input by the user.
9. An Android virtual keyboard based on hardware protection, characterized in that: include: A secure keyboard SDK, wherein the secure keyboard SDK is used to execute the steps of the method according to any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Cited By
Implementation method and apparatus for key import and key usage
WO2026118116A1
