WO2019141112A1 - 获取输入字符的方法及装置 - Google Patents

获取输入字符的方法及装置 Download PDF

Info

Publication number
WO2019141112A1
WO2019141112A1 PCT/CN2019/070855 CN2019070855W WO2019141112A1 WO 2019141112 A1 WO2019141112 A1 WO 2019141112A1 CN 2019070855 W CN2019070855 W CN 2019070855W WO 2019141112 A1 WO2019141112 A1 WO 2019141112A1
Authority
WO
WIPO (PCT)
Prior art keywords
function
character
input
memory address
creating
Prior art date
Application number
PCT/CN2019/070855
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 WO2019141112A1 publication Critical patent/WO2019141112A1/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/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/82Protecting input, output or interconnection devices
    • G06F21/83Protecting input, output or interconnection devices input devices, e.g. keyboards, mice or controllers thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/02Input arrangements using manually operated switches, e.g. using keyboards or dials
    • G06F3/023Arrangements for converting discrete items of information into a coded form, e.g. arrangements for interpreting keyboard generated codes as alphanumeric codes, operand codes or instruction codes
    • G06F3/0233Character input methods

Definitions

  • the embodiments disclosed in the present specification relate to the field of network communication technologies, and in particular, to a method and apparatus for acquiring input characters.
  • APP Application, or APP
  • terminals such as mobile phones and computers
  • APP Application, or APP
  • APP Application, or APP
  • a payment application such as Alipay, etc.
  • a note-taking application such as an Evernote note, etc.
  • a shopping application eg, Taobao, Tmall, etc.
  • Check out shopping advice or purchase the required items or use a travel app (eg, flying pig travel, etc.) to purchase train tickets, airline tickets, or book a hotel.
  • travel app eg, flying pig travel, etc.
  • This specification describes a method and apparatus for obtaining input characters by creating a first function corresponding to a system default, a second function for receiving input characters in an input box, and a first memory of the first function
  • the address is interchanged with the second memory address of the second function, so that the system retrieves the input character in the input box through the second memory address callback first function, thereby ensuring the security of the character input by the user in the input box.
  • a method of obtaining input characters includes:
  • a first function is created, the first function corresponding to a second function of the system for receiving an input character in the input box, the first function being assigned Having a first memory address, the second function being assigned a second memory address;
  • the creating the first function includes:
  • the name of the first function is randomly generated.
  • the randomly generating the name of the first function includes: generating a name of the first function according to a current time.
  • the creating the first function includes:
  • the first function is created in the first class.
  • the creating the first class includes: randomly generating a name of the first class.
  • mapping the first function to the second memory address and the mapping the second function to the first memory address comprises:
  • the first memory address and the second memory address are interchanged using an address swap function.
  • the method further includes:
  • the second function is invoked by the first memory address to pass the masquerading character to the second function.
  • the randomly generating the masquerading characters by using the first function includes:
  • the first character is used as the camouflage character.
  • the calling the second function by using the first memory address includes:
  • the first memory address is invoked using a self-calling function.
  • the method further includes:
  • the input characters received by the first function are submitted to the server.
  • a character input device in a second aspect, includes:
  • a creating unit for creating a first function in response to an activation operation on the input box, the first function corresponding to a second function of the system for receiving an input character in the input box,
  • the first function is assigned a first memory address
  • the second function is assigned a second memory address
  • mapping unit configured to map the first function to the second memory address, and the second function to the first memory address
  • a callback unit configured to call back the first function by the second memory address in response to a character input operation on the input box
  • an obtaining unit configured to acquire an input character corresponding to the character input operation by using the first function.
  • the creating unit is specifically configured to:
  • the name of the first function is randomly generated.
  • the creating unit is specifically configured to:
  • the name of the first function is generated according to the current time.
  • the creating unit specifically includes:
  • a first creating subunit configured to create a first class, where the first class corresponds to a system default class to which the second function belongs;
  • the first creating subunit is specifically configured to:
  • the name of the first class is randomly generated.
  • mapping unit is specifically configured to:
  • the first function is mapped to the second memory address and the second function is mapped to the first memory address using an address swap function.
  • the method further includes:
  • a generating unit configured to randomly generate a masquerading character by using the first function
  • a calling unit configured to invoke the second function by the first memory address, thereby transferring the masquerading character to the second function.
  • the generating unit is specifically configured to:
  • the first character is used as the camouflage character.
  • the calling unit is specifically configured to:
  • the first memory address is invoked using a self-calling function.
  • the method further includes:
  • a submitting unit for submitting input characters received by the first function to a server.
  • a computer readable storage medium having a computer program stored thereon is provided.
  • the computer program is executed in a computer, the computer is caused to perform the method provided by any of the above-described first aspects.
  • a computing device comprising a memory and a processor.
  • An executable code is stored in the memory, and when the processor executes the executable code, the method provided by any one of the foregoing first aspects is implemented.
  • a first function for receiving an input character in an input box is created, and the method and the system are used by default.
  • the second function that receives the input character corresponds.
  • the first memory address of the first function and the second memory address of the second function are interchanged.
  • the first function is called back by the second memory address, and the input character is obtained by the first function instead of the input function by the second function of the system default.
  • the masquerading character may be randomly generated by the first function, and the second function is called by the first memory address, so that the second function acquires the masquerading character, thereby making the illegal function
  • the numerator monitors the system's default second function to intercept the user's input characters, it obtains a disguised character that is different from the input character (the information actually entered by the user). In this way, on the basis of obtaining the input character by creating the first function, the illegal molecule monitoring the second function is intercepted to the randomly generated camouflage character, thereby realizing the screening of the first function, thereby more effectively ensuring the security of the user input character.
  • FIG. 1 is a schematic diagram of an application scenario of a method for acquiring input characters according to an embodiment of the present disclosure
  • FIG. 2 is a flow chart of a method for obtaining input characters according to an embodiment of the present disclosure
  • FIG. 3 is a flowchart of another method for obtaining input characters according to an embodiment of the disclosure.
  • FIG. 4 is a schematic diagram of interaction of acquiring input characters according to an embodiment of the present disclosure
  • FIG. 5 is a structural diagram of an apparatus for acquiring input characters according to an embodiment of the present disclosure.
  • FIG. 1 is a schematic diagram of an application scenario of a method for acquiring input characters according to an embodiment of the present disclosure.
  • the execution body of the method can be an application.
  • FIG. 1 when the user clicks on an input box in the application interface and inputs characters in the input box, the character input method provided by the various embodiments disclosed in the present specification can be employed.
  • a new function is created for receiving input characters in the input box, the new function corresponding to a system default callback function for receiving input characters in the input box.
  • the address of the new function is swapped with the address of the system callback function.
  • the original address is still called, but since the address has been swapped, the callback through the original address will be the newly created function, thereby obtaining the input character through the new function instead of passing the original
  • the system callback function gets the input characters.
  • FIG. 2 is a flowchart of a method for obtaining input characters according to an embodiment of the disclosure.
  • the execution body of the method can be an application. As shown in FIG. 2, the method specifically includes:
  • Step S210 in response to an activation operation performed on the input box, creating a first function.
  • the activation operation may be a click operation performed by the user on the input box, or may be another operation that can make the input box be in a state to be input
  • the state to be input refers to a state in which the user can directly input characters in the input box.
  • the blinking of the cursor in the input box indicates that you can enter characters directly in the input box.
  • a certain input box in the interface for example, the default is the first one
  • the first method ie, the first function
  • the first method of creation corresponds to a second method (ie, a second function) for receiving input characters in the input box by the system, the first method has a first memory address, and the second method has a second memory address.
  • the second method is the default system callback method
  • the first method is a new method created by "following" the system callback method. The following describes the running environment of the two methods and the creation process of the new method.
  • an operating system is a program that manages and controls terminal software and software resources. It is the most basic system software that runs directly on the terminal. Any other software must be in the operating system (eg, Windows system). , or Android (Android) system, or iOS system, etc.) can run. Accordingly, in the process of writing an application (a program that is used to improve the efficiency of a specific process is generally called an "application", such as an Alipay application), it is necessary to use a function provided by the operating system (for example, a program of a basic input/output section). .
  • a second method for receiving input characters in the input box by the system involved in the application may be written based on a program of the basic input and output portion provided by the OS.
  • the second method may be a system default function (eg, textChange(String text)) consisting of a function name (eg, textChange), a variable type (eg, String), and a variable name (eg, text).
  • Any program eg, C language printf ("hello")
  • printf e.g., printf
  • data e.g, hello
  • memory e.g, using dynamic random access memory (Dynamic Random) Access Memory (DRAM)
  • DRAM Dynamic Random Access Memory
  • the contents of the memory are marked and specified by an address (for example, an address with a binary code of 01001001). Accordingly, when the instructions and data included in the program are loaded into the memory, they are assigned corresponding memory addresses.
  • the second method involved in the embodiment of the present specification (that is, a function composed of instructions and data), when it is loaded into the memory, it will have a corresponding memory address, that is, the second method mentioned in the foregoing.
  • the second memory address that you have.
  • the first method has a first memory address, which is a memory address allocated for the first method when the first method is created in the memory.
  • creating the first method may include: creating a first class, and the class corresponds to a system default class to which the second method belongs; and then creating a first corresponding to the second method in the first class method.
  • the first method corresponds to the second method, which means that the first method has the same function as the second method, and is used to receive input characters in the input box.
  • the first method has the same structure as the second method, for example, may have the same parameter type (eg, String), variable (eg, text), but has a different method name (eg, the name of the first method) Can be exchangeMethod, the name of the second method can be textChange).
  • creating the first class may include randomly generating a name of the first class.
  • randomly generating the name of the first class may include generating a first class name using a random algorithm.
  • the random algorithm uses a certain degree of randomness as part of its logic.
  • the algorithm usually uses random bits as auxiliary inputs to guide its behavior, while random bits can be based on at least one of multiple dimensions (eg, time, username, etc.). One dimension to determine.
  • the randomly generated first class name can be "Exchange 'ID' Class" (eg, the current user's username is Gloria, then the first class name can be ExchangeGloriaClass).
  • creating the first method may include randomly generating a name of the first method.
  • the name of the first method can be generated from at least one of a plurality of dimensions (eg, time, username, etc.).
  • the name of the randomly generated first method may be "exchange 'time' Method" (eg, the current time is 11:10 am, then the name of the first method may be exchange 1110 Method).
  • Dynamically creating classes and methods refers to the use of the programming language runtime feature to dynamically create private classes (that is, default classes that exist in non-operating systems) and methods in memory.
  • the runtime characteristics refer to the characteristics of programs written by dynamic programming languages (such as java, Objective-c) that can change their structure at runtime (for example, can introduce new functions or delete existing functions).
  • the first class is the same as the system default class in that the two classes inherit the same parent class, and the first method and the second method with corresponding relationships are created in the first class and the system default class.
  • the difference between the two is that the first method can only include the first method, and the system default class can also include other methods than the second method.
  • step S220 the first function is mapped to the second memory address, and the second function is mapped to the first memory address. That is, the first memory address of the first method and the second memory address of the second method are interchanged.
  • the first memory address (which may be embodied in the programming language as the name of the first method) and the second memory address (which may be embodied in the programming language as the name of the second method) may be used using an address interchange function. ) Interchange.
  • the names of the first method and the second method are exchangeMethod and textChange, respectively, and the name of the address interchange function can be method_exchangeImplementations. Accordingly, the exchange of the first memory address of the first method and the second memory address of the second method can be implemented using a program including the statement "method_exchangeImplementations(textChange, exchangeMethod);".
  • Step S230 in response to the character input operation performed on the input box, call back the first function through the second memory address, and acquire the input character through the first function.
  • the second memory address is the address of the system default callback method
  • the default address is still performed according to the original address.
  • the current second memory address corresponds to the newly created first method, so the callback through the second memory address is the first A method whereby the input character in the input box is obtained by the first method instead of the input character in the input box by the second method of the system default. In this way, it is possible to effectively prevent the occurrence of the case where the input character is stolen when the second method of the system default is monitored.
  • the first method in response to each operation of the character input to the input box, the first method is recalled once by the second memory address. That is to say, each time a character is received in the input box, the first method is called back through the second memory address accordingly.
  • the user enters a character (e.g., 'a') in the input box to trigger the application to call back the first method via the second memory address.
  • a character e.g., ‘_’
  • the method further includes: displaying the character acquired by the first method in an input box.
  • a callback to the first method is triggered, and the character is retrieved by the first method and displayed in the input box.
  • the obtained characters can be directly displayed, or the characters can be desensitized (that is, the sensitive data is deformed) and then displayed. For example, if the user clicks the character "1" in the input keyboard, the character "1" is obtained by the first method, and the character "1" is directly displayed in the input box.
  • “*” is displayed in the input box to prevent the leakage of the character information caused by the peeping by others.
  • the method may further include: submitting the input character acquired by the first method to the server.
  • submitting the input characters obtained by the first method to the server may include submitting the input characters to the server when the number of input characters received in the input box reaches a predetermined number.
  • the input characters obtained by the first method are submitted to the server according to the received commit instruction.
  • the predetermined number of input characters may be determined by the type of input information (eg, password, ID number, bank card number, etc.) corresponding to the input box.
  • an input box for receiving password information may have a predetermined number of input characters corresponding to 6.
  • the input box for receiving the ID number may have a predetermined number of input characters corresponding to 18.
  • the input box for receiving the bank card number of the Bank of Communications may have a predetermined number of input characters corresponding to 17.
  • the application can be automatically triggered to submit the received input characters to the server.
  • the input characters (eg, user name) received by the first method may be received according to the received submission instruction (eg, the submission instruction may be an instruction entered by the user by clicking a submit button in the application interface). Wang Limin ("”) submitted to the server.
  • FIG. 3 is a flow chart of another method for obtaining input characters according to an embodiment of the present disclosure.
  • the execution body of the method can be an application. As shown in FIG. 3, the method specifically includes:
  • Step S310 in response to an activation operation performed on the input box, creating a first function.
  • Step S320 mapping the first function to the second memory address, and mapping the second function to the first memory address.
  • Step S330 in response to the character input operation performed on the input box, call back the first function through the second memory address, and acquire the input character through the first function.
  • step S310 to the step S330 reference may be made to the description of the step S210 to the step S230, and details are not described herein.
  • Step S340 randomly generating a masquerading character by the first function.
  • randomly generating the masquerading character by the first method may include: directly using the randomly generated character as a masquerading character.
  • the method may include: randomly generating the first character, and determining whether the first character is equal to the input character. In the case where the first character is equal to the input character, the first character is regenerated; and in the case where the first character is not equal to the input character, the first character is used as a masquerading character.
  • the randomly generated masquerading characters are random, the probability that multiple randomly generated masquerading characters are identical to the multiple input characters included in the complete information input by the user is low, so the randomly generated characters are taken as The way to pretend characters can usually achieve better camouflage effects.
  • the first way of judging whether the randomly generated first character is equal to the input character it is ensured that the first character that is not equal to the input character is used as a camouflage character, so that the most comprehensive and optimal camouflage effect can be achieved.
  • the character can be directly used as a masquerading character.
  • the input character is assumed to be "1" and the randomly generated first character is "2". According to this, it can be judged that the first character is not equal to the input character, and the first character "2" is used as a disguised character.
  • the input character is "1" and the randomly generated first character is "1". According to this, it can be judged that the first character is equal to the input character and the first character is regenerated. It is assumed that the first character re-randomly generated is "2", whereby it can be judged that the first character is not equal to the input character, and the first character "2" is used as a masquerading character.
  • step S350 the second function is called by the first memory address, thereby transmitting the masquerading character to the second function.
  • calling the second method (that is, the second function) by using the first memory address may include: calling the first memory address by using a self-calling function (eg, self.), and then calling the first memory address by using the first memory address.
  • a self-calling function eg, self.
  • the self-calling function is a function that calls its own method.
  • the self-calling function is executed in the first method, and then the self-calling function automatically calls the default address of the associated method, that is, the first memory address of the first method.
  • the first memory address and the second memory address have been interchanged, but the calling process cannot know the swapping process. Therefore, when it is called according to the first memory address, the second method is actually called. Thereby implementing the transfer of the masquerading character to the second method.
  • the second method of the system default may not be called for a long time when the input character is obtained by creating the first method, which may cause a criminal (for example, by implanting a phishing program or a listener, the default in the system)
  • the second method sets a breakpoint to intercept the suspicion of the user's input character, and there is a risk of finding the first method of creation and then monitoring the first method.
  • the foregoing randomly generates the masquerading character in step S340, and invokes the second method by the first memory address in step S450, so that the second method obtains the masquerading character, so that the illegitimate molecule can be intercepted by the second method in the monitoring system by default.
  • you can still listen to the second method being called still get the character, but get the camouflage character that is different from the input character (the information the user actually inputs).
  • the illicit element monitoring the second method is intercepted to the randomly generated masquerading character, thereby realizing the screening of the first method, thereby more effectively ensuring the security of the user input character.
  • different input boxes can be used to receive input information having different categories (eg, name, ID number, password, birthday, nickname, bank card number, etc.).
  • Different types of input information often have different sensitivities, that is to say, some categories (such as ID number, password) have higher sensitivity of input information, and if these input information is leaked, it will cause more Large security risks (for example, criminals can use the user's ID number to make loans, etc.), while some categories (such as birthdays, nicknames) have lower sensitivity for input information.
  • step S340 and step S350 may be continued.
  • step S340 and step S350 may not be performed, that is, the dummy character is not required to be generated and the second method is required.
  • the second method is called directly through the first memory address, and the input character (the real information input by the user) is passed to the second method.
  • the method may further include: determining whether it is necessary to generate a masquerading character of the input character. In one embodiment, this can be determined by the tag value of the input box.
  • the tag value of the input box corresponds to the category of the input character.
  • the categories corresponding to the input boxes of the tag values 1001, 1002, and 1003 are the name, the ID number, and the password, respectively.
  • Determining whether it is necessary to generate a masquerading character of the input character may include: when the tag value of the input box belongs to the preset tag value set, the masquerading character of the input character needs to be generated, that is, step S340 and step S350 are required to be performed.
  • the second method is directly called by the first memory address, and the input character is passed to the second method.
  • the preset tag value set may be determined according to the sensitivity of the category of the input information corresponding to the tag value.
  • the interaction process may include:
  • step S410 the user activates the input box in the APP.
  • Step S420 the APP creates a first method for receiving an input character in the input box, the method having a first memory address and corresponding to a second method of the system default having the second memory address.
  • Step S430 the first memory address of the first method and the second memory address of the second method are exchanged.
  • step S440 the user inputs a character in the input box.
  • Step S450 the first method is called back by the second memory address, and the input character input by the user is obtained by the first method.
  • Step S460 randomly generating a masquerading character by the first method.
  • Step S470 the second method is invoked by the first memory address, thereby transmitting the masquerading character to the second method.
  • a first function for receiving an input character in the input box is created, This function corresponds to the system's default second function for receiving input characters.
  • the first memory address of the first function and the second memory address of the second function are interchanged.
  • the first function is called back by the second memory address, and the input character is obtained by the first function instead of the input character by the second function of the system default.
  • the masquerading character may be randomly generated by the first function, and the second function is called by the first memory address, so that the second function acquires the masquerading character, thereby making the illegal function
  • the numerator monitors the system's default second function to intercept the user's input characters, it obtains a disguised character that is different from the input character (the information actually entered by the user). In this way, on the basis of obtaining the input character by creating the first function, the illegal molecule monitoring the second function is intercepted to the randomly generated camouflage character, thereby realizing the screening of the first function, thereby more effectively ensuring the security of the user input character.
  • the embodiments disclosed in the present specification further provide a device for acquiring input characters.
  • the device includes:
  • the creating unit 510 is configured to, in response to the activation operation on the input box, create a first function, where the first function corresponds to a second function of the system for receiving an input character in the input box, the first function has a first function a memory address, the second function having a second memory address;
  • the mapping unit 520 is configured to map the first function to the second memory address, and the second function to the first memory address;
  • a callback unit 530 configured to call back a first function by a second memory address in response to a character input operation performed on the input box;
  • the obtaining unit 540 is configured to obtain an input character corresponding to the character input operation by using the first function.
  • the creating unit 510 is specifically configured to:
  • the creating unit 510 is specifically configured to:
  • the name of the first function is generated based on the current time.
  • the creating unit 510 specifically includes:
  • a first creating subunit 511 configured to create a first class, where the first class corresponds to a system default class to which the second function belongs;
  • the second creation subunit 512 is configured to create the first function in the first class.
  • the first creating subunit 511 is specifically configured to:
  • mapping unit 520 is specifically configured to:
  • the first memory address and the second memory address are interchanged using an address swap function.
  • the method further includes:
  • a generating unit 550 configured to randomly generate a masquerading character by using the first function
  • the calling unit 560 is configured to call the second function by using the first memory address, thereby transmitting the masquerading character to the second function.
  • the generating unit 550 is specifically configured to:
  • the first character is used as a masquerading character.
  • the calling unit 560 is specifically configured to:
  • the first memory address is called with a self-calling function.
  • the method further includes:
  • the submitting unit 570 is configured to submit the input characters received by the first function to the server.
  • the creating unit 510 creates a first function for receiving an input character in the input box in response to an activation operation on the input box.
  • This function corresponds to the system's default second function for receiving input characters.
  • Mapping unit 520 interchanges the first memory address of the first function with the second memory address of the second function.
  • the calling unit 530 in response to the character input operation on the input box, calls back the first function through the second memory address, and the obtaining unit 540 acquires the input character through the first function instead of acquiring the input character through the second function of the system default.
  • the generating unit 550 randomly generates the masquerading character by using the first function
  • the calling unit 560 calls the second function by using the first memory address, so that the second function acquires the masquerading character, so that the numerator is in the second function of the monitoring system default.
  • a camouflage character different from the input character (the information actually input by the user) is obtained.
  • the illegal molecule monitoring the second function is intercepted to the randomly generated camouflage character, thereby realizing the screening of the first function, thereby more effectively ensuring the security of the user input character.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • User Interface Of Digital Computer (AREA)
  • Input From Keyboards Or The Like (AREA)
  • Document Processing Apparatus (AREA)
  • Telephone Function (AREA)

Abstract

本说明书披露的实施例提供的一种获取输入字符的方法,该方法包括:创建用于接收输入框中的输入字符的新函数,该新函数与系统默认的、用于接收输入框中的输入字符的系统回调函数相对应。接着,将新函数的地址和系统回调函数的地址进行互换。然后,响应于对输入框进行的字符输入操作,仍然调用原地址,但是由于地址已经互换,通过原地址回调的将是新创建的函数,由此通过新函数获取输入字符。

Description

获取输入字符的方法及装置 技术领域
本说明书披露的多个实施例涉及网络通信技术领域,尤其涉及一种获取输入字符的方法及装置。
背景技术
随着互联网技术发展,人们越来越频繁地使用终端(如,手机、电脑)中包括的多个应用(Application,简称APP),以满足生活或工作的各种需求。例如,使用支付应用(如,支付宝等)进行转账、付款等操作,或者使用笔记应用(如,印象笔记等)记录工作事项或生活点滴,又或者使用购物应用(如,淘宝、天猫超市等)查看购物咨询或购买所需商品,再或者使用出行应用(如,飞猪旅行等)购买火车票、飞机票或预定酒店等。
用户在使用APP时,难免需要输入一些个人敏感信息。例如,在APP中注册账号时,需要输入手机号、密码等信息。又例如,在APP中进行实名认证时,需要输入姓名、身份证号、手机号、常用邮箱等信息。再例如,使用APP进行转账操作时,需要输入转出方和转入方的银行卡号、姓名、手机号等信息。目前,用户在APP中所输入的信息存在较大的被盗用的风险。因此,需要提供更安全的方式,以保证用户在APP中所输入信息的安全。
发明内容
本说明书描述了一种获取输入字符的方法及装置,通过创建与系统默认的、用于接收输入框中的输入字符的第二函数相对应的第一函数,以及将第一函数的第一内存地址与第二函数的第二内存地址进行互换,以使系统通过第二内存地址回调第一函数来获取输入框中的输入字符,从而保证用户在输入框中所输入字符的安全。
第一方面,提供了一种获取输入字符的方法。该方法包括:
响应于对输入框进行的激活操作,创建第一函数,所述第一函数与系统默认的、用于接收所述输入框中的输入字符的第二函数相对应,所述第一函数被分配有第一内存地址,所述第二函数被分配有第二内存地址;
将所述第一函数映射到所述第二内存地址、所述第二函数映射到所述第一内存地址;
响应于对输入框进行的字符输入操作,通过所述第二内存地址回调所述第一函数,并通过所述第一函数获取所述字符输入操作对应的输入字符。
在一种可能的实施方式中,所述创建第一函数,包括:
随机生成所述第一函数的名称。
在一种可能的实施方式中,所述随机生成所述第一函数的名称包括:根据当前时间生成所述第一函数的名称。
在一种可能的实施方式中,所述创建第一函数,包括:
创建第一类,所述第一类与所述第二函数所属的系统默认类相对应;
在所述第一类中创建所述第一函数。
在一种可能的实施方式中,所述创建第一类,包括:随机生成所述第一类的名称。
在一种可能的实施方式中,所述将所述第一函数映射到所述第二内存地址、所述第二函数映射到所述第一内存地址,包括:
使用地址互换函数,将所述第一内存地址和所述第二内存地址进行互换。
在一种可能的实施方式中,还包括:
通过第一函数随机生成伪装字符;
通过所述第一内存地址调用所述第二函数,从而将所述伪装字符传递给所述第二函数。
在一种可能的实施方式中,所述通过第一函数随机生成伪装字符,包括:
随机生成第一字符;
判断所述第一字符与所述输入字符是否相等;
在所述第一字符与所述输入字符相等的情况下,重新生成第一字符;
在所述第一字符与所述输入字符不相等的情况下,将所述第一字符作为所述伪装字符。
在一种可能的实施方式中,所述通过所述第一内存地址调用所述第二函数,包括:
利用自调用函数调用所述第一内存地址。
在一种可能的实施方式中,还包括:
将通过所述第一函数接收的输入字符提交至服务器。
第二方面,提供了一种字符输入装置。该装置包括:
创建单元,用于响应于对输入框进行的激活操作,创建第一函数,所述第一函数与系统默认的、用于接收所述输入框中的输入字符的第二函数相对应,所述第一函数被分配有第一内存地址,所述第二函数被分配有第二内存地址;
映射单元,用于将所述第一函数映射到所述第二内存地址、所述第二函数映射到所述第一内存地址;
回调单元,用于响应于对输入框进行的字符输入操作,通过所述第二内存地址回调所述第一函数;
获取单元,用于通过所述第一函数获取所述字符输入操作对应的输入字符。
在一种可能的实施方式中,所述创建单元具体用于:
随机生成所述第一函数的名称。
在一种可能的实施方式中,所述创建单元具体用于:
根据当前时间生成所述第一函数的名称。
在一种可能的实施方式中,所述创建单元具体包括:
第一创建子单元,用于创建第一类,所述第一类与所述第二函数所属的系统默认类相对应;
第二创建子单元,用于在所述第一类中创建所述第一函数。
在一种可能的实施方式中,所述第一创建子单元具体用于:
随机生成所述第一类的名称。
在一种可能的实施方式中,所述映射单元具体用于:
使用地址互换函数,将所述第一函数映射到所述第二内存地址、所述第二函数映射到所述第一内存地址。
在一种可能的实施方式中,还包括:
生成单元,用于通过第一函数随机生成伪装字符;
调用单元,用于通过所述第一内存地址调用所述第二函数,从而将所述伪装字符传递给所述第二函数。
在一种可能的实施方式中,所述生成单元具体用于:
随机生成第一字符;
判断所述第一字符与所述输入字符是否相等;
在所述第一字符与所述输入字符相等的情况下,重新生成第一字符;
在所述第一字符与所述输入字符不相等的情况下,将所述第一字符作为所述伪装字符。
在一种可能的实施方式中,所述调用单元具体用于:
利用自调用函数调用所述第一内存地址。
在一种可能的实施方式中,还包括:
提交单元,用于将通过所述第一函数接收的输入字符提交至服务器。
第三方面,提供了一种计算机可读存储介质,其上存储有计算机程序。当所述计算机程序在计算机中执行时,令计算机执行上述第一方面中任一种实施方式提供的方法。
第四方面,提供了一种计算设备,包括存储器和处理器。所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现上述第一方面中任一种实施方式提供的方法。
在本说明书提供的一种获取输入字符的方法中,首先,响应于对输入框进行的激活操作,创建用于接收输入框中的输入字符的第一函数,该方法与系统默认的、用于接收输入字符的第二函数相对应。接着,将第一函数的第一内存地址和第二函数的第二内存地址进行互换。然后,响应于对输入框进行的字符输入操作,通过第二内存地址回调第一函数,并通过第一函数获取输入字符,而非通过系统默认的第二函数获取输入字符。通过采用这种方法,可以有效地防止系统默认的第二函数被监控时输入字符被盗取的情况的发生,从而有效地保证用户的输入字符的安全。
进一步地,在通过第二内存地址回调第一函数时,还可以通过第一函数随机生成伪装字符,并通过第一内存地址调用第二函数,以使第二函数获取该伪装字符,从而使不 法分子在监控系统默认的第二函数以截取用户的输入字符时,获取到与输入字符(用户真正输入的信息)不同的伪装字符。如此,在通过创建第一函数获取输入字符的基础上,使监控第二函数的不法分子截取到随机生成的伪装字符,实现对第一函数的掩护,从而更加有效地保证用户输入字符的安全。
附图说明
为了更清楚地说明本说明书披露的多个实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书披露的多个实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1为本说明书披露的一个实施例提供的一种获取输入字符的方法应用场景示意图;
图2为本说明书披露的一个实施例提供的一种获取输入字符的方法流程图;
图3为本说明书披露的一个实施例提供的另一种获取输入字符的方法流程图;
图4为本说明书披露的一个实施例提供的一种获取输入字符的交互示意图;
图5为本说明书披露的一个实施例提供的一种获取输入字符的装置的结构图。
具体实施方式
下面结合附图,对本说明书披露的多个实施例进行描述。
图1为本说明书披露的一个实施例提供的一种获取输入字符的方法应用场景示意图。所述方法的执行主体可以为应用程序。如图1所示,当用户点击应用程序界面中的输入框,以及在输入框中输入字符时,可以采用本说明书披露的多个实施例提供的字符输入方法。
响应于对输入框进行的点击操作,创建用于接收输入框中的输入字符的新函数,该新函数与系统默认的、用于接收输入框中的输入字符的系统回调函数相对应。接着,将新函数的地址和系统回调函数的地址进行互换。然后,响应于对输入框进行的字符输入操作,仍然调用原地址,但是由于地址已经互换,通过原地址回调的将是新创建的函数,由此通过新函数获取输入字符,而不是通过原系统回调函数来获取输入字符。通过采用 这种函数,可以有效地防止系统默认的回调函数被监控时输入字符被盗取的情况的发生,从而加强了对用户输入信息的安全保护。
本领域技术人员知道,在面向过程的工程代码中直接采用“函数”的概念,而在面向对象的工程代码中使用“方法(method)”来描述类似概念。因此,在面向对象语言的情况下,当提及“方法”的时候,其作用类似于上述函数。
图2为本说明书披露的一个实施例提供的一种获取输入字符的方法流程图。所述方法的执行主体可以为应用程序。如图2所示,所述方法具体包括:
步骤S210,响应于对输入框进行的激活操作,创建第一函数。
具体地,激活操作可以是用户对输入框进行的点击操作,还可以是其它可以使输入框处于待输入状态的操作,待输入状态是指可以使用户直接在该输入框中进行字符输入的状态,例如,输入框中光标的闪烁表明接下来可以直接在该输入框中输入字符。在一个实施例中,当跳转到某些包括至少一个输入框的界面时,该界面中的某个输入框(如,默认为第一个)中会自动出现光标并呈现闪烁状态,此时可以响应于使该输入框处于待输入状态的界面跳转操作,创建第一方法(也就是第一函数)。
创建的第一方法与系统默认的、用于接收输入框中的输入字符的第二方法(也就是第二函数)相对应,第一方法具有第一内存地址,第二方法具有第二内存地址。换而言之,第二方法是默认的系统回调方法,而第一方法是“仿照”系统回调方法而创建的新方法。下面对这两个方法的运行环境和新方法的创建过程进行描述。
可以理解,操作系统(Operating System,简称OS)是管理和控制终端软件与软件资源的程序,是直接运行在终端上的最基本的系统软件,任何其他软件都必须在操作系统(如,Windows系统,或安卓(Android)系统,或iOS系统等)的支持下才能运行。相应地,在编写应用程序(为了提高特定处理效率的程序总称为“应用程序”,如支付宝应用)的过程中,需要利用操作系统提供的功能(如,基本的输入输出部分的程序)进行编写。
基于上述内容,应用程序中所涉及的系统默认的、用于接收输入框中的输入字符的第二方法,可以是基于OS提供的基本的输入输出部分的程序编写而成的。而且,第二方法可以为由函数名称(如,textChange)、变量类型(如,String)、变量名称(如,text)组成的系统默认函数(如,textChange(String text))。
此外,用户在打开终端中的应用程序(如,对该应用的图标进行点击操作)时,该应用程序需要被加载到内存后才能运行。任何的程序(如,C语言printf(“你好”))都是指令(如,printf)和数据(如,你好)的组合体,而内存(如,使用动态随机存取存储器(Dynamic Random Access Memory,简称DRAM)芯片的主存储器)是终端中保存命令和数据的场所,通过地址(如,二进制编码为01001001的地址)对其存储的内容进行标记和指定。相应地,当程序中包括的指令和数据被加载到内存中时,会被分配有相应的内存地址。
对于本说明书实施例中涉及的第二方法(也就是由指令和数据组成的函数),当其被加载到内存中时,会具有相应的内存地址,也就是前述内容中提及的第二方法所具有的第二内存地址。而第一方法具有的第一内存地址,为在内存中创建第一方法时,为第一方法所分配的内存地址。
在一个实施例中,创建第一方法,可以包括:创建第一类,且该类与第二方法所属的系统默认类相对应;接着,在第一类中创建与第二方法对应的第一方法。在一个例子中,可以利用系统默认类所继承的类(如,所继承的类可以为超级父类)创建第一类,以使第一类中可以创建与第二方法相对应的第一方法。
第一方法与第二方法相对应,是指第一方法与第二方法的功能相同,均用于接收输入框中的输入字符。由此,第一方法与第二方法具有相同的结构,例如,可以具有相同的参数类型(如,String)、变量(如,text),但具有不同的方法名称(如,第一方法的名称可以为exchangeMethod,第二方法的名称可以为textChange)。
在一个实施例中,创建第一类,可以包括:随机生成第一类的名称。在一个例子中,随机生成第一类的名称,可以包括:采用随机算法生成第一类的名称。其中随机算法采用了一定程度的随机性作为其逻辑的一部分,该算法通常使用随机位作为辅助输入来指导其行为,而随机位可以根据多个维度(如,时间、用户名等)中的至少一个维度来确定。例如,随机生成的第一类的名称可以为“Exchange‘ID’Class”(如,当前用户的用户名为Gloria,则第一类的名称可以为ExchangeGloriaClass)。
类似地,在一个实施例中,创建第一方法,可以包括:随机生成第一方法的名称。在一个例子中,可以根据多个维度(如,时间、用户名等)中的至少一个维度来生成第一方法的名称。例如,随机生成的第一方法的名称可以为“exchange‘time’Method”(如,当前时间为11:10am,则第一方法的名称可以为exchange1110Method)。
需要说明的是,上述对第一方法和第一类的创建均为动态创建。动态创建类和方法是指利用程序语言运行时(run time)特性,动态在内存中创建私有类(也就是非操作系统中存在的默认类)和方法。其中,运行时特性是指由动态编程语言(如,java、Objective-c)编写的程序在运行时可以改变其结构(例如,可以引进新的函数或者删除已有的函数等)的特性。
此外,第一类和系统默认类的相同之处在于,这两个类继承了相同的父类,以及在第一类和系统默认类中创建了具有对应关系的第一方法和第二方法。而两者的不同之处在于,第一类中可以只包括第一方法,而系统默认类中还可以包括除第二方法以外的其他方法。
在步骤S210中创建第一方法后,接着,在步骤S220,将第一函数映射到第二内存地址、第二函数映射到第一内存地址。也就是,将第一方法的第一内存地址和第二方法的第二内存地址进行互换。
在一个实施例中,可以使用地址互换函数,将第一内存地址(在编程语言中可以体现为第一方法的名称)和第二内存地址(在编程语言中可以体现为第二方法的名称)进行互换。
在一个例子中,第一方法和第二方法的名称分别为exchangeMethod和textChange,地址互换函数的名称可以为method_exchangeImplementations。据此,可以使用包括语句“method_exchangeImplementations(textChange,exchangeMethod);”的程序实现第一方法的第一内存地址和第二方法的第二内存地址的互换。
步骤S230,响应于对输入框进行的字符输入操作,通过第二内存地址回调第一函数,并通过第一函数获取输入字符。
具体地,由于第二内存地址是系统默认的回调方法的地址,因此当用户在输入框中进行字符输入操作(如,在输入框中输入字符或删除字符)时,仍然默认地按照原地址进行调用,即仍然访问第二内存地址,但是由于第一方法和第二方法的地址已经互换,当前第二内存地址对应的是新创建的第一方法,因此通过第二内存地址回调的是第一方法,由此通过第一方法获取了输入框中的输入字符,而非通过系统默认的第二方法获取输入框中的输入字符。如此,可以有效地防止系统默认的第二方法被监控时输入字符被盗取的情况的发生。
在一个实施例中,响应于对输入框进行的字符输入的每个操作,相应地通过第二内 存地址回调一次第一方法。也就是说,输入框中每接收一个字符,则相应地通过第二内存地址回调一次第一方法。在一个例子中,首先,用户在输入框中输入一个字符(如,‘a’),则触发应用程序通过第二内存地址回调第一方法。接着,用户再在输入框中输入一个字符(如,‘_’),则再次触发应用程序通过第二内存地址回调第一方法。
需要说明的是,在步骤S230之后,还可以包括:将通过第一方法获取的字符显示在输入框中。在一个实施例中,用户每在输入框中输入一个字符,就触发一次对第一方法的回调,并通过第一方法获取该字符,以及将该字符显示在输入框中。当然,可以直接显示所获取的字符,也可以对字符进行脱敏处理(是指对敏感数据进行变形处理)后再进行显示。例如,用户在输入键盘中点击字符“1”,则通过第一方法获取字符“1”后,在输入框中直接显示字符“1”。又例如,用户在输入键盘中点击字符“2”,则通过第一方法获取字符“2”后,在输入框中显示“*”,以防止因他人窥视而导致字符信息的泄露。
此外,在步骤S230之后,还可以包括:将通过第一方法获取的输入字符提交至服务器。在一个实施例中,将通过第一方法获取的输入字符提交至服务器,可以包括:当输入框中接收的输入字符的个数达到预定个数时,将这些输入字符提交至服务器。或者,根据接收的提交指令,将通过第一方法获取的输入字符提交至服务器。
在一个例子中,输入字符的预定个数,可以由该输入框所对应的输入信息的类别(如,密码、身份证号、银行卡号等)所确定。例如,用于接收密码信息的输入框,其所对应的输入字符的预定个数可以为6。又例如,用于接收身份证号的输入框,其所对应的输入字符的预定个数可以为18。再例如,用于接收交通银行的银行卡号的输入框,其所对应的输入字符的预定个数可以为17。
在一个例子中,当输入框中接收的输入字符的个数达到预定个数时,可以自动触发应用程序将接收的输入字符提交至服务器。
在另一个例子中,可以根据接收的提交指令(如,该提交指令可以为用户通过点击应用界面中的提交按键所输入的指令),将通过第一方法接收的输入字符(如,用户姓名“王立民”)提交至服务器。
由上可知,在本申请说明书披露的多个实施例提供的获取输入字符的方法中,首先,响应于对输入框进行的激活操作,创建用于接收输入框中的输入字符的第一函数,该方法与系统默认的、用于接收输入字符的第二函数相对应。接着,将第一函数的第一内存 地址和第二函数的第二内存地址进行互换。然后,响应于对输入框进行的字符输入操作,通过第二内存地址回调第一函数,并通过第一函数获取输入字符,而非通过系统默认的第二函数获取输入字符。通过采用这种方法,可以有效地防止系统默认的第二函数被监控时输入字符被盗取的情况的发生,从而有效地保证用户的输入字符的安全。
图3为本说明书披露的一个实施例提供的另一种获取输入字符的方法流程图。所述方法的执行主体可以为应用程序。如图3所示,所述方法具体包括:
步骤S310,响应于对输入框进行的激活操作,创建第一函数。
步骤S320,将第一函数映射到第二内存地址、第二函数映射到第一内存地址。
步骤S330,响应于对输入框进行的字符输入操作,通过第二内存地址回调第一函数,并通过第一函数获取输入字符。
对步骤S310-步骤S330的描述,可以参见上述对步骤S210-步骤S230的描述,在此不作赘述。
步骤S340,通过第一函数随机生成伪装字符。
具体地,通过第一方法(也就是第一函数)随机生成伪装字符,可以包括:将随机生成的字符直接作为伪装字符。或者,可以包括:随机生成第一字符,并判断第一字符与输入字符是否相等。在第一字符与输入字符相等的情况下,重新生成第一字符;而在第一字符与输入字符不相等的情况下,将第一字符作为伪装字符。
对于这两种方式,因随机生成的伪装字符具有随机性,随机生成的多个伪装字符与用户输入的完整信息中包括的多个输入字符完全相同的概率较低,所以将随机生成的字符作为伪装字符的方式,通常可以达到较好的伪装效果。另外,对于首先判断随机生成的第一字符与输入字符是否相等的方式,可以确保将与输入字符不相等的第一字符作为伪装字符,从而可以达到最全面、最佳的伪装效果。
在一个例子中,假定随机生成的字符为“1”,则可以直接将该字符作为伪装字符。
在一个例子中,假定输入字符为“1”,随机生成的第一字符为“2”。据此可以判断出第一字符与输入字符不相等,并将第一字符“2”作为伪装字符。
在另一个例子中,假定输入字符为“1”,随机生成的第一字符为“1”。据此可以判断出第一字符与输入字符相等,并重新生成第一字符。假定重新随机生成的第一 字符为“2”,据此可以判断出第一字符与输入字符不相等,并将第一字符“2”作为伪装字符。
在步骤S340中随机生成伪装字符后,接着,在步骤S350,通过第一内存地址调用第二函数,从而将伪装字符传递给第二函数。
在一个实施例中,通过第一内存地址调用第二方法(也就是第二函数),可以包括:利用自调用函数(如,self.)调用第一内存地址,进而通过第一内存地址调用第二方法。需要说明的是,自调用函数是对自身方法进行调用的函数。在本实施例中,在第一方法中执行自调用函数,于是自调用函数会自动地调用所属方法的默认地址,即第一方法的第一内存地址。然而,如前所述,第一内存地址和第二内存地址已经互换,但自调用函数无法获知该互换过程,因此,它按照第一内存地址进行调用时,实际调用的是第二方法,由此实现将伪装字符传递给第二方法。
因在通过创建第一方法获取输入字符时,系统默认的第二方法可能存在长期不被调用的情况,由此可能引起不法分子(如,通过植入钓鱼程序或监听程序,在系统默认的第二方法处设置断点,以截取用户的输入字符的人员)的怀疑,进而存在查找到创建的第一方法,转而对第一方法进行监控的风险。
前述在步骤S340中随机生成伪装字符,以及在步骤S450中通过第一内存地址调用第二方法,以使第二方法获取伪装字符,可以使不法分子在监控系统默认的第二方法以截取用户的输入字符时,仍然可以监听到第二方法被调用,仍然可以获得到字符,但是获取到却是与输入字符(用户真正输入的信息)不同的伪装字符。如此,在通过创建第一方法获取输入字符的基础上,使监控第二方法的不法分子截取到随机生成的伪装字符,实现对第一方法的掩护,从而更加有效地保证用户输入字符的安全。
需要说明的是,不同输入框可以用于接收具有不同类别(如,姓名、身份证号、密码、生日、昵称、银行卡号等)的输入信息。不同类别的输入信息往往具有不同的敏感度,也就是说,有的类别(如,身份证号、密码)所对应的输入信息的敏感度较高,如果这些输入信息被泄露会给用户造成较大的安全隐患(如,不法分子可以利用用户的身份证号进行贷款等),而有的类别(如,生日、昵称)所对应的输入信息的敏感度较低。
对于具有较高敏感度的输入信息所对应的输入字符,在步骤S330通过第一方法获取该输入字符后,可以继续执行步骤S340和步骤S350。而对于具有较低敏感度的输 入信息所对应的输入字符,在步骤S330通过第一方法获取该输入字符后,可以不执行步骤S340和步骤S350,也就是不需要生成伪装字符以及让第二方法获取伪装字符,而是直接通过第一内存地址调用第二方法,并将输入字符(用户输入的真实信息)传递给第二方法。
相应地,在步骤S330之后,还可以包括:判断是否需要生成输入字符的伪装字符。在一个实施例中,可以通过输入框的标记(tag)值来判断。其中输入框的标记值与输入字符的类别相对应,例如,标记值为1001、1002和1003的输入框对应的类别分别为姓名、身份证号和密码。
判断是否需要生成输入字符的伪装字符,可以包括:当输入框的标记值属于预设标记值集合时,则需要生成该输入字符的伪装字符,也就是需要执行步骤S340和步骤S350。当输入框的标记值不属于预设标记值集合时,则直接通过第一内存地址调用第二方法,并将该输入字符传递给第二方法。其中,预设标记值集合可以根据标记值所对应的输入信息的类别的敏感度确定。
接下来,结合图4,对本说明书多个实施例提供的获取输入字符的交互过程进行示例性说明。如图4所示,所述交互过程可以包括:
步骤S410,用户对APP中的输入框进行激活。
步骤S420,APP创建用于接收输入框中输入字符的第一方法,该方法具有第一内存地址,且与系统默认的具有第二内存地址的第二方法相对应。
步骤S430,将第一方法的第一内存地址和第二方法的第二内存地址进行互换。
步骤S440,用户在输入框中输入字符。
步骤S450,通过第二内存地址回调第一方法,并通过第一方法获取用户所输入的输入字符。
步骤S460,通过第一方法随机生成伪装字符。
步骤S470,通过第一内存地址调用第二方法,从而将伪装字符传递给第二方法。
由上可知,在本申请说明书披露的多个实施例提供的获取输入字符的方法中,首先,响应于对输入框进行的激活操作,创建用于接收输入框中的输入字符的第一函数,该函数与系统默认的、用于接收输入字符的第二函数相对应。接着,将第一函数的第一内存地址和第二函数的第二内存地址进行互换。然后,响应于对输入框进行的字符输入 操作,通过第二内存地址回调第一函数,并通过第一函数获取输入字符,而非通过系统默认的第二函数获取输入字符。通过采用这种函数,可以有效地防止系统默认的第二函数被监控时输入字符被盗取的情况的发生,从而有效地保证用户的输入字符的安全。
进一步地,在通过第二内存地址回调第一函数时,还可以通过第一函数随机生成伪装字符,并通过第一内存地址调用第二函数,以使第二函数获取该伪装字符,从而使不法分子在监控系统默认的第二函数以截取用户的输入字符时,获取到与输入字符(用户真正输入的信息)不同的伪装字符。如此,在通过创建第一函数获取输入字符的基础上,使监控第二函数的不法分子截取到随机生成的伪装字符,实现对第一函数的掩护,从而更加有效地保证用户输入字符的安全。
与上述字符输入方法对应地,本说明书披露的多个实施例还提供一种获取输入字符的装置,如图5所示,该装置包括:
创建单元510,用于响应于对输入框进行的激活操作,创建第一函数,第一函数与系统默认的、用于接收输入框中的输入字符的第二函数相对应,第一函数具有第一内存地址,第二函数具有第二内存地址;
映射单元520,用于将第一函数映射到第二内存地址、第二函数映射到第一内存地址;
回调单元530,用于响应于对输入框进行的字符输入操作,通过第二内存地址回调第一函数;
获取单元540,用于通过第一函数获取字符输入操作对应的输入字符。
在一种可能的实施方式中,创建单元510具体用于:
随机生成第一函数的名称。
在一种可能的实施方式中,创建单元510具体用于:
根据当前时间生成第一函数的名称。
在一种可能的实施方式中,创建单元510具体包括:
第一创建子单元511,用于创建第一类,第一类与第二函数所属的系统默认类相对应;
第二创建子单元512,用于在第一类中创建第一函数。
在一种可能的实施方式中,第一创建子单元511具体用于:
随机生成第一类的名称。
在一种可能的实施方式中,映射单元520具体用于:
使用地址互换函数,将第一内存地址和第二内存地址进行互换。
在一种可能的实施方式中,还包括:
生成单元550,用于通过第一函数随机生成伪装字符;
调用单元560,用于通过第一内存地址调用第二函数,从而将伪装字符传递给第二函数。
在一种可能的实施方式中,生成单元550具体用于:
随机生成第一字符;
判断第一字符与输入字符是否相等;
在第一字符与输入字符相等的情况下,重新生成第一字符;
在第一字符与输入字符不相等的情况下,将第一字符作为伪装字符。
在一种可能的实施方式中,调用单元560具体用于:
利用自调用函数调用第一内存地址。
在一种可能的实施方式中,还包括:
提交单元570,用于将通过第一函数接收的输入字符提交至服务器。
由上可知,采用本申请说明书披露的多个实施例提供的获取输入字符的装置中,创建单元510响应于对输入框进行的激活操作,创建用于接收输入框中的输入字符的第一函数,该函数与系统默认的、用于接收输入字符的第二函数相对应。映射单元520将第一函数的第一内存地址和第二函数的第二内存地址进行互换。调用单元530响应于对输入框进行的字符输入操作,通过第二内存地址回调第一函数,获取单元540通过第一函数获取输入字符,而非通过系统默认的第二函数获取输入字符。通过采用这种装置,可以有效地防止系统默认的第二函数被监控时输入字符被盗取的情况的发生,从而有效地保证用户的输入字符的安全。
进一步地,生成单元550通过第一函数随机生成伪装字符,调用单元560通过 第一内存地址调用第二函数,以使第二函数获取该伪装字符,从而使不法分子在监控系统默认的第二函数以截取用户的输入字符时,获取到与输入字符(用户真正输入的信息)不同的伪装字符。如此,在通过创建第一函数获取输入字符的基础上,使监控第二函数的不法分子截取到随机生成的伪装字符,实现对第一函数的掩护,从而更加有效地保证用户输入字符的安全。
以上所述的具体实施方式,对本说明书披露的多个实施例的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本说明书披露的多个实施例的具体实施方式而已,并不用于限定本说明书披露的多个实施例的保护范围,凡在本说明书披露的多个实施例的技术方案的基础之上,所做的任何修改、等同替换、改进等,均应包括在本说明书披露的多个实施例的保护范围之内。

Claims (20)

  1. 一种获取输入字符的方法,其特征在于,包括:
    响应于对输入框进行的激活操作,创建第一函数,所述第一函数与系统默认的、用于接收所述输入框中的输入字符的第二函数相对应,所述第一函数被分配有第一内存地址,所述第二函数被分配有第二内存地址;
    将所述第一函数映射到所述第二内存地址、所述第二函数映射到所述第一内存地址;
    响应于对输入框进行的字符输入操作,通过所述第二内存地址回调所述第一函数,并通过所述第一函数获取所述字符输入操作对应的输入字符。
  2. 根据权利要求1所述的方法,其特征在于,所述创建第一函数,包括:
    随机生成所述第一函数的名称。
  3. 根据权利要求2所述的方法,其特征在于,所述随机生成所述第一函数的名称包括:根据当前时间生成所述第一函数的名称。
  4. 根据权利要求1-3中任一项所述的方法,其特征在于,所述创建第一函数,包括:
    创建第一类,所述第一类与所述第二函数所属的系统默认类相对应;
    在所述第一类中创建所述第一函数。
  5. 根据权利要求4所述的方法,其特征在于,所述创建第一类,包括:随机生成所述第一类的名称。
  6. 根据权利要求1所述的方法,其特征在于,所述将所述第一函数映射到所述第二内存地址、所述第二函数映射到所述第一内存地址,包括:
    使用地址互换函数,将所述第一内存地址和所述第二内存地址进行互换。
  7. 根据权利要求1所述的方法,其特征在于,还包括:
    通过第一函数随机生成伪装字符;
    通过所述第一内存地址调用所述第二函数,从而将所述伪装字符传递给所述第二函数。
  8. 根据权利要求7所述的方法,其特征在于,所述通过第一函数随机生成伪装字符,包括:
    随机生成第一字符;
    判断所述第一字符与所述输入字符是否相等;
    在所述第一字符与所述输入字符相等的情况下,重新生成第一字符;
    在所述第一字符与所述输入字符不相等的情况下,将所述第一字符作为所述伪装字符。
  9. 根据权利要求7所述的方法,其特征在于,所述通过所述第一内存地址调用所述第二函数,包括:
    利用自调用函数调用所述第一内存地址。
  10. 根据权利要求1-3、5-9中任一项所述的方法,其特征在于,还包括:
    将通过所述第一函数接收的输入字符提交至服务器。
  11. 一种获取输入字符的装置,其特征在于,包括:
    创建单元,用于响应于对输入框进行的激活操作,创建第一函数,所述第一函数与系统默认的、用于接收所述输入框中的输入字符的第二函数相对应,所述第一函数被分配有第一内存地址,所述第二函数被分配有第二内存地址;
    映射单元,用于将所述第一函数映射到所述第二内存地址、所述第二函数映射到所述第一内存地址;
    回调单元,用于响应于对输入框进行的字符输入操作,通过所述第二内存地址回调所述第一函数;
    获取单元,用于通过所述第一函数获取所述字符输入操作对应的输入字符。
  12. 根据权利要求11所述的装置,其特征在于,所述创建单元具体用于:
    随机生成所述第一函数的名称。
  13. 根据权利要求12所述的装置,其特征在于,所述创建单元具体用于:
    根据当前时间生成所述第一函数的名称。
  14. 根据权利要求11-13中任一项所述的装置,其特征在于,所述创建单元具体包括:
    第一创建子单元,用于创建第一类,所述第一类与所述第二函数所属的系统默认类相对应;
    第二创建子单元,用于在所述第一类中创建所述第一函数。
  15. 根据权利要求14所述的装置,其特征在于,所述第一创建子单元具体用于:
    随机生成所述第一类的名称。
  16. 根据权利要求11所述的装置,其特征在于,所述映射单元具体用于:
    使用地址互换函数,将所述第一函数映射到所述第二内存地址、所述第二函数映射到所述第一内存地址。
  17. 根据权利要求11所述的装置,其特征在于,还包括:
    生成单元,用于通过第一函数随机生成伪装字符;
    调用单元,用于通过所述第一内存地址调用所述第二函数,从而将所述伪装字符传递给所述第二函数。
  18. 根据权利要求17所述的装置,其特征在于,所述生成单元具体用于:
    随机生成第一字符;
    判断所述第一字符与所述输入字符是否相等;
    在所述第一字符与所述输入字符相等的情况下,重新生成第一字符;
    在所述第一字符与所述输入字符不相等的情况下,将所述第一字符作为所述伪装字符。
  19. 根据权利要求17所述的装置,其特征在于,所述调用单元具体用于:
    利用自调用函数调用所述第一内存地址。
  20. 根据权利要求11-13、15-19中任一项所述的装置,其特征在于,还包括:
    提交单元,用于将通过所述第一函数接收的输入字符提交至服务器。
PCT/CN2019/070855 2018-01-19 2019-01-08 获取输入字符的方法及装置 WO2019141112A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810051678.0 2018-01-19
CN201810051678.0A CN108416233B (zh) 2018-01-19 2018-01-19 获取输入字符的方法及装置

Publications (1)

Publication Number Publication Date
WO2019141112A1 true WO2019141112A1 (zh) 2019-07-25

Family

ID=63126107

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/070855 WO2019141112A1 (zh) 2018-01-19 2019-01-08 获取输入字符的方法及装置

Country Status (3)

Country Link
CN (1) CN108416233B (zh)
TW (1) TWI693534B (zh)
WO (1) WO2019141112A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108416233B (zh) * 2018-01-19 2020-03-06 阿里巴巴集团控股有限公司 获取输入字符的方法及装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101599113A (zh) * 2009-06-17 2009-12-09 北京东方微点信息技术有限责任公司 驱动型恶意软件防御方法和装置
CN102073542A (zh) * 2010-12-22 2011-05-25 浙大网新科技股份有限公司 Linux应用在Android手机上运行时整合中文输入法的方法
US20140043239A1 (en) * 2012-08-10 2014-02-13 Microsoft Corporation Single page soft input panels for larger character sets
CN105205386A (zh) * 2014-06-25 2015-12-30 腾讯科技(深圳)有限公司 移动终端应用程序密码保护方法和装置
CN108416233A (zh) * 2018-01-19 2018-08-17 阿里巴巴集团控股有限公司 获取输入字符的方法及装置

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100549646B1 (ko) * 2005-08-06 2006-02-06 소프트캠프(주) 인터럽트 처리함수 교체에 의한 키보드 입력정보의무단유출을 차단하는 방법
CN101794365B (zh) * 2010-03-23 2015-08-12 中兴通讯股份有限公司 在移动终端上安全输入信息的方法及移动终端
US20140047210A1 (en) * 2012-08-08 2014-02-13 Lsi Corporation Trim mechanism using multi-level mapping in a solid-state media
US9087191B2 (en) * 2012-08-24 2015-07-21 Vmware, Inc. Method and system for facilitating isolated workspace for applications
EP2924522B1 (de) * 2014-03-28 2016-05-25 dSPACE digital signal processing and control engineering GmbH Verfahren zur Beeinflussung eines Steuerprogramms
GB2527034A (en) * 2014-06-03 2015-12-16 Ibm A method and apparatus for providing a user access to a computer system
US9811468B2 (en) * 2014-12-14 2017-11-07 Via Alliance Semiconductor Co., Ltd. Set associative cache memory with heterogeneous replacement policy
CN106547580B (zh) * 2015-09-22 2020-08-28 腾讯科技(深圳)有限公司 挂钩函数的方法、装置、移动终端及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101599113A (zh) * 2009-06-17 2009-12-09 北京东方微点信息技术有限责任公司 驱动型恶意软件防御方法和装置
CN102073542A (zh) * 2010-12-22 2011-05-25 浙大网新科技股份有限公司 Linux应用在Android手机上运行时整合中文输入法的方法
US20140043239A1 (en) * 2012-08-10 2014-02-13 Microsoft Corporation Single page soft input panels for larger character sets
CN105205386A (zh) * 2014-06-25 2015-12-30 腾讯科技(深圳)有限公司 移动终端应用程序密码保护方法和装置
CN108416233A (zh) * 2018-01-19 2018-08-17 阿里巴巴集团控股有限公司 获取输入字符的方法及装置

Also Published As

Publication number Publication date
TW201933051A (zh) 2019-08-16
CN108416233A (zh) 2018-08-17
TWI693534B (zh) 2020-05-11
CN108416233B (zh) 2020-03-06

Similar Documents

Publication Publication Date Title
US10698885B2 (en) Method and device for writing service data in block chain system
JP5985631B2 (ja) 信頼レベルのアクティブ化
JP5611598B2 (ja) Usbトークン上の暗号化キーコンテナ
KR20120068864A (ko) 호스트형 컴퓨터 환경에서 가상 오브젝트 우회
JP2020505681A (ja) データ取得方法およびデバイス
US10277620B2 (en) Determining an assessment of a security breach for an asset of a network infrastructure
US11750652B2 (en) Generating false data for suspicious users
US20220067195A1 (en) Controlling installation of unauthorized drivers on a computer system
JP2019509567A (ja) アプリケーション(app)のためのリソースロード方法、サービス機能実施方法及び装置
Ahmadpanah et al. Securing node-red applications
Stirparo et al. In-memory credentials robbery on android phones
WO2019141112A1 (zh) 获取输入字符的方法及装置
CN112734349A (zh) 接口生成、数据调用方法、装置和电子设备
CN113849562A (zh) 一种接入外部服务系统的方法和装置
CN113726855A (zh) 服务聚合方法、装置、电子设备以及计算机可读存储介质
CN116644425B (zh) 基于Javaagent的Web漏洞即时阻断方法、装置、设备和存储介质
Pathak UML 2.0 based round trip engineering framework for the development of SPF based secure application
Bucur et al. Data loss prevention and data protection in cloud environments based on authentication tokens
WO2020233424A1 (zh) 基于事件函数类型的收据存储方法和节点
US20230409315A1 (en) Secrets framework
WO2020233421A1 (zh) 基于代码标注的对象级收据存储方法和节点
WO2018037259A1 (en) Implementing secure transaction management utilizing tokenized sensitive information in an object-oriented transactional framework having hierarchically assemblable and selectable menu items
MAHMOD SMS-Phishing on Android Smart Phone
WO2022090793A1 (en) System and method for validation of authenticity of an authorized user
WO2023086142A1 (en) Privacy data management in distributed computing systems

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: 19741234

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: 19741234

Country of ref document: EP

Kind code of ref document: A1