WO2021051591A1 - 安全键盘实现方法、装置、计算机设备及存储介质 - Google Patents

安全键盘实现方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2021051591A1
WO2021051591A1 PCT/CN2019/118238 CN2019118238W WO2021051591A1 WO 2021051591 A1 WO2021051591 A1 WO 2021051591A1 CN 2019118238 W CN2019118238 W CN 2019118238W WO 2021051591 A1 WO2021051591 A1 WO 2021051591A1
Authority
WO
WIPO (PCT)
Prior art keywords
private information
current operating
operating environment
memory
encrypted
Prior art date
Application number
PCT/CN2019/118238
Other languages
English (en)
French (fr)
Inventor
胡定耀
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021051591A1 publication Critical patent/WO2021051591A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/606Protecting data by securing the transmission between two devices or processes

Definitions

  • This application relates to the technical field of mobile terminal security keyboards, and in particular to a security keyboard implementation method, device, computer equipment and storage medium.
  • the mobile application keyboard currently includes three methods: system default keyboard, self-painted fixed keyboard, and self-painted random keyboard.
  • the default keyboard security of the system is the worst, with security vulnerabilities such as easy to be hijacked and easy to be recorded.
  • the self-painted fixed keyboard has a click record attack vulnerability
  • the mobile application mainly uses a third type of keyboard, that is, the self-painted random keyboard.
  • the self-painted random keyboard can only defend against click-and-record attacks, and the security of input and output of private information is still relatively low.
  • the embodiments of the present application provide a secure keyboard implementation method, device, computer equipment, and storage medium, aiming to improve the security of the input and output of private information.
  • an embodiment of the present application provides a secure keyboard implementation method, which includes: if a user's instruction to activate the secure keyboard is received, for the first time detecting whether the current operating environment meets a preset condition; if it is detected for the first time If the current operating environment meets the preset conditions, a secure keyboard is generated; if the private information input by the user through the secure keyboard is received, the private information is encrypted to obtain encrypted private information, and the encrypted private information is encrypted The information is stored in the memory; if an instruction to call the encrypted private information is received from the mobile application, it is checked for the second time whether the current operating environment meets the preset conditions; if the current operating environment detected for the second time meets the According to a preset condition, the encrypted private information is decrypted for the mobile application to call.
  • an embodiment of the present application also provides a secure keyboard implementation device, which includes: a first detection unit, configured to detect for the first time whether the current operating environment meets the preset requirements if the user's instruction to start the secure keyboard is received Condition; a keyboard generating unit for generating a secure keyboard if the current operating environment detected for the first time satisfies the preset condition; an information encryption unit for generating a secure keyboard if the user’s private input through the secure keyboard is received Information, encrypting the private information to obtain encrypted private information, and storing the encrypted private information in the memory; the second detection unit is configured to: if an instruction to call the encrypted private information is requested by the mobile application, Secondly detect whether the current operating environment meets a preset condition; the information decryption unit is configured to decrypt the encrypted private information for the second time if the current operating environment meets the preset condition Mobile application call.
  • a first detection unit configured to detect for the first time whether the current operating environment meets the preset requirements if the user's instruction to start the secure keyboard is
  • an embodiment of the present application also provides a computer device, which includes a memory and a processor, the memory stores a computer program, and the processor implements the above method when the computer program is executed.
  • the embodiments of the present application also provide a computer-readable storage medium, the storage medium stores a computer program, and the computer program can implement the foregoing method when executed by a processor.
  • the embodiments of the present application provide a method, device, computer equipment, and storage medium for implementing a secure keyboard.
  • the technical solution of the embodiment of this application can ensure the security of the environment for entering private information to a certain extent by detecting the operating environment before generating the secure keyboard; and then encrypting and storing the private information can further ensure the security of the private information; finally passed
  • the operating environment is checked again before decryption to ensure that only when the operating environment is safe, the private information is decrypted and output for mobile applications to call, which can better protect the security of the output private information. Therefore, the technical solution of the present application can improve the security of the input and output of private information.
  • FIG. 1 is a schematic flowchart of a method for implementing a secure keyboard provided by an embodiment of the application
  • FIG. 2 is a schematic diagram of a sub-flow of a method for implementing a secure keyboard provided by an embodiment of the application;
  • FIG. 3 is a schematic diagram of a sub-flow of a method for implementing a secure keyboard according to an embodiment of the application
  • FIG. 4 is a schematic diagram of a sub-flow of a method for implementing a secure keyboard provided by an embodiment of this application;
  • FIG. 5 is a schematic diagram of a sub-flow of a method for implementing a secure keyboard provided by an embodiment of this application;
  • FIG. 6 is a schematic diagram of a sub-flow of a method for implementing a secure keyboard according to an embodiment of the application
  • FIG. 7 is a schematic block diagram of a device for implementing a secure keyboard provided by an embodiment of the application.
  • FIG. 8 is a schematic block diagram of the first detection unit of the device for implementing a secure keyboard according to an embodiment of the application.
  • FIG. 9 is a schematic block diagram of a keyboard generating unit of a secure keyboard implementing device provided by an embodiment of the application.
  • Figure 10 is a schematic diagram of the information encryption unit of the secure keyboard implementation device provided by an embodiment of the application
  • FIG. 11 is a schematic diagram of the memory monitoring unit of the secure keyboard implementation device provided by an embodiment of the application
  • FIG. 12 is a schematic block diagram of the information decryption output determination unit of the secure keyboard implementation device provided by an embodiment of the application.
  • FIG. 13 is a schematic block diagram of a computer device provided by an embodiment of this application.
  • the term “if” can be interpreted as “when” or “once” or “in response to determination” or “in response to detection” depending on the context .
  • the phrase “if determined” or “if detected [described condition or event]” can be interpreted as meaning “once determined” or “in response to determination” or “once detected [described condition or event]” depending on the context ]” or “in response to detection of [condition or event described]”.
  • FIG. 1 is a schematic flowchart of a method for implementing a secure keyboard provided by an embodiment of the present application.
  • the secure keyboard implementation method of the embodiments of the present application can be applied to a terminal, such as a mobile communication terminal such as a mobile phone, a tablet computer, and the like.
  • the secure keyboard implementation method is implemented by software installed on the terminal, so as to provide users with private information Enter to provide a secure environment to ensure user information security.
  • the method for implementing the secure keyboard is applied to a mobile phone terminal as an example to describe the method in detail. As shown in Figure 1, the method includes the following steps S1-S5.
  • the secure keyboard is generated only when it is ensured that the current operating environment of the terminal meets the preset conditions.
  • the user enters information. For example, when the user opens the mobile banking APP through the terminal and performs account login, the user needs to click the input box in the account login interface. At this time, an operation that triggers the activation of the secure keyboard is generated, and the terminal will detect the current operation Whether the environment is safe, that is, if the user's instruction to start the safe keyboard is received, it is the first time to check whether the current operating environment meets the preset conditions.
  • the preset conditions may include three safety conditions, the three safety conditions are: the current operating environment is not in a dynamic debugging environment; the current operating environment is not in the Hook framework environment; the current operating environment does not exist Secondary packaging attack. If the current operating environment meets the above three safety conditions at the same time, it is determined that the current operating environment meets the preset conditions, indicating that the terminal is currently in a safe state, and a safety keyboard can be provided to the user to perform corresponding operations.
  • the step S1 may include steps S11-S15.
  • step S11 Determine whether the current operating environment is in a dynamic debugging environment. If the current operating environment is in a dynamic debugging environment, step S15 is executed; otherwise, step S12 is executed to make the next judgment.
  • the dynamic debugging environment means that there are illegal users in the current environment that use reverse means to conduct dynamic reverse debugging.
  • eight methods can be used to determine whether the current operating environment is in a dynamic debugging environment.
  • the dynamic debugging environment is debugged through the dynamic debugger.
  • the eight ways to determine the dynamic debugging environment are: (1) Port number detection, to determine whether a fixed port is occupied, if the fixed port number is occupied, then to determine The current operating environment is in a dynamic debugging environment.
  • the process name of the dynamic debugger check whether there is a fixed dynamic debugger process name, if there is a fixed dynamic debugger process name, it is determined that the current operating environment is in a dynamic debugging environment.
  • Process name detection If the parent process name of the mobile application is different from the parent process name during normal startup, the current process name of the program and its own process name will also be different, and it is determined that the current operating environment is in a dynamic debugging environment.
  • Thread count detection If the mobile application has only one thread, it is determined that the current operating environment is in a dynamic debugging environment. (5) Detection of the number of fd files.
  • fd files If the number of fd files is different from the preset number of fd files, it is determined that the current operating environment is in a dynamic debugging environment. (6) Debug detection function. If the return value of the debug detection function is true, it is determined that the current operating environment is in a dynamic debugging environment. (7) Ptrace detection, if the Ptrace detection fails, it is determined that the current operating environment is in a dynamic debugging environment; (8) Dynamic debugger features, if a forged signal sent by a mobile application is intercepted, it is determined that the current operating environment is in a dynamic debugging environment.
  • step S15 is executed. If the current operating environment is not in a dynamic debugging environment, the following step S13 is executed to determine the next safety condition.
  • the judgment of whether the current operating environment is in a dynamic debugging environment can ensure the security of the current operating environment before the user enters personal private information, which can reduce the security risk of entering the user's private information to a certain extent.
  • the Hook framework environment refers to the environment where the Xposed framework or Frida Hook framework exists.
  • three ways can be used to determine whether the current operating environment is in the Hook framework environment.
  • the three ways to determine that the current operating environment is in the Hook framework environment are: (1) Hook keyword search. If there is a Hook keyword, such as Xposed, then it is determined that the current operating environment is in the Hook framework environment. (2) Detect the memory file and determine whether there is a fixed memory file.
  • step S15 is executed. If the current operating environment is not in the Hook framework environment, the following step S14 is executed to determine the next safety condition.
  • the judgment of whether the current operating environment is in the Hook framework environment can further ensure the security of the current operating environment on the basis of judging that the current operating environment is not in the dynamic debugging environment, and reduce the security risk of inputting user's private information.
  • step S13 Determine whether there is a secondary packaging attack in the current operating environment. If there is a secondary packaging attack in the current operating environment, perform step S15; otherwise, perform step S14 to determine that the current operating environment meets the preset condition.
  • the mobile application when judging whether the current operating environment meets the preset conditions, if the current operating environment is not in a dynamic debugging environment, is not in a Hook framework environment, and there is no secondary packaging attack, then it is determined that the current environment is safe and the steps can be performed S2 to generate a secure keyboard.
  • the secondary packaging attack is the process of cracking the mobile application, tampering with it or inserting malicious code, and finally generating a new application.
  • the mobile application will provide the mobile application signature when integrating the secure keyboard.
  • the secure keyboard encrypts the mobile application signature and saves it in the underlying So library. Each time the secure keyboard is started, the mobile application signature will be obtained in real time and stored in the So library.
  • step S15 is executed.
  • the detection of whether there is a secondary packaging attack in the current operating environment can further ensure the security of the current operating environment on the basis that the current operating environment is not in the dynamic debugging environment and the Hook framework environment, and reduce the input of user private information Security Risk.
  • the current environment is found to be in any of the following situations during the process of detecting the current operating environment: the current operating environment is in the dynamic debugging environment or the current operating environment is in the Hook framework environment or the current operating environment has two
  • the second packaging attack indicates that there is a security risk in the current operating environment. If the user enters personal private information in this environment, there will be a risk of information leakage. Therefore, the secure keyboard should not be activated. At this time, a risk warning message can be issued to the user. For example, a prompt box can be popped up on the current interface to remind the user that the current operating environment is at risk.
  • anti-debugging, anti-Hook, anti-memory dump and other means are used to resist reverse debugging; at the bottom layer, a signature verification method is used to resist secondary packaging attacks. In other embodiments, other means may also be used to resist reverse debugging and secondary packaging attacks, which are not limited in this application.
  • the detection sequence of the three security conditions of the dynamic debugging environment, the Hook framework environment, and the secondary packaging attack is not limited in this application, and only the detection of the three is required.
  • the current operating environment of the terminal meets the preset conditions, that is, the current operating environment is not in a dynamic debugging environment, is not in the Hook framework environment, and there is no secondary packaging attack, it indicates that the current operating environment meets the security requirements , Can generate a secure keyboard for users to enter personal private information.
  • the step S2 may include steps S21-S24.
  • pre-configured UI keys can be obtained, and UI (User Interface) keys can be drawn autonomously, for example, number keys, symbol keys, letter keys, and function keys can be drawn autonomously. Specifically, the size, color or style of number keys, symbol keys, letter keys, and function keys can be drawn autonomously. By autonomously drawing number keys, symbol keys, letter keys, and function keys, the style of the security keyboard can be more beautiful and beautiful. Various styles.
  • UI User Interface
  • obtaining the self-drawn UI keys can eliminate the click effect of the UI key buttons when the user clicks on the secure keyboard to input private information.
  • the click mode without feedback is adopted to prevent the Trojan horse from taking screenshots and screen recording attacks. Specifically, when the user clicks on the secure keyboard to input private information, the highlight of the shadow that appears after clicking the UI key will be erased. In other embodiments, other methods can also be used to erase the click effect that appears after clicking the UI key, as long as the click effect of clicking the UI key button is erased. By erasing the click effect of the UI key button and adopting a click method without feedback, it can prevent the attack of the Trojan horse from taking screenshots when the user enters private information, thereby improving the security of private information input.
  • a default sequence corresponding to the UI keys will be generated according to the UI keys.
  • the default sequence is a sequence set by default for a certain type of key. For example, for number keys, the corresponding default sequence is 0123456789. Understandably, the inherent sequence of number keys 0-9 is 0123456789, that is, the number keys 0-9 correspond to The content is 0123456789 in order.
  • a random algorithm is used to generate a keyboard key value sequence through the underlying so library.
  • the generated key value sequence of the number keys 0-9 is 3204157869.
  • the keyboard key value sequence is sequentially assigned to the default sequence to generate the secure keyboard, for example, the numeric key key value sequence 3204157869 is assigned to the numeric keys 0-9 in sequence according to the default sequence 0123456789. After assignment, the content on the number key 0 is the number 3, the content on the number key 1 is the number 2, and so on.
  • the keyboard key value sequence also includes a symbol key key value sequence, a letter key key value sequence, and a function key key value sequence.
  • the symbol key key value sequence, the letter key key value sequence, and the function key key value sequence can be randomly generated as needed, and then assigned corresponding to the symbol key default sequence, the letter key default sequence, and the function key default sequence in sequence, thereby generating a secure keyboard.
  • a random algorithm is used to generate the keyboard key value sequence through the underlying so library.
  • the generation of the keyboard key value sequence supports both random and non-random modes.
  • the numeric keyboard key value sequence is random, and the letter keyboard key value sequence is not random. Both can be controlled by parameters.
  • the user can input private information through the generated secure keyboard, for example, input important information such as a bank account number, an ID number, or a payment password.
  • important information such as a bank account number, an ID number, or a payment password.
  • the secure keyboard encrypts the private information entered by the user and saves the encrypted private information in the memory to ensure the security of the user's private information input.
  • the step S3 may include steps S31-S34.
  • step S31 If the private information input by the user through the secure keyboard is received, determine whether the first ID and the second ID are successfully generated when the user inputs the first character information of the private information. The second ID is the same. If the first ID and the second ID are successfully generated when the user inputs the first character information of the private information, step S32 is executed; otherwise, step S34 is executed.
  • the first ID and the second ID are successfully generated by using the timestamp and salt random algorithm at the bottom layer.
  • the first ID and the second ID are the same, and both are unique IDs that characterize this private information. If the user successfully generates the first ID and the second ID by using a timestamp and salt random algorithm at the bottom layer when the user enters the first character information of the private information, step S32 is executed to encrypt the first ID to obtain the encrypted ID, and encrypt The ID and the second ID are stored in the memory. Wherein, the second ID is used for calling by the mobile application.
  • Replay Attacks also known as replay attacks and replay attacks
  • replay attacks refer to the attacker sending a packet that the destination host has received to achieve the purpose of deceiving the system. It is mainly used in the identity authentication process to destroy the correctness of the authentication. .
  • the first ID and the second ID may also be generated by other algorithms, which are not specifically limited in this application.
  • the memory change monitoring thread will be started to monitor the memory change, thereby determining the encryption of the private information And/or whether there are interception and/or tampering operations in the memory during the decryption process, to further protect the security of the input and output of the user’s private information.
  • steps S61-S66 may be included.
  • step S62 Determine whether there is a memory interception and/or memory tampering operation, if there is the memory interception and/or the memory tampering operation, execute step S63; otherwise, execute step S61 to continue real-time monitoring of memory changes.
  • step S63 Determine whether the memory interception and/or the memory tampering operation occurred during the process of encrypting the private information or the process of decrypting the encrypted private information, if the memory interception and/or Or the memory tampering operation occurs in the process of encrypting the private information, then step S64 is executed, if the memory interception and/or the memory tampering operation occurs in the process of decrypting the encrypted private information, Then step S65 is executed.
  • the memory change monitoring thread is started to monitor the memory change in real time.
  • the memory change is realized by monitoring the change of the memory file. For example, when there is a memory interception operation, a faulty memory interruption phenomenon will occur, and the corresponding memory interruption file will be generated in the underlying so library, so that it can be judged whether the memory is intercepted.
  • by judging whether there are memory interception and/or memory tampering operations if there are no dangerous operations such as memory interception and/or memory tampering, continue to monitor memory changes, and the user continues to input private information.
  • the memory change monitoring thread is started to monitor the memory changes in real time, and the private information can be decrypted and output when the private information is input. The security of private information was ensured in real time before.
  • the first ID is encrypted to obtain the encrypted ID
  • the encrypted ID and the second ID are stored in the memory in.
  • the second ID is used for the mobile application to call.
  • the encrypted ID and the second ID are stored in the memory so that when the encrypted private information is decrypted, the mobile application obtains the second ID, requests to decrypt the encrypted private information represented by the second ID, and decrypts the encrypted ID with the matching algorithm to obtain Decrypt the ID, and then match the decryption ID with the second ID. If the decryption ID matches the ID of the second ID, decrypt the encrypted private information for the mobile application to call. If the decryption ID does not match the ID of the second ID, it indicates that the encrypted private information has a security risk, and a risk warning message should be sent to the user.
  • the encrypted private information can be obtained by performing the RC4 algorithm and AES byte filling encryption on the private information, and the encrypted private information can be stored in the memory.
  • a first hash value is also generated, and the first hash value is used to verify the first hash value and decrypt the encrypted private information when decrypting the encrypted private information Whether the second hash value generated at the time is consistent, so as to determine whether there is a memory tampering operation.
  • the user fails to generate the first ID and the second ID when the user inputs the first character information of the private information, it indicates that the generation of the unique ID representing the private information input by the user has failed, and the private information has a security risk , So you should stop entering the user’s private information, send a risk warning message to the user, and close the secure keyboard.
  • a prompt box can be popped up on the current interface to remind the user that the currently input private information is at risk and should stop inputting.
  • the encrypted private information should be decrypted for the mobile application to call, in order to further ensure the security of the data
  • the preset conditions may include three security conditions, the three security conditions are: the current operating environment is not in a dynamic debugging environment; the current operating environment is not in the Hook framework environment; the current operating environment is free of secondary packaging attacks . If the current operating environment meets the above three security conditions at the same time, it is determined that the current operating environment meets the preset conditions, indicating that the terminal is currently in a secure state, and the encrypted private information can be decrypted for mobile applications to call.
  • steps S11-S14 can be used in the same way as the determination of the three safety conditions in step S1 in step S4. For the sake of simplicity and convenience, the details will not be repeated here.
  • the encrypted privacy stored in the memory will be The information is decrypted for the mobile application to call. Detect the current operating environment before decrypting the private information.
  • the encrypted private information will be decrypted, which can further ensure the security of the output private information. .
  • the encrypted private information is stored in the memory, if the current operating environment detected for the second time meets the preset conditions, the encrypted private information is decrypted for the mobile application to call.
  • the step as shown in Figure 6, it also includes steps S71-S74.
  • step S71 Decrypt the encrypted ID to obtain a decryption ID, determine whether the decryption ID matches the second ID, and if the decryption ID matches the second ID, perform step S72; otherwise, perform step S73 .
  • step S72 Generate a second hash value, and determine whether the second hash value is consistent with the first hash value, and if the second hash value is consistent with the first hash value, perform step S5 to encrypt the privacy
  • the information is decrypted for the mobile application to call, otherwise, step S73 is executed.
  • the current operating environment detected for the second time is not in the dynamic debugging environment, the current operating environment is not in the Hook framework environment, and the current operating environment does not have secondary packaging attacks, it indicates that the current operating environment of the terminal is safe.
  • the encrypted ID is decrypted to obtain the decrypted ID, and it is judged whether the decrypted ID matches the second ID. If the decryption ID matches the second ID, generate a second hash value, and determine whether the second hash value is consistent with the first hash value, if the second hash value is consistent with the first hash value, perform step S5 to encrypt the private information Decrypt for mobile application call.
  • the mobile application obtains the second ID, requests to decrypt the encrypted private information represented by the second ID, the matching algorithm decrypts the encrypted ID, obtains the decryption ID, and then matches the decryption ID with the second ID. If the decryption ID matches the second ID Match the ID of, generate a second hash value, and determine whether the second hash value is consistent with the first hash value, if the second hash value is consistent with the first hash value, perform step S5 to decrypt the encrypted private information for the mobile application to call . Before decrypting the encrypted private information, by judging whether the decryption ID matches the second ID, it can be detected whether the encrypted private information has been changed. By judging whether the second hash value is consistent with the first hash value, whether there is a risk of memory tampering can be detected, so as to ensure the security of the encrypted private information before the encrypted private information is output.
  • FIG. 7 is a schematic block diagram of a device 70 for implementing a secure keyboard according to an embodiment of the present application.
  • the present application also provides a secure keyboard realization device 80.
  • the secure keyboard realization device 80 includes a unit for executing the above-mentioned secure keyboard realization method.
  • the secure keyboard implementation device 80 includes a first detection unit 81, a keyboard generation unit 82, an information encryption unit 83, a second detection unit 84, and an information decryption unit 85.
  • the first detection unit 81 is used to detect whether the current operating environment meets preset conditions for the first time if the user's instruction to activate the secure keyboard is received; the keyboard generating unit 82 is used to detect if the current operating environment is detected for the first time If the environment meets the preset conditions, a secure keyboard is generated; the information encryption unit 83 is configured to, if the private information input by the user through the secure keyboard is received, encrypt the private information to obtain encrypted private information, and encrypt the private information The private information is stored in the memory; the second detection unit 84 is used to detect for the second time whether the current operating environment meets the preset condition; the information decryption unit 85 is used to if the current operating environment detected for the second time meets the preset conditions According to the preset condition, the encrypted private information is decrypted for the mobile application to call.
  • the first detection unit 81 includes a first judgment unit 811, a second judgment unit 812, a third judgment unit 813 and a judgment unit 814.
  • the first judgment unit 811 is used to judge whether the current operating environment is in a dynamic debugging environment; the second judgment unit 812 is used to judge whether the current operating environment is in the Hook framework environment; the third judgment unit 813 is used to judge the Whether there is a secondary packaging attack in the current operating environment; the determining unit 814 is configured to determine the current operating environment if the current operating environment is not in the dynamic debugging environment, not in the Hook framework environment, and there is no secondary packaging attack Meet the preset conditions.
  • the keyboard generating unit 82 includes an acquiring unit 821, a first generating subunit 822, a second generating subunit 823, and a third generating subunit 824.
  • the obtaining unit 821 is used to obtain pre-configured UI keys; the first generating sub-unit 822 is used to generate a default sequence corresponding to the UI keys according to the UI keys; the second generating sub-unit 823 is used to randomly generate keyboard keys Value sequence; the third generation subunit 824 is used to assign the keyboard key value sequence to the default sequence in turn to generate the secure keyboard.
  • the information encryption unit 83 includes a fourth judgment unit 831, a first encryption subunit 832, a second encryption subunit 833, and a fourth generation subunit 834.
  • the fourth determining unit 831 is configured to determine whether the first ID and the second ID are successfully generated when the user inputs the first character information of the private information if the user receives the private information input through the secure keyboard, where: The first ID and the second ID are the same; the first encryption subunit 832 is configured to encrypt the first ID to obtain an encrypted ID, and store the encrypted ID and the second ID in a memory, The second ID is used for calling by the mobile application; the second encryption subunit 833 is used for encrypting the private information to obtain the encrypted private information, and storing the encrypted private information in the memory; The fourth generating subunit 834 is used to generate the first hash value after storing the encrypted private information in the memory.
  • the secure keyboard implementation device 80 further includes a memory monitoring unit 86.
  • the memory monitoring unit 86 includes a memory monitoring subunit 861, a fifth judgment unit 862, a sixth judgment unit 863, a stop information encryption unit 864, and a stop information decryption unit 865.
  • the memory monitoring subunit 861 is used to monitor memory changes in real time; the fifth judgment unit 862 is used to judge whether there is a memory interception and/or memory tampering operation; the sixth judgment unit 863 is used to judge the memory interception and/or the Whether the memory tampering operation occurs in the process of encrypting or decrypting the private information; the stop information encryption unit 864 is used for if the memory interception and/or the memory tampering operation occurs in the process of encrypting the private information , The encryption of the private information is stopped, a risk warning message is issued to the user, and the secure keyboard is closed; the information decryption unit 865 is stopped to be used if the memory interception and/or the memory tampering operation occurs when the encrypted private information is In the process of information decryption, the decryption of the encrypted private information is stopped, a risk prompt message is issued to the user, and the secure keyboard is closed.
  • the secure keyboard implementation device 80 further includes an information decryption output determination unit 87.
  • the information decryption output determination unit 87 includes an information decryption sub-unit 871, a seventh determination unit 872, an eighth determination unit 873, and an information decryption output unit 874.
  • the information decryption subunit 871 is used to decrypt the encrypted ID to obtain the decryption ID; the seventh judgment unit 872 is used to judge whether the decryption ID matches the second ID; the eighth judgment unit 873 is used if If the decryption ID matches the second ID, a second hash value is generated, and it is judged whether the second hash value is consistent with the first hash value; the information decryption output unit 874 is configured to: The hash value is consistent with the first hash value, then the encrypted private information is decrypted for the mobile application to call.
  • the second detection unit 82 like the first detection unit 81, includes a first judgment unit 811, a second judgment unit 812, a third judgment unit 813, and a judgment unit 814, and the detection order of these three is the same as the order. Irrelevant, for the sake of brevity of description, I will not repeat it here.
  • the foregoing secure keyboard implementation device may be implemented in the form of a computer program, and the computer program may run on a computer device as shown in FIG. 13.
  • FIG. 13 is a schematic block diagram of a computer device according to an embodiment of the present application.
  • the computer device 900 is a terminal, and the terminal may be an electronic device with communication functions such as a smart phone, a tablet computer, a personal digital assistant, and a wearable device.
  • the computer device 900 includes a processor 902, a memory, and an interface 907 connected through a system bus 901, where the memory may include a non-volatile storage medium 903 and an internal memory 904.
  • the non-volatile storage medium 903 can store an operating system 9031 and a computer program 9032.
  • the processor 902 can execute a secure keyboard implementation method.
  • the processor 902 is used to provide calculation and control capabilities to support the operation of the entire computer device 900.
  • the internal memory 904 provides an environment for the operation of the computer program 9032 in the non-volatile storage medium 903.
  • the computer program 9032 When executed by the processor 902, it implements the secure keyboard implementation method of the embodiment of the present application.
  • the interface 905 is used to communicate with other devices.
  • FIG. 13 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 900 to which the solution of the present application is applied.
  • the specific computer device 900 may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
  • the processor 902 may be a central processing unit (Central Processing Unit, CPU), and the processor 902 may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSPs), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor.
  • the computer program can be stored in a storage medium, and the storage medium is a computer-readable storage medium.
  • the computer program is executed by at least one processor in the computer system to implement the process steps of the foregoing method embodiment.
  • the storage medium may be a computer-readable storage medium.
  • the storage medium stores a computer program.
  • the processor is executed to implement the secure keyboard implementation method of the embodiment of the present application.
  • the storage medium may be a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a magnetic disk, or an optical disk, and other computer-readable storage media that can store program codes.
  • ROM Read-Only Memory
  • the disclosed device and method can be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of each unit is only a logical function division, and there may be other division methods in actual implementation.
  • multiple units or components can be combined or integrated into another system, or some features can be omitted or not implemented.
  • the steps in the method in the embodiment of the present application can be adjusted, merged, and deleted in order according to actual needs.
  • the units in the device of the embodiment of the present application may be combined, divided, and deleted according to actual needs.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium.
  • the technical solution of this application is essentially or the part that contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium. It includes several instructions to make a computer device (which may be a personal computer, a terminal, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application.

Abstract

本申请实施例公开了一种安全键盘实现方法、装置、计算机设备及存储介质。该方法属于安全监控技术领域,其包括:若接收到用户启动安全键盘的指令,则第一次检测当前运行环境是否满足预设条件;若第一次检测到的当前运行环境满足预设条件,则生成安全键盘;若接收到用户通过安全键盘输入的私密信息,对私密信息进行加密得到加密私密信息,并将加密私密信息保存于内存中;若接收到移动应用请求调用加密私密信息的指令,则第二次检测当前运行环境是否满足预设条件;若第二次检测到的当前运行环境满足预设条件,则将加密私密信息进行解密以供移动应用调用。

Description

安全键盘实现方法、装置、计算机设备及存储介质
本申请要求于2019年09月19日提交中国专利局、申请号为CN201910889045.1、申请名称为“安全键盘实现方法、装置、计算机设备及储存介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及移动终端安全键盘技术领域,尤其涉及一种安全键盘实现方法、装置、计算机设备及存储介质。
背景技术
随着移动互联网技术的快速发展,越来越多的移动应用出现在我们的日常生活中。这些移动应用越来越多地需要录入用户私密信息,如支付密码、身份证号,而在录入的过程中,如何保障用户信息安全变得越来越重要。
目前移动应用键盘包括三种方式:系统默认键盘、自绘固定键盘和自绘随机键盘。其中,系统默认键盘安全性最差,存在易被劫持、易被记录等安全漏洞。而自绘固定键盘由于存在点击记录攻击漏洞,所以移动应用主要采用第三种键盘,即自绘随机键盘。然而自绘随机键盘仅仅只能防御点击记录攻击,私密信息输入输出安全性仍比较低。
发明内容
本申请实施例提供了一种安全键盘实现方法、装置、计算机设备及存储介质,旨在提高私密信息输入输出的安全性。
第一方面,本申请实施例提供了一种安全键盘实现方法,其包括:若接收到用户启动安全键盘的指令,则第一次检测当前运行环境是否满足预设条件;若第一次检测到的所述当前运行环境满足所述预设条件,则生成安全键盘;若接收到用户通过所述安全键盘输入的私密信息,对所述私密信息进行加密得到加密私密信息,并将所述加密私密信息保存于内存中;若接收到移动应用请求调用所述加密私密信息的指令,则第二次检测当前运行环境是否满足预设条件; 若第二次检测到的所述当前运行环境满足所述预设条件,则将所述加密私密信息进行解密以供所述移动应用调用。
第二方面,本申请实施例还提供了一种安全键盘实现装置,其包括:第一检测单元,用于若接收到用户启动安全键盘的指令,则第一次检测当前运行环境是否满足预设条件;键盘生成单元,用于若第一次检测到的所述当前运行环境满足所述预设条件,则生成安全键盘;信息加密单元,用于若接收到用户通过所述安全键盘输入的私密信息,对所述私密信息进行加密得到加密私密信息,并将所述加密私密信息保存于内存中;第二检测单元,用于若接收到移动应用请求调用所述加密私密信息的指令,则第二次检测当前运行环境是否满足预设条件;信息解密单元,用于若第二次检测到的所述当前运行环境满足所述预设条件,则将所述加密私密信息进行解密以供所述移动应用调用。
第三方面,本申请实施例还提供了一种计算机设备,其包括存储器及处理器,所述存储器上存储有计算机程序,所述处理器执行所述计算机程序时实现上述方法。
第四方面,本申请实施例还提供了一种计算机可读存储介质,所述存储介质存储有计算机程序,所述计算机程序当被处理器执行时可实现上述方法。
本申请实施例提供了一种安全键盘实现方法、装置、计算机设备及存储介质。本申请实施例的技术方案,通过在生成安全键盘之前进行运行环境检测,可在一定程度上确保输入私密信息的环境安全;再通过对私密信息进行加密存储可进一步保障私密信息的安全;最后通过解密之前运行环境的再一次检测,确保在运行环境安全的情况才解密输出私密信息供移动应用调用,可更好地保护输出私密信息的安全性。因此,本申请的技术方案可提高私密信息输入输出的安全性。
附图说明
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的一种安全键盘实现方法的流程示意图;
图2为本申请实施例提供的一种安全键盘实现方法的子流程示意图;
图3为本申请实施例提供的一种安全键盘实现方法的子流程示意图;
图4为本申请实施例提供的一种安全键盘实现方法的子流程示意图;
图5为本申请实施例提供的一种安全键盘实现方法的子流程示意图;
图6为本申请实施例提供的一种安全键盘实现方法的子流程示意图;
图7为本申请实施例提供的一种安全键盘实现装置的示意性框图;
图8为本申请实施例提供的安全键盘实现装置的第一检测单元的示意性框图;
图9为本申请实施例提供的安全键盘实现装置的键盘生成单元的示意性框图;
图10为本申请实施例提供的安全键盘实现装置的信息加密单元的示意性
框;
图11为本申请实施例提供的安全键盘实现装置的内存监控单元的示意性
框;
图12为本申请实施例提供的安全键盘实现装置的信息解密输出判定单元的示意性框图;以及
图13为本申请实施例提供的一种计算机设备的示意性框图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”和“包含”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。
还应当进一步理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。
如在本说明书和所附权利要求书中所使用的那样,术语“如果”可以依据 上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。
请参阅图1,图1是本申请实施例提供的安全键盘实现方法的流程示意图。本申请实施例的安全键盘实现方法可应用于终端,例如手机、平板电脑等移动通信终端,通过安装于所述终端上的软件来实现所述安全键盘实现方法,从而为用户所进行的私密信息输入提供安全的环境以确保用户信息安全。下面以所述安全键盘实现方法应用于手机终端为例对所述方法进行详细说明。如图1所示,该方法包括以下步骤S1-S5。
S1、若接收到用户启动安全键盘的指令,则第一次检测当前运行环境是否满足预设条件。
本申请实施例中,若检测到用户触发启动安全键盘的操作,则需先检测终端当前运行环境是否满足预设条件,在确保终端当前运行环境满足预设条件的情况下才生成安全键盘以供用户输入信息。例如,当用户通过所述终端打开手机银行APP且进行帐号登录时,用户需点击账号登录界面中的输入框,此时即产生了触发启动安全键盘的操作,则所述终端将检测当前的运行环境是否安全,即若接收到用户启动安全键盘的指令,则第一次检测当前运行环境是否满足预设条件。在本申请实施例中,所述预设条件可包括三个安全条件,该三个安全条件分别为:当前运行环境未处于动态调试环境;当前运行环境未处于Hook框架环境;当前运行环境未存在二次打包攻击。若当前运行环境同时满足以上三个安全条件,则确定当前运行环境满足预设条件,表明所述终端当前处于安全状态,可向用户提供安全键盘以进行相应操作。
在某些实施例,例如本实施例中,如图2所示,所述步骤S1可包括步骤S11-S15。
S11、判断所述当前运行环境是否处于动态调试环境。若所述当前运行环境处于动态调试环境则执行步骤S15,否则执行步骤S12以进行下一步的判断。
在本申请实施例中,判断当前运行环境是否满足预设条件时,首先判断当前运行环境是否处于动态调试环境。其中,动态调试环境是指当前环境下有非法用户利用逆向手段进行动态逆向调试。具体地,可通过8种方式判断当前运 行环境是否处于动态调试环境。其中,动态调试环境是通过动态调试器进行调试的,8种判定动态调试环境的方式分别为:(1)端口号的检测,判定固定的端口是否被占用,若固定端口号被占用,则判定当前运行环境处于动态调试环境。(2)动态调试器的进程名,查看是否存在固定的动态调试器进程名,若存在固定的动态调试器进程名,则判定当前运行环境处于动态调试环境。(3)进程名检测,若移动应用的父进程名和正常启动时的父进程名不同,程序当前的进程名与本身的进程名也会不同,则判定当前运行环境处于动态调试环境。(4)线程数检测,若移动应用只有一个线程,则判定当前运行环境处于动态调试环境。(5)fd文件数量检测,若fd文件数量与预设的fd文件数量不同,则判定当前运行环境处于动态调试环境。(6)调试检测函数,若调试检测函数返回值为true,则判定当前运行环境处于动态调试环境。(7)Ptrace检测,若Ptrace检测失败,则判定当前运行环境处于动态调试环境;(8)动态调试器特性,若移动应用发送的伪造信号被拦截,则判定当前运行环境处于动态调试环境。以上8种判定动态调试环境的方式,若至少一种方式判定当前运行环境处于动态调试环境,则执行步骤S15。若当前运行环境未处于动态调试环境,则执行以下步骤S13以进行下一个安全条件的判断。对当前运行环境是否处于动态调试环境的判断,可在用户输入个人私密信息之前确保当前运行环境的安全性,可在一定程度上降低输入用户私密信息的安全风险。
S12、判断所述当前运行环境是否处于Hook框架环境,若所述当前运行环境处于Hook框架环境则执行步骤S15,否则执行步骤S13以进行下一步判断。
在本申请实施例中,判断当前运行环境是否满足预设条件时,若当前运行环境未处于动态调试环境,则进一步判断当前运行环境是否处于Hook框架环境。其中,Hook框架环境是指存在Xposed框架或Frida Hook框架的环境。具体地,可通过3种方式判定当前运行环境是否处于Hook框架环境。其中,3种判定当前运行环境处于Hook框架环境的方式分别为:(1)Hook关键字的搜索,若存在Hook关键字,例如,Xposed等关键字,则判定当前运行环境处于Hook框架环境。(2)检测内存文件,判断是否存在固定内存文件,若存在固定内存文件,则判定当前运行环境处于Hook框架环境。(3)检测端口号,判断固定端口号是否被占用,若固定端口号被占用,则判定当前运行环境处于Hook框架环境。以上3种判定Hook框架环境的方式,若至少一种方式判定当前运行环境 处于Hook框架环境,则执行步骤S15。若当前运行环境未处于Hook框架环境,则执行以下步骤S14以进行下一个安全条件的判断。对当前运行环境是否处于Hook框架环境的判断,可在判断当前运行环境未处于动态调试环境的基础上,进一步确保当前运行环境的安全性,降低输入用户私密信息的安全风险。
S13、判断所述当前运行环境是否存在二次打包攻击,若所述当前运行环境存在二次打包攻击则执行步骤S15,否则执行步骤S14判定所述当前运行环境满足所述预设条件。
在本申请实施例中,判断当前运行环境是否满足预设条件时,若当前运行环境未处于动态调试环境、未处于Hook框架环境且未存在二次打包攻击,则判定当前环境安全,可执行步骤S2以生成安全键盘。其中,二次打包攻击是对移动应用进行破解、再篡改或插入恶意代码、最后生成一个新应用的过程。具体地,移动应用在集成安全键盘时会提供移动应用签名,安全键盘将移动应用签名加密保存在底层So库中,每次启动安全键盘时,将会实时获取移动应用签名并与保存在So库中加密的移动应用签名比较,若实时获取的移动应用签名与保存在So库中加密的移动应用签名不一致,则判定当前运行环境存在二次打包攻击,则执行步骤S15。对当前运行环境是否存在二次打包攻击的检测,可在对当前运行环境未处于动态调试环境及未处于Hook框架环境的基础上,更进一步确保当前运行环境的安全性,降低输入用户私密信息的安全风险。
S15、向用户发出风险提示信息。
在本申请实施例中,若在检测当前运行环境的过程中发现当前环境处于以下任意一种情况:当前运行环境是处于动态调试环境或者是当前运行环境处于Hook框架环境或者是当前运行环境存在二次打包攻击,则说明当前运行环境存在安全风险,用户若在该环境下输入个人私密信息将存在信息泄漏的风险,因此不应启动安全键盘,此时可向用户发出风险提示信息。例如,可通过在当前界面弹出提示框的方式来提醒用户当前运行环境存在风险。
需要说明的是,本实施例中,利用反调试、反Hook、反内存Dump等手段抵御逆向调试;在底层利用签名校验的方式来抵御二次打包攻击。在其它实施例中,也可采用其它手段抵御逆向调试和二次打包攻击,在本申请中不作限定。在判断预设条件时,动态调试环境、Hook框架环境以及二次打包攻击这三个安全条件的检测顺序在本申请中也不作限定,只需完成三者的检测即可。
S2、若所述第一次检测到的当前运行环境满足所述预设条件,则生成安全键盘。
本申请实施例中,若检测到终端当前运行环境满足预设条件,也即当前运行环境未处于动态调试环境、未处于Hook框架环境且未存在二次打包攻击,则表明当前运行环境符合安全要求,可生成安全键盘,以供用户输入个人私密信息。
在某些实施例,例如本实施例中,如图3所示,所述步骤S2可包括步骤S21-S24。
S21、获取预先配置的UI键。
本申请实施例中,可获取预先配置的UI键,也即可自主绘制UI(User Interface)键,例如自主绘制数字键、符号键、字母键以及功能键。具体地,可自主绘制数字键、符号键、字母键以及功能键的大小、颜色或样式等,通过自主绘制数字键、符号键、字母键以及功能键,可使得安全键盘的样式更为美观且样式多样。
需要说明的是,获取自主绘制的UI键,实现用户点击安全键盘输入私密信息时抹除UI键按钮的点击效果,采用无反馈点击模式,可防止木马截屏录屏攻击。具体地,用户点击安全键盘输入私密信息时,将会抹除点击UI键后出现的阴影突显。在其它实施例中,也可采用其它方式抹除点击UI键后出现的点击效果,只需达到抹除点击UI键按钮的点击效果即可。通过抹除UI键按钮的点击效果,采用无反馈的点击方式,可防止用户输入私密信息时,木马截屏录屏的攻击,从而提高私密信息输入的安全性。
S22、根据所述UI键生成与所述UI键对应的默认序列。
本申请实施例中,当获取预先配置的UI键之后,即自主绘制数字键、符号键、字母键以及功能键之后,会根据UI键生成与该UI键对应的默认序列。该默认序列为某一类型键默认设置的序列,例如对于数字键而言,对应的默认序列为0123456789,可理解地,数字键0~9固有的序列为0123456789,即数字键0~9对应的内容依次为0123456789。
S23、随机生成键盘键值序列。
本申请实施例中,通过底层so库采用random随机算法产生键盘键值序列,例如产生的数字键0~9的键值序列为3204157869。
在其它实施例中,也可在底层so库采用其它算法产生键盘键值序列,本申请对此不作具体限定。
S24、将所述键盘键值序列依次赋值给所述默认序列以生成所述安全键盘。
在本申请实施例中,将键盘键值序列依次赋值给默认序列以生成所述安全键盘,例如将数字键键值序列3204157869按照默认序列0123456789依次对数字键0~9进行赋值。赋值之后,数字键0上面的内容为数字3,数字键1上面的内容为数字2,以此类推。其中,键盘键值序列还包括符号键键值序列、字母键键值序列以及功能键键值序列。具体地,可根据需要随机生成符号键键值序列、字母键键值序列以及功能键键值序列然后依次与符号键默认序列、字母键默认序列以及功能键默认序列对应赋值,从而生成安全键盘。
在其它实施例中,通过底层so库采用random随机算法产生键盘键值序列,键盘键值序列的产生支持随机和不随机两种模式,例如数字键盘键值序列随机,字母键盘键值序列不随机都可以都通过参数来控制。
需要说明的是,采用上述步骤S21-S24每次生成的安全键盘均不相同,故可以有效防止木马点击记录攻击。
S3、若接收到用户通过所述安全键盘输入的私密信息,对所述私密信息进行加密得到加密私密信息,并将所述加密私密信息保存于内存中。
本申请实施例中,当生成安全键盘后,用户通过生成的安全键盘可输入私密信息,例如输入银行账号、身份证号或者支付密码等重要信息。用户在输入重要私密信息时,安全键盘会对用户输入的私密信息进行加密,并且将加密后的私密信息保存在内存中,以确保用户私密信息输入的安全性。
在某些实施例,例如本实施例中,如图4所示,所述步骤S3可包括步骤S31-S34。
S31、若接收到用户通过所述安全键盘输入的私密信息,判断用户输入所述私密信息的第一个字符信息时是否成功生成第一ID及第二ID,其中,所述第一ID和所述第二ID相同。若用户输入所述私密信息的第一个字符信息时成功生成所述第一ID及所述第二ID则执行步骤S32,否则执行步骤S34。
本申请实施例中,若接收到用户通过安全键盘输入私密信息的第一个字符信息时,则会判断通过在底层利用时间戳加盐随机算法是否成功生成第一ID及第二ID。其中,第一ID和第二ID相同,均为表征本次私密信息的唯一性ID。 若用户输入私密信息的第一个字符信息时通过在底层利用时间戳加盐随机算法成功生成第一ID及第二ID,则执行步骤S32,对第一ID进行加密得到加密ID,并将加密ID和第二ID保存在内存中。其中,第二ID用于供所述移动应用调用。本实施例中,在用户输入私密信息的第一字符信息时,就生成该私密信息的唯一ID,可防重放攻击。其中,重放攻击(Replay Attacks)又称重播攻击、回放攻击,是指攻击者发送一个目的主机已接收过的包,来达到欺骗系统的目的,主要用于身份认证过程,破坏认证的正确性。
在其它实施例中,也可通过其它算法生成第一ID及第二ID,本申请对此不作具体限定。
在某些实施例,例如本实施例中,若用户输入私密信息的第一个字符信息时成功生成第一ID及第二ID之后,会启动内存变化监听线程监控内存变化,从而判断私密信息加密和/或解密过程中内存是否存在截取和/或篡改操作,进一步保障用户私密信息输入输出的安全性。如图5所示,可包括步骤S61-S66。
S61、实时监控内存变化。
S62、判断是否存在内存截取和/或内存篡改操作,若存在所述内存截取和/或所述内存篡改操作则执行步骤S63,否则执行步骤S61继续实时监控内存变化。
S63、判断所述内存截取和/或所述内存篡改操作是发生在对所述私密信息进行加密的过程中还是发生在对所述加密私密信息进行解密的过程中,若所述内存截取和/或所述内存篡改操作发生在对所述私密信息进行加密的过程中则执行步骤S64,若所述内存截取和/或所述内存篡改操作发生在对所述加密私密信息进行解密的过程中,则执行步骤S65。
S64、停止加密所述私密信息,向用户发出风险提示信息,关闭所述安全键盘。
S65、停止解密所述加密私密信息,向用户发出风险提示信息,关闭所述安全键盘。
在本申请实施例中,若用户输入私密信息的第一个字符信息时成功生成第一ID及第二ID之后,启动内存变化监听线程实时监控内存变化。其中,内存变化是通过监控内存文件的变化实现的。例如,当存在内存截取操作,将会出现断层的内存中断现象,并在底层so库中生成对应的内存中断文件,从而可判 断出内存是否被截取。在具体实施中,通过判断是否存在内存截取和/或内存篡改操作,若未存在内存截取和/或内存篡改等危险操作,则继续监控内存变化,用户继续输入私密信息。若存在内存截取和/或内存篡改等危险操作,则需要进一步判段内存截取和/或内存篡改操作是发生在对私密信息进行加密过程中还是发生在对加密私密信息进行解密的过程中,若发生在对私密信息进行加密过程中,则停止加密私密信息,向用户发出风险提示信息,关闭安全键盘。若发生在对加密私密信息解密过程中,向用户发出风险提示信息,则停止解密操作,关闭安全键盘。
需要说明的是,若用户输入私密信息的第一个字符信息时成功生成第一ID及第二ID之后,就启动内存变化监听线程实时监控内存变化,可在私密信息输入时、私密信息解密输出之前实时确保私密信息的安全性。
S32、对所述第一ID进行加密得到加密ID,并将所述加密ID及所述第二ID保存于内存中,其中,所述第二ID用于供所述移动应用调用。
本申请实施例中,若用户输入私密信息的第一个字符信息时成功生成第一ID及第二ID,则将第一ID进行加密得到加密ID,并将加密ID及第二ID保存于内存中。其中,第二ID用于供移动应用调用。可理解地,将加密ID及第二ID保存在内存中,以便对加密私密信息进行解密时,移动应用获取第二ID,请求解密第二ID表征的加密私密信息,匹配算法解密加密ID,得到解密ID,然后将解密ID与第二ID进行ID匹配,若解密ID与第二ID的ID匹配,则将加密私密信息进行解密以供移动应用调用。若解密ID与第二ID的ID不匹配,则表明该加密私密信息存在安全风险,应向用户发出风险提示信息。
S33、对所述私密信息进行加密得到所述加密私密信息,并将所述加密私密信息保存于内存中。
在本申请实施例中,可通过对私密信息进行RC4算法及AES字节填充加密得到加密私密信息,并将加密私密信息保存于内存中。
在其它实施方式中,也可采用其它算法对私密信息进行加密,在本申请中不作此限定。
在本申请实施例中,将加密私密信息保存于内存之后,还包括以下步骤:
S35、生成第一hash值。
在本申请实施例中,将加密私密信息保存于内存之后,还生成第一hash值, 该第一hash值用于对加密私密信息进行解密时,校验该第一hash值与解密加密私密信息时生成的第二hash值是否一致,从而判断是否存在内存篡改操作。
S34、向用户发出风险提示信息,关闭所述安全键盘。
在本申请实施例中,若用户输入私密信息的第一个字符信息时未成功生成第一ID及第二ID,表明表征用户输入的私密信息的唯一性ID生成失败,该私密信息存在安全风险,因此应停止输入用户私密信息,向用户发出风险提示信息,关闭安全键盘。例如,可通过在当前界面弹出提示框的方式来提醒用户当前输入的私密信息存在风险应停止输入。
S4、若接收到移动应用请求调用所述加密私密信息的指令,则第二次检测所述当前运行环境是否满足所述预设条件。
本申请实施例中,将加密私密信息保存在内存之后,若接收到移动应用请求调用所述加密私密信息的指令,则应对加密私密信息进行解密以供移动应用调用,为了进一步保证数据的安全性,在将加密私密信息进行解密之前,应再次检测终端当前的运行环境是否安全,即第二次检测当前运行环境是否满足预设条件。具体地,所述预设条件可包括三个安全条件,该三个安全条件分别为:当前运行环境未处于动态调试环境;当前运行环境未处于Hook框架环境;当前运行环境未存在二次打包攻击。若当前运行环境同时满足以上三个安全条件,则确定当前运行环境满足预设条件,表明所述终端当前处于安全状态,可对加密私密信息进行解密以供移动应用调用。
需要说明的是,步骤S4中与步骤S1对三个安全条件的判定一样,都可采用步骤S11-S14的方式,为描述简洁方便,在此不再赘述。
S5、若第二次检测到的所述当前运行环境满足所述预设条件,则将所述加密私密信息解密以供移动应用调用。
本申请实施例中,若第二次检测到的当前运行环境未处于动态调试环境、当前运行环境未处于Hook框架环境、当前运行环境未存在二次打包攻击,则将保存在内存中的加密私密信息解密以供移动应用调用。在解密私密信息之前检测当前运行环境,当前运行环境未处于动态调试环境、未处于Hook框架环境以及未存在二次打包攻击时,才将加密私密信息进行解密,可进一步确保输出私密信息的安全性。
在某些实施例,例如本实施例中,将加密私密信息保存于内存中之后,若 第二次检测到的当前运行环境满足预设条件,则在将加密私密信息解密以供移动应用调用的步骤之前,如图6所示,还包括步骤S71-S74。
S71、对所述加密ID进行解密得到解密ID,判断所述解密ID是否与所述第二ID相匹配,若所述解密ID与所述第二ID相匹配则执行步骤S72,否则执行步骤S73。
S72、生成第二hash值,并判断所述第二hash值与所述第一hash值是否一致,若所述第二hash值与所述第一hash值一致则执行步骤S5将所述加密私密信息进行解密以供所述移动应用调用,否则执行步骤S73。
S73、向用户发出风险提示信息,关闭所述安全键盘。
本申请实施例中,若第二次检测到的当前运行环境未处于动态调试环境、当前运行环境未处于Hook框架环境、当前运行环境未存在二次打包攻击,则表明终端运行的当前运行环境安全,则对加密ID进行解密得到解密ID,判断解密ID是否与第二ID相匹配。若解密ID与第二ID匹配,则生成第二hash值,并判断第二hash值与第一hash值是否一致,若第二hash值与第一hash值一致则执行步骤S5将加密私密信息进行解密以供移动应用调用。具体地,移动应用获取第二ID,请求解密第二ID表征的加密私密信息,匹配算法解密加密ID,得到解密ID,然后将解密ID与第二ID进行ID匹配,若解密ID与第二ID的ID匹配,生成第二hash值,并判断第二hash值与第一hash值是否一致,若第二hash值与第一hash值一致则执行步骤S5将加密私密信息进行解密以供移动应用调用。在解密加密私密信息之前,通过解密ID与第二ID是否匹配的判断,可检测该加密私密信息是否被改变。再通过第二hash值与第一hash值是否一致的判断,可检测是否存在内存篡改风险操作,从而确保加密私密信息输出之前,加密私密信息的安全性。
图7是本申请实施例提供的一种安全键盘实现装置70的示意性框图。如图8所示,对应于以上安全键盘实现方法,本申请还提供一种安全键盘实现装置80。该安全键盘实现装置80包括用于执行上述安全键盘实现方法的单元。具体地,请参阅图8,该安全键盘实现装置80包括第一检测单元81、键盘生成单元82、信息加密单元83、第二检测单元84以及信息解密单元85。
其中,第一检测单元81用于若接收到用户启动安全键盘的指令,则第一次检测当前运行环境是否满足预设条件;键盘生成单元82用于若第一次检测到的 所述当前运行环境满足所述预设条件,则生成安全键盘;信息加密单元83用于若接收到用户通过所述安全键盘输入的私密信息,对所述私密信息进行加密得到加密私密信息,并将所述加密私密信息保存于内存中;第二检测单元84用于第二次检测所述当前运行环境是否满足所述预设条件;信息解密单元85用于若第二次检测到的所述当前运行环境满足所述预设条件,则将所述加密私密信息进行解密以供所述移动应用调用。
在某些实施例,例如本实施例中,参见图8,所述第一检测单元81包括第一判断单元811、第二判断单元812、第三判断单元813及判定单元814。
其中,第一判断单元811用于判断所述当前运行环境是否处于动态调试环境;第二判断单元812用于判断所述当前运行环境是否处于Hook框架环境;第三判断单元813用于判断所述当前运行环境是否存在二次打包攻击;判定单元814用于若所述当前运行环境未处于所述动态调试环境、未处于所述Hook框架环境且未存在二次打包攻击,判定所述当前运行环境满足所述预设条件。
在某些实施例,例如本实施例中,参见图9,所述键盘生成单元82包括获取单元821、第一生成子单元822、第二生成子单元823以及第三生成子单元824。
其中,获取单元821用于获取预先配置的UI键;第一生成子单元822用于根据所述UI键生成与所述UI键对应的默认序列;第二生成子单元823用于随机生成键盘键值序列;第三生成子单元824用于将所述键盘键值序列依次赋值给所述默认序列以生成所述安全键盘。
在某些实施例,例如本实施例中,参见图10,所述信息加密单元83包括第四判断单元831、第一加密子单元832、第二加密子单元833以及第四生成子单元834。
其中,第四判断单元831用于若接收到用户通过所述安全键盘输入的私密信息,判断用户输入所述私密信息的第一个字符信息时是否成功生成第一ID及第二ID,其中,所述第一ID和所述第二ID相同;第一加密子单元832用于对所述第一ID进行加密得到加密ID,并将所述加密ID及所述第二ID保存于内存中,其中,所述第二ID用于供所述移动应用调用;第二加密子单元833用于对所述私密信息进行加密得到所述加密私密信息,并将所述加密私密信息保存于内存中;第四生成子单元834用于将加密私密信息保存于内存之后,生成第一hash值。
在某些实施例,例如本实施例中,参见图11,所述安全键盘实现装置80包括还包括内存监控单元86。所述内存监控单元86包括内存监控子单元861、第五判断单元862、第六判断单元863、停止信息加密单元864以及停止信息解密单元865。
其中,内存监控子单元861用于实时监控内存变化;第五判断单元862用于判断是否存在内存截取和/或内存篡改操作;第六判断单元863用于判断所述内存截取和/或所述内存篡改操作是否发生在对所述私密信息进行加密或解密的过程中;停止信息加密单元864用于若所述内存截取和/或所述内存篡改操作发生在对所述私密信息进行加密的过程中,则停止加密所述私密信息,向用户发出风险提示信息,关闭所述安全键盘;停止信息解密单元865用于若所述内存截取和/或所述内存篡改操作发生在对所述加密私密信息进行解密的过程中,则停止解密所述加密私密信息,向用户发出风险提示信息,关闭所述安全键盘。
在某些实施例,例如本实施例中,参见图12,所述安全键盘实现装置80还包括信息解密输出判定单元87。所述信息解密输出判定单元87包括信息解密子单元871、第七判断单元872、第八判断单元873以及信息解密输出单元874。
其中,信息解密子单元871用于对所述加密ID进行解密得到解密ID;第七判断单元872用于判断所述解密ID是否与所述第二ID相匹配;第八判断单元873用于若所述解密ID与所述第二ID相匹配,则生成第二hash值,并判断所述第二hash值与所述第一hash值是否一致;信息解密输出单元874用于若所述第二hash值与所述第一hash值一致,则将所述加密私密信息进行解密以供所述移动应用调用。
可理解地,第二检测单元82与第一检测单元81一样,都包括第一判断单元811、第二判断单元812、第三判断单元813以及判定单元814且这三者的检测顺序都与顺序无关,为了描述的简洁,在此不再赘述。
需要说明的是,所属领域的技术人员可以清楚地了解到,上述安全键盘实现装置80和各单元的具体实现过程,可以参考前述方法实施例中的相应描述,为了描述的方便和简洁,在此不再赘述。
上述安全键盘实现装置可以实现为一种计算机程序的形式,该计算机程序可以在如图13所示的计算机设备上运行。
请参阅图13,图13是本申请实施例提供的一种计算机设备的示意性框图。 该计算机设备900为终端,终端可以是智能手机、平板电脑、个人数字助理和穿戴式设备等具有通信功能的电子设备。
参阅图13,该计算机设备900包括通过系统总线901连接的处理器902、存储器和接口907,其中,存储器可以包括非易失性存储介质903和内存储器904。
该非易失性存储介质903可存储操作系统9031和计算机程序9032。该计算机程序9032被执行时,可使得处理器902执行一种安全键盘实现方法。
该处理器902用于提供计算和控制能力,以支撑整个计算机设备900的运行。
该内存储器904为非易失性存储介质903中的计算机程序9032的运行提供环境,该计算机程序9032被处理器902执行时,以实现本申请实施例的安全键盘实现方法。
该接口905用于与其它设备进行通信。本领域技术人员可以理解,图13中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备900的限定,具体的计算机设备900可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
应当理解,在本申请实施例中,处理器902可以是中央处理单元(Central Processing Unit,CPU),该处理器902还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
本领域普通技术人员可以理解的是实现上述实施例的方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成。该计算机程序可存储于一存储介质中,该存储介质为计算机可读存储介质。该计算机程序被该计算机系统中的至少一个处理器执行,以实现上述方法的实施例的流程步骤。
因此,本申请还提供一种存储介质。该存储介质可以为计算机可读存储介质。该存储介质存储有计算机程序。该计算机程序被处理器执行时使处理器执行以实现本申请实施例的安全键盘实现方法。
所述存储介质可以是U盘、移动硬盘、只读存储器(Read-Only Memory, ROM)、磁碟或者光盘等各种可以存储程序代码的计算机可读存储介质。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的。例如,各个单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。
本申请实施例方法中的步骤可以根据实际需要进行顺序调整、合并和删减。本申请实施例装置中的单元可以根据实际需要进行合并、划分和删减。另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以是两个或两个以上单元集成在一个单元中。
该集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分,或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,终端,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (20)

  1. 一种安全键盘实现方法,包括:
    若接收到用户启动安全键盘的指令,则第一次检测当前运行环境是否满足预设条件;
    若第一次检测到的所述当前运行环境满足所述预设条件,则生成安全键盘;
    若接收到用户通过所述安全键盘输入的私密信息,对所述私密信息进行加密得到加密私密信息,并将所述加密私密信息保存于内存中;
    若接收到移动应用请求调用所述加密私密信息的指令,则第二次检测当前运行环境是否满足预设条件;
    若第二次检测到的所述当前运行环境满足所述预设条件,则将所述加密私密信息进行解密以供所述移动应用调用。
  2. 根据权利要求1所述的安全键盘实现方法,其中,所述检测当前运行环境是否满足预设条件,包括:
    若检测到所述当前运行环境未处于动态调试环境、未处于Hook框架环境且未存在二次打包攻击,则判定所述当前运行环境满足所述预设条件。
  3. 根据权利要求2所述的安全键盘实现方法,其中,所述检测当前运行环境是否满足预设条件,包括:
    判断所述当前运行环境是否处于动态调试环境;
    若所述当前运行环境未处于所述动态调试环境,则判断所述当前运行环境是否处于Hook框架环境;
    若所述当前运行环境未处于所述Hook框架环境,则判断所述当前运行环境是否存在二次打包攻击;
    若所述当前运行环境未存在二次打包攻击,则判定所述当前运行环境满足所述预设条件。
  4. 根据权利要求1所述的安全键盘实现方法,其中,所述生成安全键盘,包括:
    获取预先配置的UI键;
    根据所述UI键生成与所述UI键对应的默认序列;
    随机生成键盘键值序列;
    将所述键盘键值序列依次赋值给所述默认序列以生成所述安全键盘。
  5. 根据权利要求1所述的安全键盘实现方法,其中,所述若接收到用户通过所述安全键盘输入的私密信息,对所述私密信息进行加密得到加密私密信息,并将所述加密私密信息保存于内存中,包括:
    若接收到用户通过所述安全键盘输入的私密信息,判断用户输入所述私密信息的第一个字符信息时是否成功生成第一ID及第二ID,其中,所述第一ID和所述第二ID相同;
    若用户输入所述私密信息的第一个字符信息时成功生成所述第一ID及所述第二ID,则对所述第一ID进行加密得到加密ID,并将所述加密ID及所述第二ID保存于内存中,其中,所述第二ID用于供所述移动应用调用;
    对所述私密信息进行加密得到所述加密私密信息,并将所述加密私密信息保存于内存中;
    所述将所述加密私密信息保存于内存中的步骤之后,所述方法还包括:
    若第二次检测到的所述当前运行环境满足所述预设条件,则对所述加密ID进行解密得到解密ID,并判断所述解密ID是否与所述第二ID相匹配;
    若所述解密ID与所述第二ID相匹配,则执行所述将所述加密私密信息进行解密以供移动应用调用的步骤。
  6. 根据权利要求5所述的安全键盘实现方法,其中,所述若用户输入所述私密信息的第一个字符信息时成功生成所述第一ID及所述第二ID的步骤之后,还包括:
    实时监控内存变化;
    判断是否存在内存截取和/或内存篡改操作;
    若存在内存截取和/或内存篡改操作,则判断所述内存截取和/或内存篡改操作是否发生在对所述私密信息进行加密或解密的过程中;
    若所述内存截取和/或内存篡改操作发生在对所述私密信息进行加密或解密的过程中,则停止加密或解密所述私密信息,关闭所述安全键盘。
  7. 根据权利要求5所述的安全键盘实现方法,其中,所述将所述加密私密信息保存于内存中的步骤之后,还包括:
    生成第一hash值;
    若所述第二ID与所述解密ID匹配,则生成第二hash值,并判断所述第二hash值与所述第一hash值是否一致;
    若所述第二hash值与所述第一hash值一致,则执行所述将所述加密私密信息进行解密以供移动应用调用的步骤。
  8. 一种安全键盘实现装置,包括:
    第一检测单元,用于若接收到用户启动安全键盘的指令,则第一次检测当前运行环境是否满足预设条件;
    键盘生成单元,用于若第一次检测到的所述当前运行环境满足所述预设条件,则生成安全键盘;
    信息加密单元,用于若接收到用户通过所述安全键盘输入的私密信息,对所述私密信息进行加密得到加密私密信息,并将所述加密私密信息保存于内存中;
    第二检测单元,用于若接收到移动应用请求调用所述加密私密信息的指令,则第二次检测当前运行环境是否满足预设条件;
    信息解密单元,用于若第二次检测到的所述当前运行环境满足所述预设条件,则将所述加密私密信息进行解密以供所述移动应用调用。
  9. 根据权利要求8所述的安全键盘实现装置,其中,所述第一检测单元包括:
    第一判断单元,用于判断所述当前运行环境是否处于动态调试环境;
    第二判断单元,用于判断所述当前运行环境是否处于Hook框架环境;
    第三判断单元,用于判断所述当前运行环境是否存在二次打包攻击;
    判定单元,用于若所述当前运行环境未处于所述动态调试环境、未处于所述Hook框架环境且未存在二次打包攻击,判定所述当前运行环境满足所述预设条件。
  10. 根据权利要求8所述的安全键盘实现装置,其中,所述加密单元包括:
    第四判断单元,用于若接收到用户通过所述安全键盘输入的私密信息,判断用户输入所述私密信息的第一个字符信息时是否成功生成第一ID及第二ID,其中,所述第一ID和所述第二ID相同;
    第一加密子单元,用于对所述第一ID进行加密得到加密ID,并将所述加密ID及所述第二ID保存于内存中,其中,所述第二ID用于供所述移动应用调用;
    第二加密子单元,用于对所述私密信息进行加密得到所述加密私密信息,并将所述加密私密信息保存于内存中;
    第四生成子单元,用于将加密私密信息保存于内存之后,生成第一hash值。
  11. 一种计算机设备,包括存储器以及与所述存储器相连的处理器;其中,所述存储器用于存储计算机程序;所述处理器用于运行所述存储器中存储的计算机程序,以执行如下步骤:
    若接收到用户启动安全键盘的指令,则第一次检测当前运行环境是否满足预设条件;
    若第一次检测到的所述当前运行环境满足所述预设条件,则生成安全键盘;
    若接收到用户通过所述安全键盘输入的私密信息,对所述私密信息进行加密得到加密私密信息,并将所述加密私密信息保存于内存中;
    若接收到移动应用请求调用所述加密私密信息的指令,则第二次检测当前运行环境是否满足预设条件;
    若第二次检测到的所述当前运行环境满足所述预设条件,则将所述加密私密信息进行解密以供所述移动应用调用。
  12. 根据权利要求11所述的计算机设备,其中,所述若接收到用户启动安全键盘的指令,则第一次检测当前运行环境是否满足预设的步骤包括:
    若检测到所述当前运行环境未处于动态调试环境、未处于Hook框架环境且未存在二次打包攻击,则判定所述当前运行环境满足所述预设条件。
  13. 根据权利要求11所述的计算机设备,其中,所述若接收到用户启动安全键盘的指令,则第一次检测当前运行环境是否满足预设条件的步骤包括:
    判断所述当前运行环境是否处于动态调试环境;
    若所述当前运行环境处于动态调试环境,则所述当前运行环境存在安全风险,应不启动安全键盘;
    若所述当前运行环境未处于所述动态调试环境,则判断所述当前运行环境是否处于Hook框架环境;
    若所述当前运行环境处于Hook框架环境,则所述当前运行环境存在安全风险,应不启动安全键盘;
    若所述当前运行环境未处于Hook框架环境,则判断所述当前运行环境是否存在二次打包攻击;
    若所述当前运行环境存在二次打包攻击,则所述当前运行环境存在安全风险,应不启动安全键盘;
    若所述当前运行环境未存在二次打包攻击,则判定所述当前运行环境满足所述预设条件,生成所述安全键盘。
  14. 根据权利要求11所述的计算机设备,其中,所述若第一次检测到的所述当前运行环境满足所述预设条件,则生成安全键盘的步骤包括:
    获取预先配置的UI键;
    根据所述UI键生成与所述UI键对应的默认序列;
    随机生成键盘键值序列;
    将所述键盘键值序列依次赋值给所述默认序列以生成所述安全键盘。
  15. 根据权利要求11所述的计算机设备,其中,所述若接收到用户通过安全键盘输入的私密信息,对所述私密信息进行加密得到加密私密信息,并将所述加密私密信息保存于内存中的步骤包括:
    若接收到用户通过所述安全键盘输入的私密信息,判断用户输入所述私密信息的第一个字符信息时是否成功生成第一ID及第二ID,其中,所述第一ID和所述第二ID相同;
    若用户输入所述私密信息的第一个字符信息时成功生成所述第一ID及所述第二ID,则对所述第一ID进行加密得到加密ID,并将所述加密ID及所述第二ID保存于内存中,其中,所述第二ID用于供所述移动应用调用;
    对所述私密信息进行加密得到所述加密私密信息,并将所述加密私密信息保存于内存中。
  16. 根据权利要求15所述的计算机设备,其中,所述若用户输入所述私密信息的第一个字符信息时成功生成所述第一ID及所述第二ID的步骤之后包括:
    实时监控内存变化;
    判断是否存在内存截取和/或内存篡改操作;
    若未存在内存截取和/或内存篡改操作,则继续监控内存变化;
    若存在内存截取和/或内存篡改操作,则判断所述内存截取和/或所述内存篡改操作是否发生在对所述私密信息进行加密或解密过程中;
    若所述内存截取和/或所述内存篡改操作发生在对所述私密信息进行加密或解密过程中,则停止加密或解密所述私密信息,关闭所述安全键盘。
  17. 根据权利要求15所述的计算机设备,其中,所述将所述加密私密信息保存于内存中的步骤之后包括:
    生成第一hash值;
    若所述第二ID与所述解密ID匹配,则生成第二hash值,并判断所述第二hash值与所述第一hash值是否一致;
    若所述第二hash值与所述第一hash值一致,则执行所述将所述加密私密信息进行解密以供移动应用调用的步骤。
  18. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时使所述处理器执行以下步骤:
    若接收到用户启动安全键盘的指令,则第一次检测当前运行环境是否满足预设条件;
    若第一次检测到的所述当前运行环境满足所述预设条件,则生成安全键盘;
    若接收到用户通过所述安全键盘输入的私密信息,对所述私密信息进行加密得到加密私密信息,并将所述加密私密信息保存于内存中;
    若接收到移动应用请求调用所述加密私密信息的指令,则第二次检测当前运行环境是否满足预设条件;
    若第二次检测到的所述当前运行环境满足所述预设条件,则将所述加密私密信息进行解密以供所述移动应用调用。
  19. 根据权利要求18所述的计算机可读存储介质,其中,所述若接收到用户启动安全键盘的指令,则第一次检测当前运行环境是否满足预设条件的步骤包括:
    判断所述当前运行环境是否处于动态调试环境;
    若所述当前运行环境处于动态调试环境,则所述当前运行环境存在安全风险,应不启动安全键盘;
    若所述当前运行环境未处于所述动态调试环境,则判断所述当前运行环境是否处于Hook框架环境;
    若所述当前运行环境处于Hook框架环境,则所述当前运行环境存在安全风险,应不启动安全键盘;
    若所述当前运行环境未处于Hook框架环境,则判断所述当前运行环境是否存在二次打包攻击;
    若所述当前运行环境存在二次打包攻击,则所述当前运行环境存在安全风险,应不启动安全键盘;
    若所述当前运行环境未存在二次打包攻击,则判定所述当前运行环境满足所述预设条件,生成所述安全键盘。
  20. 根据权利要求18所述的计算机可读存储介质,其中,所述若接收到用户通过安全键盘输入的私密信息,对所述私密信息进行加密得到加密私密信息,并将所述加密私密信息保存于内存中的步骤具体包括:
    若接收到用户通过所述安全键盘输入的私密信息,判断用户输入所述私密信息的第一个字符信息时是否成功生成第一ID及第二ID,其中,所述第一ID和所述第二ID相同;
    若用户输入所述私密信息的第一个字符信息时成功生成所述第一ID及所述第二ID,则对所述第一ID进行加密得到加密ID,并将所述加密ID及所述第二ID保存于内存中,其中,所述第二ID用于供所述移动应用调用;
    对所述私密信息进行加密得到所述加密私密信息,并将所述加密私密信息保存于内存中。
PCT/CN2019/118238 2019-09-19 2019-11-14 安全键盘实现方法、装置、计算机设备及存储介质 WO2021051591A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910889045.1A CN110765470A (zh) 2019-09-19 2019-09-19 安全键盘实现方法、装置、计算机设备及存储介质
CN201910889045.1 2019-09-19

Publications (1)

Publication Number Publication Date
WO2021051591A1 true WO2021051591A1 (zh) 2021-03-25

Family

ID=69329683

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/118238 WO2021051591A1 (zh) 2019-09-19 2019-11-14 安全键盘实现方法、装置、计算机设备及存储介质

Country Status (2)

Country Link
CN (1) CN110765470A (zh)
WO (1) WO2021051591A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111586076B (zh) * 2020-05-26 2021-12-07 清华大学 基于混合密码的遥控遥测信息防篡改加解密方法和系统
CN112671715B (zh) * 2020-12-03 2023-05-09 上海连尚网络科技有限公司 一种用于保障应用的数据安全通信的方法与装置
CN113158264A (zh) * 2020-12-17 2021-07-23 武汉天喻信息产业股份有限公司 一种安全键盘sdk实现装置及方法
CN113608803A (zh) * 2021-08-16 2021-11-05 上海万物新生环保科技集团有限公司 一种用于多运行环境下实现功能操作的方法与设备

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102682230A (zh) * 2011-03-18 2012-09-19 中国电信股份有限公司 针对互联网远程控制的安全防护方法和装置
CN108763972A (zh) * 2018-05-18 2018-11-06 北京智游网安科技有限公司 一种基于网页的自绘随机键盘系统
CN110210211A (zh) * 2019-06-05 2019-09-06 北京证大向上金融信息服务有限公司 一种数据保护的方法和计算设备

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102393886B (zh) * 2011-06-29 2014-11-26 北京数码视讯科技股份有限公司 移动终端的安全控制方法、装置及系统
CN102930222B (zh) * 2012-09-20 2015-09-30 无锡华御信息技术有限公司 反键盘记录方法及系统
CN103996011A (zh) * 2014-06-05 2014-08-20 福建天晴数码有限公司 一种保护密码输入安全的方法和装置
CN104267994B (zh) * 2014-09-30 2017-10-31 北京奇虎科技有限公司 一种运行应用程序的装置和终端设备
CN106529353A (zh) * 2016-10-26 2017-03-22 努比亚技术有限公司 一种对按键输入信息进行防窃听处理的方法和装置
CN106503507A (zh) * 2016-10-31 2017-03-15 维沃移动通信有限公司 一种密码显示的方法和移动终端
KR20180129302A (ko) * 2017-05-26 2018-12-05 삼성에스디에스 주식회사 보안 키보드의 실행 방법 및 이를 수행하기 위한 장치 및 시스템
CN108629184A (zh) * 2018-05-18 2018-10-09 北京智游网安科技有限公司 一种ios用的sdk安全检测方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102682230A (zh) * 2011-03-18 2012-09-19 中国电信股份有限公司 针对互联网远程控制的安全防护方法和装置
CN108763972A (zh) * 2018-05-18 2018-11-06 北京智游网安科技有限公司 一种基于网页的自绘随机键盘系统
CN110210211A (zh) * 2019-06-05 2019-09-06 北京证大向上金融信息服务有限公司 一种数据保护的方法和计算设备

Also Published As

Publication number Publication date
CN110765470A (zh) 2020-02-07

Similar Documents

Publication Publication Date Title
US10922441B2 (en) Device and method for data security with a trusted execution environment
WO2021051591A1 (zh) 安全键盘实现方法、装置、计算机设备及存储介质
WO2021052086A1 (zh) 一种信息处理方法及装置
US10009173B2 (en) System, device, and method of secure entry and handling of passwords
CN112513857A (zh) 可信执行环境中的个性化密码安全访问控制
US9514300B2 (en) Systems and methods for enhanced security in wireless communication
CN101340281B (zh) 针对在网络上进行安全登录输入的方法和系统
US9054865B2 (en) Cryptographic system and methodology for securing software cryptography
US7457960B2 (en) Programmable processor supporting secure mode
US10250387B1 (en) Quantum computer resistant algorithm cryptographic key generation, storage, and transfer device
US10867049B2 (en) Dynamic security module terminal device and method of operating same
WO2022028289A1 (zh) 数据加密方法、数据解密方法、装置、终端和存储介质
TW201539247A (zh) 密碼輸入與確認方法及其系統
Götzfried et al. Analysing Android's Full Disk Encryption Feature.
WO2023155696A1 (zh) 数据库的操作方法、系统、存储介质以及计算机终端
Götzfried et al. Mutual authentication and trust bootstrapping towards secure disk encryption
WO2022052665A1 (zh) 无线终端及无线终端在Uboot模式下的接口访问鉴权方法
CN110932853B (zh) 一种基于可信模块的密钥管理装置和密钥管理方法
Loftus et al. Android 7 file based encryption and the attacks against it
CN116956298A (zh) 应用运行环境检测方法和装置
US10114654B2 (en) Method of booting a production computer system
KR20220097037A (ko) 데이터 유출 방지 시스템
WO2020207292A1 (zh) 数据安全处理系统、方法、存储介质、处理器及硬件安全卡
CN106934256B (zh) 一种企业数据服务器的保护方法及装置
CN113434865A (zh) 一种用于移动端的安全检测方法、装置、设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19945978

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19945978

Country of ref document: EP

Kind code of ref document: A1