CN112765628B - Information interaction method and electronic equipment - Google Patents

Information interaction method and electronic equipment Download PDF

Info

Publication number
CN112765628B
CN112765628B CN202110089552.4A CN202110089552A CN112765628B CN 112765628 B CN112765628 B CN 112765628B CN 202110089552 A CN202110089552 A CN 202110089552A CN 112765628 B CN112765628 B CN 112765628B
Authority
CN
China
Prior art keywords
information
key
transaction
stylus
interaction
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202110089552.4A
Other languages
Chinese (zh)
Other versions
CN112765628A (en
Inventor
汤镇辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
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 Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202110089552.4A priority Critical patent/CN112765628B/en
Publication of CN112765628A publication Critical patent/CN112765628A/en
Application granted granted Critical
Publication of CN112765628B publication Critical patent/CN112765628B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • 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/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • 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/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/033Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor
    • G06F3/0354Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor with detection of 2D relative movements between the device, or an operating part thereof, and a plane or surface, e.g. 2D mice, trackballs, pens or pucks
    • G06F3/03545Pens or stylus
    • 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/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • G06F3/04883Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures for inputting data by handwriting, e.g. gesture or text

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Bioethics (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Medical Informatics (AREA)
  • Databases & Information Systems (AREA)
  • User Interface Of Digital Computer (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The application discloses an information interaction method and electronic equipment, and relates to the technical field of communication. The information interaction method comprises the following steps: acquiring first information sent by a touch pen, wherein the first information comprises first ciphertext obtained by encrypting at least two first parameters and identity authentication request information; when a target first parameter in the at least two first parameters meets a preset condition, second information obtained by encrypting at least one second parameter is sent to the touch pen; third information which is sent by the touch pen and obtained by encryption processing of at least two first parameters is obtained; according to the first key generated by the third information and the second key generated by the first information and the second information, carrying out identity authentication on the touch control pen; and after the identity authentication is successful, performing target information interaction with the touch pen. The scheme of the application is used for solving the problem that in the process of information interaction of the electronic equipment by a user by using the touch pen, interaction information can be tampered, so that information is unsafe.

Description

Information interaction method and electronic equipment
Technical Field
The application belongs to the technical field of communication, and particularly relates to an information interaction method and electronic equipment.
Background
With the continuous development of technology in the scientific and technological level, electronic equipment gradually changes the work and life modes of people, and people have higher requirements on the interaction safety of the electronic equipment while obtaining mobile communication convenience.
In the process of implementing the present application, the inventor finds that at least the following problems exist in the prior art:
with the increasing use of touch pens on electronic devices, it is very important to ensure the security of the electronic devices, but at present, in the interaction process of the touch pen and the electronic devices, some actions may tamper the interaction information of the touch pen and the electronic devices, so that the information security problem of the electronic devices is caused.
Disclosure of Invention
The embodiment of the application aims to provide an information interaction method and electronic equipment, which can solve the problem that information interaction is possibly tampered and unsafe when a user uses a touch pen to carry out information interaction on the electronic equipment.
In order to solve the technical problems, the application is realized as follows:
in a first aspect, an embodiment of the present application provides an information interaction method, applied to an electronic device, where the method includes:
acquiring first information sent by a touch pen, wherein the first information comprises a first ciphertext and identity authentication request information, and the first ciphertext is obtained by encrypting at least two first parameters;
Sending second information to the touch pen under the condition that a target first parameter in the at least two first parameters meets a preset condition, wherein the second information is obtained by encrypting at least one second parameter;
acquiring third information sent by the touch pen according to the second information, wherein the third information is obtained by encryption processing based on part of the first parameters in the at least two first parameters;
authenticating the identity of the stylus according to a first key and a second key, wherein the first key is generated according to the third information and the second information, and the second key is generated according to the first information and the second information;
and after the identity authentication of the touch pen is successful, performing interaction of target information with the touch pen.
In a second aspect, embodiments of the present application provide an information interaction method, applied to a stylus, where the method includes:
the method comprises the steps of sending first information to electronic equipment, wherein the first information comprises first ciphertext and identity authentication request information, and the first ciphertext is obtained by encrypting at least two first parameters;
acquiring second information sent by the electronic equipment, wherein the second information is obtained by encrypting at least one second parameter;
Transmitting third information to the electronic equipment, wherein the third information is obtained by encryption processing based on part of the first parameters in the at least two first parameters;
acquiring identity authentication information sent by the electronic equipment, wherein the identity authentication information is obtained by the electronic equipment according to a first key and a second key, the first key is generated according to the third information and the second information, and the second key is generated according to the first information and the second information;
and after the identity authentication information indicates that the identity authentication is successful, the electronic equipment and the identity authentication information interact with each other.
In a third aspect, an embodiment of the present application provides an information interaction apparatus, which is applied to an electronic device, including:
the first acquisition module is used for acquiring first information sent by the touch pen, wherein the first information comprises a first ciphertext and identity authentication request information, and the first ciphertext is obtained by encrypting at least two first parameters;
the first sending module is used for sending second information to the touch pen under the condition that a target first parameter in the at least two first parameters meets a preset condition, and the second information is obtained by encrypting at least one second parameter;
The second acquisition module is used for acquiring third information sent by the touch pen according to the second information, wherein the third information is obtained by encryption processing based on part of the first parameters in the at least two first parameters;
the authentication module is used for carrying out identity authentication on the touch control pen according to a first key and a second key, the first key is generated according to the third information and the second information, and the second key is generated according to the first information and the second information;
and the first interaction module is used for interacting target information with the touch pen after the identity authentication of the touch pen is successful.
In a fourth aspect, embodiments of the present application provide an information interaction device, applied to a stylus, including:
the second sending module is used for sending first information to the electronic equipment, wherein the first information comprises a first ciphertext and identity authentication request information, and the first ciphertext is obtained by encrypting at least two first parameters;
the third acquisition module is used for acquiring second information sent by the electronic equipment, wherein the second information is obtained by encrypting at least one second parameter;
The third sending module is used for sending third information to the electronic equipment, wherein the third information is obtained by encryption processing based on part of the first parameters in the at least two first parameters;
a fourth obtaining module, configured to obtain identity authentication information sent by the electronic device, where the identity authentication information is obtained by the electronic device according to a first key and a second key, where the first key is generated according to the third information and the second information, and the second key is generated according to the first information and the second information;
and the second interaction module is used for carrying out interaction of target information with the electronic equipment after the identity authentication information indicates that the identity authentication is successful.
In a fifth aspect, embodiments of the present application further provide an electronic device, including a processor, a memory, and a program or instructions stored on the memory and executable on the processor, the program or instructions implementing the steps of the method according to the first aspect or implementing the steps of the method according to the second aspect when executed by the processor.
In a sixth aspect, embodiments of the present application further provide a readable storage medium having stored thereon a program or instructions which, when executed by a processor, implement the steps of the method as described in the first aspect, or implement the steps of the method as described in the second aspect.
In a seventh aspect, embodiments of the present application provide a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to execute a program or instructions to implement a method according to the first aspect, or implement a method according to the second aspect.
In this way, in the embodiment of the application, in the process of information interaction between the touch pen and the electronic device, the electronic device can obtain the first key of the touch pen and the second key of the electronic device according to the first information, the second information and the third information interacted with the touch pen, and perform identity authentication on the touch pen according to the first key and the second key, and after the touch pen passes the identity authentication, the touch pen can perform interaction of target information with the electronic device, so that the security of interaction information can be ensured to a certain extent.
Drawings
Fig. 1 is one of flowcharts of an information interaction method provided in an embodiment of the present application;
FIG. 2 is a second flowchart of an information interaction method according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram of an identity authentication process performed by a stylus and an electronic device according to an embodiment of the present application;
fig. 4 is a schematic diagram of a process of determining transaction environment security by using a stylus and an electronic device according to an embodiment of the present application;
FIG. 5 is a block diagram of an information interaction device according to an embodiment of the present application;
FIG. 6 is a second block diagram of an information interaction device according to an embodiment of the present disclosure;
fig. 7 is a block diagram of an electronic device provided in an embodiment of the present application;
fig. 8 is a schematic hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type and not limited to the number of objects, e.g., the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
The information interaction method provided by the embodiment of the application is described in detail below through specific embodiments and application scenes thereof with reference to the accompanying drawings.
The method of the embodiment of the present application is applied to an electronic device, such as a User Equipment (UE), which may refer to an access terminal, a subscriber unit, a subscriber station, a mobile station, a remote terminal, a mobile device, a user terminal, a wireless communication device, a user agent, or a user equipment. The terminal device may also be a cellular telephone, a cordless telephone, a session initiation protocol (sessioninitiation protocol, SIP) phone, a wireless local loop (wireless local loop, WLL) station, a personal digital assistant (personal digital assistant, PDA), a handheld device having wireless communication capabilities, a computing device or other processing device connected to a wireless modem, an in-vehicle device, a wearable device.
As shown in fig. 1, an embodiment of the present application provides an information interaction method, which is applied to an electronic device, and includes:
step 101: the method comprises the steps of obtaining first information sent by a touch pen, wherein the first information comprises a first ciphertext and identity authentication request information, and the first ciphertext is obtained by encrypting at least two first parameters.
It should be noted that, the method provided in the embodiment of the present application is applied to an electronic device, where the electronic device may be an intelligent terminal with a display screen, such as a mobile phone, a tablet computer, a palm computer, etc., capable of receiving, sending and processing information; the electronic device can also be a processor with information receiving, transmitting and processing functions or other electronic devices with information interaction capability.
In the embodiment of the application, before the electronic device performs identity authentication on the stylus, the electronic device is connected with the stylus, and the electronic device is selected to enter a stylus safety mode to send a safety communication signal to the stylus.
Alternatively, the electronic device may be connected to the stylus via bluetooth or wirelessly.
Alternatively, the electronic device may select to enter the stylus security mode by entering through a security mode physical key on the electronic device, or by clicking a virtual key on the screen of the electronic device, such as a security mode icon.
After the electronic equipment sends a secure communication signal to the touch pen, identity authentication is carried out on the touch pen, first information sent by the touch pen is obtained, the first information comprises a first ciphertext and identity authentication request information, the first ciphertext is obtained by encrypting at least two first parameters, wherein the at least two first parameters comprise an identity identification number (Identity document, ID) of the touch pen, a Random Number (RN) of the touch pen and a current first timestamp of the touch pen.
In the embodiment of the application, hash operation is performed on an identification number ID of a stylus and a random number RN of the stylus to obtain an identification number hash value HID of the stylus and a random number hash value HRN of the stylus, and asymmetric encryption is performed on the identification number hash value HID of the stylus, the random number hash value HRN of the stylus and a first timestamp of the stylus to obtain a first ciphertext.
Step 102: and sending second information to the touch pen under the condition that the target first parameter in the at least two first parameters meets the preset condition, wherein the second information is obtained by encrypting at least one second parameter.
In this embodiment of the present application, after receiving first information sent by a stylus, an electronic device performs asymmetric decryption on a first ciphertext using an RSA (public key algorithm) private key to obtain a random number hash value of the stylus, an identity number hash value of the stylus, and a current first timestamp of the stylus, and when one target first parameter in the identity number ID of the stylus, the random number RN of the stylus, and the first timestamp of the stylus meets a preset condition, the current second parameter of the electronic device is obtained, and the second parameter may be the current second timestamp of the electronic device, and performs hash operation on the second timestamp to obtain a second timestamp hash value of the electronic device.
It should be noted that, by the target first parameter of the at least two first parameters meeting the preset condition, replay vector attack can be prevented, for example, replay vector attack is prevented by a timestamp, and the smaller the time difference between the first timestamp of the stylus and the second timestamp of the electronic device, the more synchronous the time of the stylus and the electronic device is, the less possibility of being attacked; the replay vector attack can also be prevented by the random number, the stylus and the electronic device record and store the used random number, and if the electronic device or the stylus acquires the used random number, the stylus is considered to be attacked by the replay vector.
Step 103: and acquiring third information sent by the touch pen according to the second information, wherein the third information is obtained by encryption processing based on part of the first parameters in the at least two first parameters.
In this embodiment of the present application, the stylus encrypts at least two first parameters, that is, the identity number ID of the stylus, the random number RN of the stylus, and part or all of the first parameters in the current first timestamp of the stylus, to obtain third information.
In the embodiment of the application, the stylus obtains the hash value HID of the identification number of the stylus, the hash value HRN of the random number of the stylus and the hash value of the first timestamp of the stylus according to hash operation, the hash value HID of the identification number of the stylus or the hash value HRN of the random number of the stylus or the hash value of the first timestamp of the stylus is obtained as a temporary private key, the temporary private key is encrypted by using the RSA private key to obtain third information, the third information is sent to the electronic equipment, and the electronic equipment obtains the third information.
Step 104: and authenticating the identity of the touch pen according to a first key and a second key, wherein the first key is generated according to the third information and the second information, and the second key is generated according to the first information and the second information.
In the embodiment of the application, the electronic device performs asymmetric decryption on third information received from the touch pen by using an RSA private key to obtain a hash value HID of an identity mark number of the touch pen on the touch pen, a hash value RN of a random number of the touch pen, and a first timestamp of the touch pen, and a temporary private key, and the temporary private key and the hash value RN of a second timestamp are used to obtain a first key of the touch pen; the identification number hash value HID of the stylus is exclusive-ored with the random number hash value HRN of the stylus to exclusive-ored with the second timestamp hash value of the electronic device to exclusive-ored with the first timestamp hash value of the stylus to obtain the second key of the electronic device.
The identification number hash value HID of the stylus is obtained by performing hash operation on the identification number ID of the stylus, the random number hash value HRN of the stylus is obtained by performing hash operation on the random number RN of the stylus, the first timestamp hash value of the stylus is obtained by performing hash operation on the first timestamp of the stylus, and the second timestamp hash value of the electronic device is obtained by performing hash operation on the second timestamp of the electronic device.
And carrying out identity authentication on the touch pen through the first key and the second key.
Step 105: and after the identity authentication of the touch pen is successful, performing interaction of target information with the touch pen.
After the identity of the stylus passes through the identity authentication of the electronic device, namely after the legitimacy of the stylus is authenticated, the electronic device sends identity authentication information to the stylus, the electronic device is in a stylus safety mode, the control right of the subsequent electronic device is given to the authenticated stylus, namely, only the authenticated stylus can have the right to control the electronic device, the authenticated stylus is not authenticated, or other operation modes, such as a finger operation mode, can intercept the operation of the non-authenticated stylus or the operation of the finger due to the fact that the key authentication is not passed, so that the electronic device cannot respond to the operation of the non-authenticated stylus or the operation of the finger, and can only respond to the operation of the authenticated stylus to perform interaction of target information. For example, the video playing interface of the electronic device includes a video playing control, after the electronic device authenticates the validity of the identity of the first stylus according to the above steps, the video playing control can respond to the input of the first stylus, and the video playing control is not authenticated by the electronic device, or the second stylus that is not authenticated has no authority to control the video playing control, that is, the video playing control does not respond to the input of the second stylus. In the embodiment of the application, in the process of information interaction between the touch pen and the electronic device, the electronic device can respectively obtain the first key of the touch pen and the second key of the electronic device according to the first information, the second information and the third information interacted with the touch pen, and the identity authentication is carried out on the touch pen according to the first key and the second key, so that the touch pen can interact with the electronic device for target information after the identity authentication, and the safety of interaction information can be ensured to a certain extent.
The interaction of the target information with the touch pen comprises the following steps:
and under the condition that the safe transaction state is determined according to the first key and the second key, carrying out interaction with the stylus payment transaction information.
In the embodiment of the application, after the identity authentication of the electronic device to the stylus is successful, the electronic device is in the stylus security mode, and the user clicks a payment transaction key on the electronic device by using the stylus, so that when the interaction of payment transaction information is performed, the electronic device verifies the security of the transaction environment according to the first key and the second key, and after the security of the transaction environment is determined, payment transaction processing can be performed, so that the security of the transaction can be improved.
Optionally, determining that the first key and the second key are in a secure transaction state includes:
obtaining a first message digest according to the first key, the second key, the first transaction authentication information and the second transaction authentication information;
obtaining a second message digest according to the second key, the first transaction authentication information and the second transaction authentication information;
determining that the first message digest is in a safe transaction state under the condition that the first message digest is matched with the second message digest;
Transmitting a safe transaction state signal to the stylus;
the first transaction authentication information is transaction information confirmed by the touch pen, and the second transaction authentication information is transaction information confirmed by the electronic equipment.
In this embodiment of the present application, the electronic device inputs, according to a hash operation function related to a key, a first key, first transaction authentication information, and the second transaction authentication information into the hash operation function, generates a first message digest, inputs, according to a hash operation algorithm, the second key, the first transaction authentication information, and the second transaction authentication information, generates a second message digest, where the first transaction authentication information is transaction information confirmed by a stylus, and the second transaction authentication information is transaction information confirmed by the electronic device, and the transaction information is one or a combination of transaction time, a transaction account number, and a transaction amount.
And under the condition that the electronic equipment judges that the first message abstract is matched with the second message abstract, the electronic equipment determines that the electronic equipment is in a safe transaction state, and a payment transaction button on the electronic equipment can be clicked by a touch pen to perform payment transaction processing. Optionally, the case where the first message digest matches the second message digest includes a case where the first message digest is the same as the second message digest.
Optionally, in a case that a target first parameter of the at least two first parameters meets a preset condition, sending second information to the stylus includes:
and sending second information to the touch control pen under the condition that the difference value between the target first parameter and the target second parameter is smaller than a preset threshold value.
In the embodiment of the application, under the condition that the target first parameter acquired by the touch pen and the target second parameter in the at least one second parameter acquired by the electronic equipment are smaller than the set threshold, it is determined that the electronic equipment is not attacked by the replay vector, and the electronic equipment sends second information to the touch pen.
Optionally, the target first parameter is a first timestamp corresponding to the stylus, and the target second parameter is a second timestamp corresponding to the electronic device.
In the embodiment of the application, the replay vector attack is prevented through the time stamp, if the time difference between the first time stamp of the touch pen and the second time stamp of the electronic device is smaller than the preset threshold value, the electronic device is determined not to be attacked by the replay vector, otherwise, the payment transaction processing is ended.
Optionally, the second information is obtained by performing asymmetric encryption processing on the second timestamp.
In the embodiment of the application, when the first target parameter of the stylus meets a preset condition, the electronic device obtains a current second timestamp, hash operation is performed on the second timestamp of the electronic device to obtain a second timestamp hash value of the electronic device, and the second timestamp hash value is asymmetrically encrypted by using an RSA public key to obtain second information.
Optionally, the authenticating the identity of the stylus according to the first key and the second key includes:
and when the first key is matched with the second key, determining that the identity authentication of the stylus is successful.
The case where the first key matches the second key includes the case where the first key is equal to the second key. In the embodiment of the application, when the first key and the second key are judged to be equal, the success of identity authentication of the touch pen is determined, namely the identity is legal, and if the first key and the second key are judged to be unequal, the identity authentication process is ended.
Optionally, the obtaining the first message digest according to the first key, the second key, the first transaction authentication information and the second transaction authentication information includes:
after receiving the transaction request information sent by the touch pen, acquiring the second transaction authentication information;
Encrypting the second transaction authentication information by using the second key to obtain fourth information;
transmitting the fourth information to the stylus;
obtaining fifth information obtained by the touch pen according to the fourth information, the first key and the first transaction authentication information;
and decrypting the fifth information to obtain the first message digest.
In the embodiment of the application, after receiving the transaction request information sent by the touch pen, the electronic device obtains the transaction time of the electronic device, the transaction account number of the electronic device and the transaction amount of the electronic device, so as to obtain second transaction authentication information of the electronic device, symmetrically encrypts the second transaction authentication information by using a second key authenticated by the electronic device, so as to obtain fourth information, and sends the fourth information to the touch pen.
And after the stylus receives the fourth message, combining the transaction time of the stylus, the transaction account number of the stylus or the transaction amount of the stylus to obtain second transaction authentication information of the stylus. The touch pen symmetrically decrypts the fourth information by using the first key to obtain second transaction authentication information of the electronic equipment, inputs the first key, the first authentication information and the second authentication information into the hash operation function according to the hash operation function related to the key to generate a first message abstract of the touch pen, and symmetrically encrypts the first message abstract, the first transaction authentication information and the second transaction authentication information by using the first key to obtain fifth information and sends the fifth information to the electronic equipment.
It should be noted that, the transaction account number of the electronic device is the same as the transaction account number of the stylus, and the transaction amount of the electronic device is the same as the transaction amount of the stylus.
And after the electronic equipment receives the fifth information, symmetrically decrypting the fifth information by using the second key to obtain the first transaction authentication information, the second transaction authentication information and the first message digest.
After the electronic equipment symmetrically decrypts the fifth information by using the second key to obtain the first transaction authentication information, the second transaction authentication information and the first message digest, the second key, the first authentication information and the second authentication information are input into the hash operation function according to the hash operation function related to the key, and the second message digest of the electronic equipment is generated.
As shown in fig. 2, an embodiment of the present application further provides an information interaction method, applied to a stylus, where the method includes:
step 201: and sending first information to the electronic equipment, wherein the first information comprises a first ciphertext and identity authentication request information, and the first ciphertext is obtained by encrypting at least two first parameters.
In the embodiment of the application, under the condition that a user selects to enter a stylus safety mode on an electronic device, after the stylus receives a safety communication signal sent by the electronic device, the stylus automatically generates a first parameter including a random number RN of the stylus, a current first timestamp of the stylus and an identity number ID of the stylus, calculates the random number RN of the stylus and the identity number ID of the stylus, and correspondingly generates a random number hash value HRN of the stylus and an identity number hash value HID of the stylus. And performing asymmetric encryption on the identification number hash value HID of the stylus, the random number hash value HRN of the stylus and the first timestamp of the stylus by using the RSA public key to obtain a first ciphertext.
Step 202: and acquiring second information sent by the electronic equipment, wherein the second information is obtained by encrypting at least one second parameter.
In this embodiment of the present application, the at least one second parameter is obtained by the electronic device, and exemplary, the second parameter of the electronic device is a second timestamp of the electronic device, hash operation is performed on the second timestamp of the electronic device to obtain a second timestamp hash value, the RSA public key is used to encrypt the second timestamp hash value to obtain second information, and the second information is sent to the stylus.
Step 203: and sending third information to the electronic equipment, wherein the third information is obtained by encryption processing based on part of the first parameters in the at least two first parameters.
In this embodiment of the present application, after the stylus acquires the second information, the RSA private key is used to asymmetrically decrypt the second information to obtain a second timestamp hash value, then the stylus obtains a first timestamp hash value of the stylus according to hash operation, the identity number hash value HID of the stylus is exclusive-ored with the random number hash value HRN of the stylus, the first timestamp hash value of the stylus is exclusive-ored with the temporary private key, the RSA private key is used to asymmetrically encrypt the temporary private key to obtain third information, and the third information is sent to the electronic device.
Step 204: the method comprises the steps of obtaining identity authentication information sent by electronic equipment, wherein the identity authentication information is obtained by the electronic equipment according to a first key and a second key, the first key is generated according to third information and the second information, and the second key is generated according to the first information and the second information.
In the embodiment of the application, the electronic device decrypts the third information to obtain the temporary private key, the identification number hash value HID of the touch pen, the random number hash value HRN of the touch pen and the first timestamp hash value of the touch pen, the temporary private key is exclusive-or the second timestamp hash value in the second information to obtain the first key of the touch pen, the identification number hash value HID of the touch pen is exclusive-or the random number hash value HRN of the touch pen is exclusive-or the second timestamp hash value of the electronic device to obtain the second key of the electronic device, and the electronic device performs identity authentication on the touch pen through the first key and the second key.
Step 205: and after the identity authentication information indicates that the identity authentication is successful, the electronic equipment and the identity authentication information interact with each other.
In the embodiment of the application, when the electronic device determines that the first key and the second key are equal, it is confirmed that the identity authentication of the stylus is successful, and identity authentication information is sent to the stylus, at this time, the electronic device is in a stylus security mode, and control rights of subsequent electronic devices are given to the authenticated stylus, that is, only the authenticated stylus can have rights to control the electronic device, and interaction of target information is performed with the electronic device. The electronic device can intercept the operation of the non-authenticated stylus or the operation of the finger because the non-authenticated stylus or the operation of the finger is not authenticated by the key, so that the electronic device cannot interact with the target information without responding to the operation of the non-authenticated stylus or the operation of the finger, and can only respond to the operation of the authenticated stylus to interact with the target information. For example, the video playing interface of the electronic device includes a video playing control, after the electronic device authenticates the validity of the identity of the first stylus according to the above steps, the video playing control can respond to the input of the first stylus, and the video playing control is not authenticated by the electronic device, or the second stylus that is not authenticated has no authority to control the video playing control, that is, the video playing control does not respond to the input of the second stylus. The interaction of the target information with the electronic equipment comprises the following steps:
And under the condition that the electronic equipment receives a safe transaction state signal sent by the electronic equipment, carrying out interaction of payment transaction information with the electronic equipment, wherein the safe transaction state signal is obtained according to the first key and the second key.
In the embodiment of the application, the electronic device obtains the first message digest according to the first key, the first authentication information and the second authentication information, obtains the second message digest according to the second key, the first authentication information and the second authentication information, and when the first message digest is identical to the second message digest, the electronic device confirms that the identity authentication of the stylus is successful, that is, the electronic device is in a stylus security mode, the user clicks a payment transaction key on the electronic device by using the stylus, and when the interaction of payment transaction information is performed, the electronic device verifies the security of the transaction environment according to the first key and the second key, and after the security of the transaction environment is determined, payment transaction processing can be performed, so that the security of the transaction can be improved.
The following describes the identity authentication process of the stylus and the electronic device with reference to fig. 3:
the method comprises the steps that a user selects a touch pen safety mode on electronic equipment, the electronic equipment sends a safety communication signal to the touch pen, the touch pen automatically generates a random number RN of the touch pen, and a current first timestamp TS0 of the touch pen and an identity number ID of the touch pen are obtained; carrying out hash operation on the random number RN of the touch pen and the identity number ID of the touch pen to generate a corresponding random number hash value HRN of the touch pen and an identity number hash value HID of the touch pen, wherein the corresponding formulas are as follows: hid=hash (ID), hrn=hash (RN); using RSA public key PK to asymmetrically encrypt the identification number hash value HID of the stylus, the random number hash value HRN of the stylus and the first timestamp TS0 to generate a first ciphertext Eka, wherein the corresponding formula is as follows: eka=rsa-enc (PK, hid+hrn+ts0), wherein the symbol "+" indicates a connection, and the first information, i.e., the first ciphertext Eka and the authentication request information, is transmitted to the electronic device in a wireless manner.
The electronic equipment uses an RSA private key UK to asymmetrically decrypt the first ciphertext Eka to obtain an identification number hash value HID of the touch pen, a random number hash value HRN of the touch pen and a first timestamp TS0, and the corresponding formula is as follows: hid+hrn+ts0=rsa-dec (UK, eka). The electronic device obtains a current second timestamp TS1 of the electronic device, judges whether the time difference between the second timestamp TS1 and the first timestamp TS0 is smaller than a preset threshold delta T, namely whether (TS 1-TS 0) < delta T is met, if so, carries out hash operation on the second timestamp TS1 to obtain a second timestamp hash value HTS1, and the corresponding formula is as follows: hts1=hash (TS 1), and performing asymmetric encryption on the second timestamp Hash value HTS1 by using the RSA public key PK to obtain second information EHTS1, where the corresponding formula is: ehts1=rsa-enc (PK, HTS 1), otherwise, the identity authentication process ends.
Under the condition that (TS 1-TS 0) < delta T is met, the electronic equipment sends second information EHTS1 to the touch control pen, the touch control pen uses an RSA private key UK to asymmetrically decrypt the second information EHTS1, a second timestamp hash value HTS1 is obtained, and the corresponding formula is: hts1=rsa-dec (UK, EHTS 1), and performing hash operation on the first timestamp TS0 to obtain a first timestamp hash value HTS0, where the corresponding formula is: HTS0=Hash (TS 0), then the identification number Hash value HID of the stylus is exclusive-ored with the random number Hash value HRN of the stylus and exclusive-ored with the first timestamp Hash value HTS0 to obtain a temporary private key HKEY0 of the stylus, and the corresponding formula is: HKEY 0=hid ∈hrn ∈hts0, where the symbol "" represents an exclusive-or operation, and when the temporary private key HKEY0 is asymmetrically encrypted using the RSA public key PK, a third information EHKEY0 is obtained, and the corresponding formula is: ehkey0=rsa-enc (PK, HKEY 0), and third information EHKEY0 is transmitted to the electronic device.
The electronic equipment uses the private key UK to asymmetrically decrypt the third information EHKEY0 to obtain a temporary private key HKEY0, and the corresponding formula is as follows: HKEY 0=rsa-dec (UK, EHKEY 0), the temporary private key HKEY0 is exclusive-ored with the second timestamp hash value HTS1 to obtain the first key HKEY ya of the stylus to be verified, and the corresponding formula is: HKEY ya=hkey 0 @ HTS1, exclusive-or the identification number hash value HID of the stylus with the random number hash value HRN of the stylus with the second timestamp hash value HTS1 with the first timestamp hash value HTS0 to obtain a second key HKEY of the electronic device, where the corresponding formula is: hkey=hid # -HRN # -HTS 1 # -HTS 0.
Judging whether the first secret key HKEya is equal to the second secret key HKEYb, if so, determining that the identity authentication of the stylus is successful, namely authenticating the validity of the stylus, and if not, ending the identity authentication process.
After the identity authentication of the stylus is successful, the electronic equipment sends identity authentication information to the stylus, the identity authentication process of the stylus is completed, the stylus uses the hash value HID of the identity identification number to exclusive-or the hash value HRN of the random number of the stylus to exclusive-or the hash value HTS0 of the first timestamp to exclusive-or the hash value HTS1 of the second timestamp to obtain the first key HKEYa of the stylus.
It should be noted that, the keys of the stylus and the electronic device are generated after each identity authentication, so the keys are changed, the keys of the stylus and the electronic device are not transmitted wirelessly and are generated by themselves, and the two ways greatly enhance the interaction security of the electronic device and the stylus.
The process of determining the transaction environment with the stylus and the electronic device is described below in conjunction with fig. 4:
and after the identity authentication of the stylus is successful, sending transaction request information to the electronic equipment.
The electronic device obtaining second transaction authentication information Mb, comprising: the transaction time, the transaction account number and the transaction amount of the electronic equipment are symmetrically encrypted by using a second key HKEYb of the electronic equipment, which is generated after the electronic equipment authenticates the touch pen, to obtain fourth information EMb, and the corresponding formula is as follows: EMb =aes-enc (hkey yb, mb) and then sent to the stylus.
The stylus obtains first transaction authentication information Ma, including: the transaction time of the stylus uses the first key hkey ya of the stylus to symmetrically decrypt the fourth information EMb to obtain the second transaction authentication information Mb, and the corresponding formula is: mb=aes-dec (hkey ya, EMb); then, according to a key-related hash operation function HMAC (message), a first key hkey ya of the stylus and first transaction authentication information Ma and second transaction authentication information Mb are input into the key-related hash operation function, and a first message digest HKaMab of the stylus is calculated, wherein the corresponding formula is as follows: HKaMab = HMAC (hkey ya, ma+mb); then, the stylus uses the first key hkey ya to symmetrically encrypt the first transaction authentication information Ma, the second transaction authentication information Mb and the first message digest HKaMab, so as to obtain fifth information Aka, and the fifth information is wirelessly transmitted to the electronic device.
The electronic device uses the second key hkey yb to symmetrically decrypt the fifth information Aka to Ma, mb and HKaMab, and then inputs the second key hkey yb of the electronic device, the first transaction authentication information Ma and the second transaction authentication information Mb into the hash function related to the key according to the hash function HMAC (key, message) related to the key, so as to calculate a second message digest hkama of the electronic device, where the corresponding formula is as follows: hkbmab=hmac (hkey yb, ma+mb); finally, the electronic device judges whether the first message digest HKAMab is equal to the second message digest HKBMab, if so, the electronic device determines that the transaction environment is safe, sends a safe transaction state signal to the touch pen, can carry out payment transaction, and otherwise, ends the transaction.
When the stylus receives the safe transaction state signal, the transaction button can be clicked by the stylus, and then payment transaction can be carried out.
It should be noted that, after the identity authentication of the stylus is successful, if the stylus is in a non-transaction scenario, it is not necessary to verify whether the transaction environment is safe, but only the stylus that is authenticated at present can be responded. The transaction scenario requires verifying the security of the transaction environment, and may ensure the security of the payment transaction processing, and only if the transaction environment is secure, may the payment transaction be conducted.
It should be noted that, in the information interaction method provided in the embodiment of the present application, the execution subject may be an information interaction device, or a control module in the information interaction device for executing the information interaction method. In the embodiment of the application, an information interaction device executes an information interaction method by taking an information interaction device as an example, and the information interaction device provided in the embodiment of the application is described.
Fig. 5 is one of the block diagrams of the information interaction device of one embodiment of the present application. The information interaction device 500 shown in fig. 5 is applied to an electronic device, and includes a first obtaining module 501, a first sending module 502, a second obtaining module 503, an authentication module 504, and a first interaction module 505.
The first obtaining module 501 is configured to obtain first information sent by the stylus, where the first information includes a first ciphertext and identity authentication request information, and the first ciphertext is obtained by encrypting at least two first parameters;
a first sending module 502, configured to send second information to the stylus when a target first parameter of the at least two first parameters meets a preset condition, where the second information is obtained by performing encryption processing on at least one second parameter;
a second obtaining module 503, configured to obtain third information sent by the stylus according to the second information, where the third information is obtained by performing encryption processing based on a part of the first parameters in the at least two first parameters;
An authentication module 504, configured to authenticate the identity of the stylus according to a first key and a second key, where the first key is generated according to the third information and the second information, and the second key is generated according to the first information and the second information;
the first interaction module 505 is configured to interact with the stylus to perform target information after the identity authentication of the stylus is successful.
According to the information interaction device 500 provided by the embodiment of the application, through the process of information interaction between the touch pen and the electronic equipment, the first key of the touch pen and the second key of the electronic equipment are obtained according to the first information, the second information and the third information interacted with the touch pen, identity authentication is carried out on the touch pen according to the first key and the second key, the touch pen can interact with the electronic equipment after passing the identity authentication, and the safety of the interaction information can be ensured to a certain extent.
Optionally, the first interaction module 505 includes:
and the first sub-interaction module is used for interacting with the stylus payment transaction information under the condition that the safe transaction state is determined according to the first key and the second key.
Optionally, the first sub-interaction module includes:
the first sub-generation module is used for obtaining a first message digest according to the first key, the second key, the first transaction authentication information and the second transaction authentication information;
a second sub-generation module, configured to obtain a second message digest according to the second key, the first transaction authentication information, and the second transaction authentication information;
a determining submodule, configured to determine that the first message digest matches the second message digest, and the first message digest is in a secure transaction state;
the first sub-sending module is used for sending a safe transaction state signal to the touch pen;
the first transaction authentication information is transaction information confirmed by the touch pen, and the second transaction authentication information is transaction information confirmed by the electronic equipment.
Optionally, the first sending module 502 includes:
and the first sending unit is used for sending second information to the touch control pen under the condition that the difference value between the target first parameter and the target second parameter is smaller than a preset threshold value.
Optionally, the target first parameter is a first timestamp corresponding to the stylus, and the target second parameter is a second timestamp corresponding to the electronic device.
Optionally, the second information is obtained by performing asymmetric encryption processing on the second timestamp.
Optionally, the authentication module 504 includes:
and the authentication unit is used for determining that the identity authentication of the touch pen is successful when the first key is matched with the second key.
Optionally, the first sub-generation module includes:
the receiving unit is used for acquiring the second transaction authentication information after receiving the transaction request information sent by the touch pen;
the first generation unit is used for encrypting the second transaction authentication information by using the second key to obtain fourth information;
a second sending unit, configured to send the fourth information to the stylus;
the first acquisition unit is used for acquiring fifth information obtained by the stylus according to the fourth information, the first key and the first transaction authentication information;
and the second generating unit is used for decrypting the fifth information to obtain the first message digest.
According to the information interaction device 500 provided by the embodiment of the application, in the process of information interaction between the touch pen and the electronic equipment, the first key of the touch pen and the second key of the electronic equipment are obtained according to the first information, the second information and the third information interacted with the touch pen, identity authentication is carried out on the touch pen according to the first key and the second key, the electronic equipment can be operated after the touch pen passes the identity authentication, and the safety of interaction information can be guaranteed to a certain extent.
The information interaction device in the embodiment of the application may be a device, or may be a component, an integrated circuit, or a chip in a terminal. The device may be a mobile electronic device or a non-mobile electronic device. By way of example, the mobile electronic device may be a cell phone, tablet computer, notebook computer, palm computer, vehicle-mounted electronic device, wearable device, ultra-mobile personal computer (ultra-mobile personal computer, UMPC), netbook or personal digital assistant (personal digital assistant, PDA), etc., and the non-mobile electronic device may be a server, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (TV), teller machine or self-service machine, etc., and the embodiments of the present application are not limited in particular.
The information interaction device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an ios operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.
The information device provided in this embodiment of the present application can implement each process implemented in the method embodiment of fig. 1, and in order to avoid repetition, a description is omitted here.
According to the device, in the process of information interaction between the touch pen and the electronic equipment, the first key of the touch pen and the second key of the electronic equipment are obtained according to the first information, the second information and the third information interacted with the touch pen, identity authentication is carried out on the touch pen according to the first key and the second key, the electronic equipment can be operated after the touch pen passes through the identity authentication, and the safety of interaction information can be guaranteed to a certain extent.
It should be noted that, the information interaction device provided in the embodiment of the present application is a device capable of executing the information interaction method applied to the electronic device, so all embodiments of the information interaction method applied to the electronic device are applicable to the device, and the same or similar beneficial effects can be achieved.
Fig. 6 is a second block diagram of an information interaction device according to one embodiment of the present application. The information interaction device 600 shown in fig. 6 is applied to a stylus and comprises a second sending module 601, a third obtaining module 602, a third sending module 603, a fourth obtaining module 604 and a second interaction module 605.
A second sending module 601, configured to send first information to an electronic device, where the first information includes a first ciphertext and identity authentication request information, and the first ciphertext is obtained by encrypting at least two first parameters;
A third obtaining module 602, configured to obtain second information sent by the electronic device, where the second information is obtained by performing encryption processing on at least one second parameter;
a third sending module 603, configured to send third information to the electronic device, where the third information is obtained by performing encryption processing based on a part of the first parameters in the at least two first parameters;
a fourth obtaining module 604, configured to obtain identity authentication information sent by the electronic device, where the identity authentication information is obtained by the electronic device according to a first key and a second key, where the first key is generated according to the third information and the second information, and the second key is generated according to the first information and the second information;
and the second interaction module 605 is configured to perform interaction of target information with the electronic device after the identity authentication information indicates that the identity authentication is successful.
Optionally, the second interaction module 605 includes:
and the second sub-interaction module is used for interacting payment transaction information with the electronic equipment under the condition that the electronic equipment is received to send a safe transaction state signal, and the safe transaction state signal is obtained according to the first key and the second key.
According to the information interaction device 600 provided by the embodiment of the application, in the process of information interaction between the touch pen and the electronic equipment, the first key of the touch pen and the second key of the electronic equipment are obtained according to the first information, the second information and the third information interacted with the touch pen, identity authentication is carried out on the touch pen according to the first key and the second key, the electronic equipment can be operated after the touch pen passes the identity authentication, and the safety of interaction information can be ensured to a certain extent.
It should be noted that, the information interaction device provided in the embodiment of the present application is a device capable of executing the information interaction method applied to the stylus, so all embodiments of the information interaction method applied to the stylus are applicable to the device, and the same or similar beneficial effects can be achieved.
Optionally, as shown in fig. 7, the embodiment of the present application further provides an electronic device 700, including a processor 701, a memory 702, and a program or an instruction stored in the memory 702 and capable of running on the processor 701, where the program or the instruction implements the above embodiment of the information interaction method applied to the electronic device when executed by the processor 701, or implements each process of the above embodiment of the information interaction method applied to the stylus, and the same technical effects can be achieved, so that repetition is avoided, and no further description is given here.
It should be noted that, the electronic device in the embodiment of the present application includes the mobile electronic device and the non-mobile electronic device described above.
It should be noted that, the electronic device provided in the embodiment of the present application is an electronic device capable of executing the above information interaction method applied to the electronic device, or executing the above information interaction method applied to the stylus, and then the above information interaction method applied to the electronic device, or all embodiments of the above information interaction method applied to the stylus are applicable to the electronic device, and the same or similar beneficial effects can be achieved.
Fig. 8 is a schematic hardware structure of an electronic device implementing various embodiments of the present application.
The electronic device 800 includes, but is not limited to: radio frequency unit 801, network module 802, audio output unit 803, input unit 804, sensor 805, display unit 806, user input unit 807, interface unit 808, memory 809, and processor 810.
Those skilled in the art will appreciate that the electronic device 800 may also include a power source (e.g., a battery) for powering the various components, which may be logically connected to the processor 810 by a power management system to perform functions such as managing charge, discharge, and power consumption by the power management system. The electronic device structure shown in fig. 8 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than shown, or may combine certain components, or may be arranged in different components, which are not described in detail herein.
The processor 810 is configured to obtain first information sent by the stylus, where the first information includes a first ciphertext and identity authentication request information, and the first ciphertext is obtained by encrypting at least two first parameters; and sending second information to the touch pen under the condition that a target first parameter in the at least two first parameters meets a preset condition, wherein the second information is obtained by encrypting at least one second parameter; the third information sent by the touch pen according to the second information is obtained by encryption processing based on part of the first parameters in the at least two first parameters; and authenticating the identity of the stylus according to a first key and a second key, the first key being generated according to the third information and the second information, the second key being generated according to the first information and the second information; and after the identity authentication of the touch pen is successful, performing interaction of target information with the touch pen.
Therefore, in the electronic device 800, in the process of information interaction between the stylus and the electronic device, according to the first information, the second information and the third information interacted with the stylus, the first key of the stylus and the second key of the electronic device are obtained respectively, the identity of the stylus is authenticated according to the first key and the second key, and after the stylus passes the identity authentication, the stylus can interact with the electronic device for target information, so that the security of interaction information can be ensured to a certain extent.
Optionally, the processor 810 is further configured to: and under the condition that the safe transaction state is determined according to the first key and the second key, carrying out interaction with the stylus payment transaction information.
Optionally, the processor 810 is further configured to: obtaining a first message digest according to the first key, the second key, the first transaction authentication information and the second transaction authentication information; and obtaining a second message digest according to the second key, the first transaction authentication information and the second transaction authentication information; and determining to be in a secure transaction state if the first message digest matches the second message digest; and sending a secure transaction status signal to the stylus; the first transaction authentication information is transaction information confirmed by the touch pen, and the second transaction authentication information is transaction information confirmed by the electronic equipment.
Optionally, the processor 810 is further configured to: and sending second information to the touch control pen under the condition that the difference value between the target first parameter and the target second parameter is smaller than a preset threshold value.
Optionally, the target first parameter is a first timestamp corresponding to the stylus, and the target second parameter is a second timestamp corresponding to the electronic device.
Optionally, the second information is obtained by performing asymmetric encryption processing on the second timestamp.
Optionally, the processor 810 is further configured to: and when the first key is matched with the second key, determining that the identity authentication of the stylus is successful.
Optionally, the processor 810 is further configured to: after receiving the transaction request information sent by the touch pen, acquiring the second transaction authentication information; and encrypting the second transaction authentication information by using the second key to obtain fourth information; and sending the fourth information to the stylus; obtaining fifth information obtained by the touch pen according to the fourth information, the first key and the first transaction authentication information; and decrypting the fifth information to obtain the first message digest.
According to the electronic device 800 provided by the embodiment of the invention, in the process of information interaction between the touch pen and the electronic device, the first key of the touch pen and the second key of the electronic device are obtained according to the first information, the second information and the third information interacted with the touch pen, the identity authentication is performed on the touch pen according to the first key and the second key, the touch pen can interact with the electronic device for target information after the identity authentication, and the security of the interaction information can be ensured to a certain extent.
It should be appreciated that in embodiments of the present application, the input unit 804 may include a graphics processor (Graphics Processing Unit, GPU) 8041 and a microphone 8042, with the graphics processor 8041 processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The display unit 806 may include a display panel 8061, and the display panel 8061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 807 includes a touch panel 8071 and other input devices 8072. Touch panel 8071, also referred to as a touch screen. The touch panel 8071 may include two parts, a touch detection device and a touch controller. Other input devices 8072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and so forth, which are not described in detail herein. The memory 809 may be used to store software programs as well as various data including, but not limited to, application programs and an operating system. The processor 810 may integrate an application processor that primarily handles operating systems, user interfaces, applications, etc., with a modem processor that primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 810.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implement the above-mentioned embodiment of the information interaction method applied to the electronic device, or implement each process of the above-mentioned embodiment of the information interaction method applied to the stylus, and the same technical effect can be achieved, so that repetition is avoided, and no further description is given here.
Wherein the processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium such as a Read-Only Memory (ROM), a random access Memory (Random Access Memory RAM), a magnetic disk or an optical disk, and the like.
The embodiment of the application further provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to run a program or instructions, implement the above-mentioned information interaction method embodiment applied to an electronic device, or implement each process of the above-mentioned information interaction method embodiment applied to a stylus, and achieve the same technical effect, so that repetition is avoided, and no redundant description is given here.
It should be understood that the chips referred to in the embodiments of the present application may also be referred to as system-on-chip chips, chip systems, or system-on-chip chips, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in an opposite order depending on the functions involved, e.g., the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), including several instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method described in the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those of ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are also within the protection of the present application.

Claims (22)

1. An information interaction method, which is applied to an electronic device, the method comprising:
acquiring first information sent by a touch pen, wherein the first information comprises a first ciphertext and identity authentication request information, and the first ciphertext is obtained by encrypting at least two first parameters;
sending second information to the touch pen under the condition that a target first parameter in the at least two first parameters meets a preset condition, wherein the second information is obtained by encrypting at least one second parameter;
acquiring third information sent by the touch pen according to the second information, wherein the third information is obtained by encryption processing based on part of the first parameters in the at least two first parameters;
authenticating the identity of the stylus according to a first key and a second key, wherein the first key is generated according to the third information and the second information, and the second key is generated according to the first information and the second information;
and after the identity authentication of the touch pen is successful, performing interaction of target information with the touch pen.
2. The information interaction method according to claim 1, wherein the interaction of target information with the stylus includes:
And under the condition that the safe transaction state is determined according to the first key and the second key, carrying out interaction with the stylus payment transaction information.
3. The information interaction method according to claim 2, wherein determining that the secure transaction state is in accordance with the first key and the second key comprises:
obtaining a first message digest according to the first key, the second key, the first transaction authentication information and the second transaction authentication information;
obtaining a second message digest according to the second key, the first transaction authentication information and the second transaction authentication information;
determining to be in a secure transaction state if the first message digest matches the second message digest;
transmitting a safe transaction state signal to the stylus;
the first transaction authentication information is transaction information confirmed by the touch pen, and the second transaction authentication information is transaction information confirmed by the electronic equipment.
4. The information interaction method according to claim 1, wherein, in a case where a target first parameter of the at least two first parameters satisfies a preset condition, sending second information to the stylus includes:
And sending second information to the touch control pen under the condition that the difference value between the target first parameter and the target second parameter is smaller than a preset threshold value.
5. The information interaction method according to claim 4, wherein the target first parameter is a first timestamp corresponding to the stylus, and the target second parameter is a second timestamp corresponding to the electronic device.
6. The information interaction method according to claim 5, wherein the second information is obtained by performing asymmetric encryption processing on the second timestamp.
7. The method of claim 1, wherein the authenticating the stylus according to the first key and the second key comprises:
and when the first key is matched with the second key, determining that the identity authentication of the stylus is successful.
8. The method of claim 3, wherein the obtaining a first message digest according to the first key, the second key, the first transaction authentication information, and the second transaction authentication information comprises:
after receiving the transaction request information sent by the touch pen, acquiring the second transaction authentication information;
Encrypting the second transaction authentication information by using the second key to obtain fourth information;
transmitting the fourth information to the stylus;
obtaining fifth information obtained by the touch pen according to the fourth information, the first key and the first transaction authentication information;
and decrypting the fifth information to obtain the first message digest.
9. An information interaction method, which is applied to a touch pen, comprises the following steps:
the method comprises the steps of sending first information to electronic equipment, wherein the first information comprises first ciphertext and identity authentication request information, and the first ciphertext is obtained by encrypting at least two first parameters;
acquiring second information sent by the electronic equipment, wherein the second information is obtained by encrypting at least one second parameter;
transmitting third information to the electronic equipment, wherein the third information is obtained by encryption processing based on part of the first parameters in the at least two first parameters;
acquiring identity authentication information sent by the electronic equipment, wherein the identity authentication information is obtained by the electronic equipment according to a first key and a second key, the first key is generated according to the third information and the second information, and the second key is generated according to the first information and the second information;
And after the identity authentication information indicates that the identity authentication is successful, the electronic equipment and the identity authentication information interact with each other.
10. The information interaction method according to claim 9, wherein the interaction of target information with the electronic device includes:
and under the condition that the electronic equipment receives a safe transaction state signal sent by the electronic equipment, carrying out interaction of payment transaction information with the electronic equipment, wherein the safe transaction state signal is obtained according to the first key and the second key.
11. An information interaction apparatus, characterized in that it is applied to an electronic device, said apparatus comprising:
the first acquisition module is used for acquiring first information sent by the touch pen, wherein the first information comprises a first ciphertext and identity authentication request information, and the first ciphertext is obtained by encrypting at least two first parameters;
the first sending module is used for sending second information to the touch pen under the condition that a target first parameter in the at least two first parameters meets a preset condition, and the second information is obtained by encrypting at least one second parameter;
the second acquisition module is used for acquiring third information sent by the touch pen according to the second information, wherein the third information is obtained by encryption processing based on part of the first parameters in the at least two first parameters;
The authentication module is used for carrying out identity authentication on the touch control pen according to a first key and a second key, the first key is generated according to the third information and the second information, and the second key is generated according to the first information and the second information;
and the first interaction module is used for interacting target information with the touch pen after the identity authentication of the touch pen is successful.
12. The information interaction device of claim 11, wherein the first interaction module comprises:
and the first sub-interaction module is used for interacting with the stylus payment transaction information under the condition that the safe transaction state is determined according to the first key and the second key.
13. The information interaction device of claim 12, wherein the first sub-interaction module comprises:
the first sub-generation module is used for obtaining a first message digest according to the first key, the second key, the first transaction authentication information and the second transaction authentication information;
a second sub-generation module, configured to obtain a second message digest according to the second key, the first transaction authentication information, and the second transaction authentication information;
A determining submodule, configured to determine that the first message digest matches the second message digest, and the first message digest is in a secure transaction state;
the first sub-sending module is used for sending a safe transaction state signal to the touch pen;
the first transaction authentication information is transaction information confirmed by the touch pen, and the second transaction authentication information is transaction information confirmed by the electronic equipment.
14. The information interaction device of claim 11, wherein the first sending module comprises:
and the first sending unit is used for sending second information to the touch control pen under the condition that the difference value between the target first parameter and the target second parameter is smaller than a preset threshold value.
15. The information interaction device of claim 14, wherein the target first parameter is a first timestamp corresponding to the stylus and the target second parameter is a second timestamp corresponding to the electronic device.
16. The information interaction device of claim 15, wherein the second information is obtained by performing an asymmetric encryption process on the second timestamp.
17. The information interaction device of claim 11, wherein the authentication module comprises:
And the authentication unit is used for determining that the identity authentication of the touch pen is successful when the first key is matched with the second key.
18. The information interaction device of claim 13, wherein the first sub-generation module comprises:
the receiving unit is used for acquiring the second transaction authentication information after receiving the transaction request information sent by the touch pen;
the first generation unit is used for encrypting the second transaction authentication information by using the second key to obtain fourth information;
a second sending unit, configured to send the fourth information to the stylus;
the first acquisition unit is used for acquiring fifth information obtained by the stylus according to the fourth information, the first key and the first transaction authentication information;
and the second generating unit is used for decrypting the fifth information to obtain the first message digest.
19. An information interaction device, for use with a stylus, the device comprising:
the second sending module is used for sending first information to the electronic equipment, wherein the first information comprises a first ciphertext and identity authentication request information, and the first ciphertext is obtained by encrypting at least two first parameters;
The third acquisition module is used for acquiring second information sent by the electronic equipment, wherein the second information is obtained by encrypting at least one second parameter;
the third sending module is used for sending third information to the electronic equipment, wherein the third information is obtained by encryption processing based on part of the first parameters in the at least two first parameters;
a fourth obtaining module, configured to obtain identity authentication information sent by the electronic device, where the identity authentication information is obtained by the electronic device according to a first key and a second key, where the first key is generated according to the third information and the second information, and the second key is generated according to the first information and the second information;
and the second interaction module is used for carrying out interaction of target information with the electronic equipment after the identity authentication information indicates that the identity authentication is successful.
20. The information interaction device of claim 19, wherein the second interaction module comprises:
and the second sub-interaction module is used for interacting payment transaction information with the electronic equipment under the condition that the electronic equipment is received to send a safe transaction state signal, and the safe transaction state signal is obtained according to the first key and the second key.
21. An electronic device comprising a processor, a memory and a program or instruction stored on the memory and executable on the processor, the program or instruction when executed by the processor implementing the steps of the information interaction method of any one of claims 1 to 8 or the steps of the information interaction method of claim 9 or 10.
22. A readable storage medium, characterized in that the readable storage medium stores thereon a program or instructions, which when executed by a processor, implement the steps of the information interaction method according to any one of claims 1 to 8, or the steps of the information interaction method according to claim 9 or 10.
CN202110089552.4A 2021-01-22 2021-01-22 Information interaction method and electronic equipment Active CN112765628B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110089552.4A CN112765628B (en) 2021-01-22 2021-01-22 Information interaction method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110089552.4A CN112765628B (en) 2021-01-22 2021-01-22 Information interaction method and electronic equipment

Publications (2)

Publication Number Publication Date
CN112765628A CN112765628A (en) 2021-05-07
CN112765628B true CN112765628B (en) 2023-12-22

Family

ID=75706676

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110089552.4A Active CN112765628B (en) 2021-01-22 2021-01-22 Information interaction method and electronic equipment

Country Status (1)

Country Link
CN (1) CN112765628B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10101897B1 (en) * 2016-09-14 2018-10-16 Google Llc Electronic stylus for storing credentials
CN111835752A (en) * 2020-07-09 2020-10-27 国网山西省电力公司信息通信分公司 Lightweight authentication method based on equipment identity and gateway

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10101897B1 (en) * 2016-09-14 2018-10-16 Google Llc Electronic stylus for storing credentials
CN111835752A (en) * 2020-07-09 2020-10-27 国网山西省电力公司信息通信分公司 Lightweight authentication method based on equipment identity and gateway

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
一种基于安全芯片的可信移动存储设备的双向认证机制;王冠;李天亮;;计算机与应用化学(05);全文 *

Also Published As

Publication number Publication date
CN112765628A (en) 2021-05-07

Similar Documents

Publication Publication Date Title
EP3605989B1 (en) Information sending method, information receiving method, apparatus, and system
US10142107B2 (en) Token binding using trust module protected keys
EP3324572B1 (en) Information transmission method and mobile device
CN110572804B (en) Bluetooth communication authentication request, receiving and communication method, mobile terminal and equipment terminal
KR101239297B1 (en) System for protecting information and method thereof
US8792636B2 (en) Protocol for protecting content protection data
CN104955031A (en) Information transmission method and device
CN108199847B (en) Digital security processing method, computer device, and storage medium
CN113794734A (en) Vehicle-mounted CAN bus encryption communication method, control device and readable storage medium
TWI526871B (en) Server, user device, and user device and server interaction method
CN114419765A (en) Method and device for realizing vehicle safety control by NFC card and readable storage medium
CN112565205A (en) Credible authentication and measurement method, server, terminal and readable storage medium
EP4037250A1 (en) Message transmitting system with hardware security module
CN112003697A (en) Encryption and decryption method and device for cryptographic module, electronic equipment and computer storage medium
WO2022135391A1 (en) Identity authentication method and apparatus, and storage medium, program and program product
US20240106633A1 (en) Account opening methods, systems, and apparatuses
CN114221764A (en) Public key updating method, device and equipment based on block chain
CN111444496A (en) Application control method, device, equipment and storage medium
CN116599719A (en) User login authentication method, device, equipment and storage medium
CN112765628B (en) Information interaction method and electronic equipment
CN115801287A (en) Signature authentication method and device
WO2015124798A2 (en) Method &amp; system for enabling authenticated operation of a data processing device
CN115473655A (en) Terminal authentication method, device and storage medium for access network
CN113904830A (en) SPA authentication method and device, electronic equipment and readable storage medium
US20050076217A1 (en) Integrating a device into a secure network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant