CN112765628A - Information interaction method and electronic equipment - Google Patents

Information interaction method and electronic equipment Download PDF

Info

Publication number
CN112765628A
CN112765628A CN202110089552.4A CN202110089552A CN112765628A CN 112765628 A CN112765628 A CN 112765628A CN 202110089552 A CN202110089552 A CN 202110089552A CN 112765628 A CN112765628 A CN 112765628A
Authority
CN
China
Prior art keywords
information
stylus
transaction
secret key
electronic device
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.)
Granted
Application number
CN202110089552.4A
Other languages
Chinese (zh)
Other versions
CN112765628B (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

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/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)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Medical Informatics (AREA)
  • Databases & Information Systems (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • User Interface Of Digital Computer (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 stylus, wherein the first information comprises a first ciphertext and identity authentication request information obtained by encrypting at least two first parameters; when a target first parameter in the at least two first parameters meets a preset condition, sending second information obtained by encrypting at least one second parameter to the touch pen; acquiring third information which is sent by a touch control pen and obtained by encrypting at least two first parameters; performing identity authentication on the stylus according to a first secret key generated by the third information and the second information and a second secret key generated by the first information and the second information; 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 interactive information is possibly tampered to cause unsafe information in the process of using the touch pen to perform information interaction on the electronic equipment by a user.

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 level technology, electronic equipment gradually changes the work and life style of people, and people put forward higher requirements on the interactive safety of the electronic equipment while obtaining the convenience of mobile communication.
In the process of implementing the present application, the inventor finds that at least the following problems exist in the prior art:
as the use of the stylus pen on the electronic device is increased, it is very important to ensure the security of the electronic device, but currently, in the interaction process between the stylus pen and the electronic device, some behaviors may cause the interaction information between the stylus pen and the electronic device to be tampered, resulting in an information security problem of the electronic device.
Disclosure of Invention
The embodiment of the application aims to provide an information interaction method and electronic equipment, and the problem that information is unsafe because interaction information may be tampered when a user uses a stylus to perform information interaction on the electronic equipment can be solved.
In order to solve the technical problem, the present application is implemented as follows:
in a first aspect, an embodiment of the present application provides an information interaction method, which is applied to an electronic device, and the method includes:
acquiring first information sent by a stylus, 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 stylus 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 stylus according to the second information, wherein the third information is obtained by encrypting part of the at least two first parameters;
performing identity authentication on the stylus according to a first secret key and a second secret key, wherein the first secret key is generated according to the third information and the second information, and the second secret key is generated according to the first information and the second information;
and after the identity authentication of the touch pen is successful, performing target information interaction with the touch pen.
In a second aspect, an embodiment of the present application provides an information interaction method, which is applied to a stylus, and the method includes:
sending first information to 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;
acquiring second information sent by the electronic equipment, wherein the second information is obtained by encrypting at least one second parameter;
sending third information to the electronic equipment, wherein the third information is obtained by performing encryption processing on part of 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 secret key and a second secret key, the first secret key is generated according to the third information and the second information, and the second secret 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, interacting the target information with the electronic equipment.
In a third aspect, an embodiment of the present application provides an information interaction apparatus, which is applied to an electronic device, and includes:
the first obtaining module is used for obtaining first information sent by the stylus, 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 stylus 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;
a second obtaining module, configured to obtain third information sent by the stylus according to the second information, where the third information is obtained by performing encryption processing on a part of the at least two first parameters;
the authentication module is used for performing identity authentication on the stylus according to a first secret key and a second secret key, wherein the first secret key is generated according to the third information and the second information, and the second secret key is generated according to the first information and the second information;
and the first interaction module is used for interacting the target information with the touch pen after the identity authentication of the touch pen is successful.
In a fourth aspect, an embodiment of the present application provides an information interaction apparatus, which is applied to a stylus, and includes:
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;
a third sending module, configured to send third information to the electronic device, where the third information is obtained by performing encryption processing on a part of 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 secret key and a second secret key, where the first secret key is generated according to the third information and the second information, and the second secret key is generated according to the first information and the second information;
and the second interaction module is used for interacting the 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, which includes a processor, a memory, and a program or instructions stored on the memory and executable on the processor, and when executed by the processor, the program or instructions implement the steps of the method according to the first aspect, or implement the steps of the method according to the second aspect.
In a sixth aspect, the present embodiments also provide a readable storage medium, on which a program or instructions are stored, which when executed by a processor implement the steps of the method according to the first aspect, or implement the steps of the method according to the second aspect.
In a seventh aspect, an embodiment of the present application 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 execute a program or instructions to implement the method according to the first aspect, or to implement the method according to the second aspect.
In this way, in the embodiment of the application, in the process of information interaction between the stylus and the electronic device, the electronic device may obtain the first secret key of the stylus and the second secret key of the electronic device according to the first information, the second information, and the third information interacted with the stylus, perform identity authentication on the stylus according to the first secret key and the second secret key, and perform interaction of target information with the electronic device only after the stylus passes the identity authentication, so that the security of the interaction information may be ensured to a certain extent.
Drawings
Fig. 1 is a flowchart of an information interaction method according to an embodiment of the present disclosure;
fig. 2 is a second flowchart of an information interaction method according to an embodiment of the present application;
fig. 3 is a schematic diagram illustrating an identity authentication process performed between a stylus and an electronic device according to an embodiment of the present disclosure;
fig. 4 is a schematic diagram illustrating a process of determining security of a transaction environment between a stylus and an electronic device according to an embodiment of the present application;
FIG. 5 is a block diagram of an information interaction apparatus according to an embodiment of the present disclosure;
fig. 6 is a second block diagram of an information interaction apparatus according to an embodiment of the present application;
fig. 7 is a block diagram of an electronic device provided by an embodiment of the present application;
fig. 8 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
The information interaction method provided by the embodiment of the present application is described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
The method of the embodiments 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 phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA), a handheld device with wireless communication capability, a computing device or other processing device connected to a wireless modem, a vehicle mounted device, a wearable device.
As shown in fig. 1, an embodiment of the present application provides an information interaction method applied to an electronic device, including:
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 palmtop computer, and the like, capable of receiving, sending, and processing information; the electronic device can also be a processor with information transceiving 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 selects to enter a stylus security mode and sends a secure communication signal to the stylus.
Optionally, the electronic device and the stylus pen may be connected in a bluetooth or wireless manner.
Alternatively, the electronic device may select to enter the stylus safe mode by entering through a safe mode physical key on the electronic device, or by clicking a virtual key on a screen of the electronic device, such as a safe mode icon.
After the electronic device sends a secure communication signal to the stylus, Identity authentication is performed on the stylus 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, where the at least two first parameters include an Identity number (ID) of the stylus, a Random Number (RN) of the stylus, and a current first timestamp of the stylus.
In the embodiment of the application, hash operation is performed on the ID of the stylus and the random number RN of the stylus to obtain a hash value HID of the ID of the stylus and a hash value HRN of the random number RN of the stylus, and asymmetric encryption is performed on the hash value HID of the ID of the stylus, the hash value HRN of the random number RN of the stylus and the first timestamp of the stylus to obtain a first ciphertext.
Step 102: 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.
In this embodiment, after receiving the first information sent by the stylus, the electronic device asymmetrically decrypts the first ciphertext by using an RSA (public key algorithm) private key to obtain a hash value of a random number of the stylus, a hash value of an ID of the stylus, and a current first timestamp of the stylus, and obtains a current second parameter of the electronic device when a target first parameter of the ID of the stylus, the random number RN of the stylus, and the first timestamp of the stylus satisfies a preset condition, for example, the second parameter may be a current second timestamp of the electronic device, and performs hash operation on the second timestamp to obtain a hash value of a second timestamp of the electronic device, and asymmetrically encrypts the hash value of the second timestamp of the electronic device by using an RSA public key to obtain the second information, if the ID of the stylus, the random number RN of the stylus, and if a target first parameter in the first time stamp of the stylus does not meet the preset condition, ending the step.
It should be noted that, by the target first parameter of the at least two first parameters satisfying the preset condition, the replay vector attack can be prevented, for example, the replay vector attack is prevented by the timestamp, and the smaller the time difference between the first timestamp of the stylus and the second timestamp of the electronic device is, the more synchronized the time of the stylus and the electronic device is, the less the possibility of attack is; the replay vector attack can also be prevented by a 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 electronic device or the stylus is considered to be attacked by the replay vector.
Step 103: and acquiring third information sent by the stylus pen according to the second information, wherein the third information is obtained by encrypting part of the at least two first parameters.
In this embodiment of the application, the stylus encrypts at least two first parameters, that is, the identification 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 identity identification number hash value HID of the stylus and the random number hash value HRN of the stylus according to the hash operation, and obtains the temporary private key according to the identity identification number hash value HID of the stylus or the random number hash value HRN of the stylus or the first timestamp hash value HRN of the stylus, encrypts the temporary private key by using the RSA private key to obtain the third information, and sends the third information to the electronic device, and the electronic device obtains the third information.
Step 104: and performing identity authentication on the stylus according to a first secret key and a second secret key, wherein the first secret key is generated according to the third information and the second information, and the second secret key is generated according to the first information and the second information.
In the embodiment of the application, the electronic device asymmetrically decrypts the third information received from the stylus by using an RSA private key to obtain a first timestamp hash value of the stylus, namely an identity identification number hash value HID of the stylus or a random number hash value RN of the stylus, and a temporary private key on the stylus, and obtains a first key of the stylus by using the temporary private key or a second timestamp hash value; and the identity identification number hash value HID of the stylus or the random number hash value HRN of the stylus or the second timestamp hash value HRN of the electronic equipment or the first timestamp hash value HRN of the stylus or the first timestamp hash value of the electronic equipment is used for obtaining a second key of the electronic equipment.
The identity identification number hash value HID of the stylus is obtained by performing hash operation on an identity identification number ID of the stylus, the random number hash value HRN of the stylus is obtained by performing hash operation on a random number RN of the stylus, the first timestamp hash value of the stylus is obtained by performing hash operation on a first timestamp of the stylus, and the second timestamp hash value of the electronic equipment is obtained by performing hash operation on a second timestamp of the electronic equipment.
And performing identity authentication on the stylus through the first secret key and the second secret key.
Step 105: and after the identity authentication of the touch pen is successful, performing target information interaction with the touch pen.
After the stylus passes the identity authentication of the electronic device, that is, after the validity of the stylus is authenticated, the electronic device sends identity authentication information to the stylus, the electronic device is in a stylus security mode, and the control right of the subsequent electronic device is given to the authenticated stylus, that is, only the authenticated stylus can have the authority to control the electronic device, the unauthenticated stylus, or other operation modes, such as a finger operation mode. For example, the video playing interface of the electronic device includes a video playing control, and 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, but the video playing control is not authenticated by the electronic device, or the video playing control is not controlled by the second stylus that is not authenticated, 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 stylus and the electronic device, the electronic device obtains a first secret key of the stylus and a second secret key of the electronic device according to first information, second information and third information interacted with the stylus, respectively, performs identity authentication on the stylus according to the first secret key and the second secret key, and only after the stylus passes the identity authentication, can the stylus interact with the electronic device for target information, so that the security of the interacted information can be ensured to a certain extent.
The interacting of the target information with the stylus comprises:
and under the condition that the touch pen payment transaction information is determined to be in a safe transaction state according to the first secret key and the second secret key, performing interaction with the touch pen payment transaction information.
In the embodiment of the application, after the electronic device successfully authenticates the identity of the stylus, the electronic device is in the stylus security mode, and when the user clicks a payment transaction key on the electronic device by using the stylus to perform interaction of payment transaction information, the electronic device verifies the security of a transaction environment according to the first secret key and the second secret key, and after the security of the transaction environment is determined, the payment transaction processing can be performed, so that the security of the transaction can be improved.
Optionally, determining that the secure transaction state is present according to the first key and the second key 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 secret key, the first transaction authentication information and the second transaction authentication information;
determining to be in a safe transaction state under the condition that the first message digest is matched with the second message digest;
sending a secure transaction status signal to the stylus;
the first transaction authentication information is transaction information confirmed by the stylus, and the second transaction authentication information is transaction information confirmed by the electronic device.
In the embodiment of the application, the electronic device inputs a first key, first transaction authentication information and second transaction authentication information into a hash operation function according to the hash operation function related to the key to generate a first message digest, inputs a second key, the first transaction authentication information and the second transaction authentication information into a hash operation algorithm to generate a second message digest, wherein 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 the electronic equipment determines that the electronic equipment is in a safe transaction state under the condition that the first message abstract is matched with the second message abstract, and the payment transaction key on the electronic equipment can be clicked by the touch pen to process the payment transaction. Optionally, the case where the first message digest matches the second message digest includes the case where the first message digest is the same as the second message digest.
Optionally, when a target first parameter of the at least two first parameters meets a preset condition, sending second information to the stylus pen, where the sending includes:
and sending second information to the touch pen under the condition that the difference value of the target first parameter and the target second parameter is smaller than a preset threshold value.
In this embodiment of the application, when a target first parameter obtained by the stylus and a target second parameter in at least one second parameter obtained by the electronic device are smaller than a set threshold, it is determined that the electronic device is not under attack of a replay vector, and the electronic device sends second information to the stylus.
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, replay vector attack is prevented through the time stamp, if the time difference value 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, it is determined that the electronic device is not attacked by replay vector, and if not, payment transaction processing is ended.
Optionally, the second information is obtained by performing asymmetric encryption processing on the second timestamp.
In this embodiment of the application, when a first target parameter of the stylus satisfies a preset condition, the electronic device obtains a current second timestamp, performs hash operation on the second timestamp of the electronic device to obtain a second timestamp hash value of the electronic device, and performs asymmetric encryption on the second timestamp hash value 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 secret key is matched with the second secret key, determining that the identity authentication of the stylus pen is successful.
The case where the first key and the second key match includes the case where the first key and the second key are equal. In this embodiment of the application, when the first key is determined to be equal to the second key, it is determined that the identity authentication of the stylus pen is successful, that is, the identity is legal, and if the first key is determined to be not equal to the second key, the identity authentication process is ended.
Optionally, 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 includes:
after transaction request information sent by the touch pen is received, acquiring second transaction authentication information;
encrypting the second transaction authentication information by using the second key to obtain fourth information;
sending the fourth information to the stylus;
acquiring fifth information obtained by the stylus according to the fourth information, the first secret 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 stylus, the electronic device obtains the combination of the transaction time of the electronic device, the transaction account number of the electronic device and the transaction amount of the electronic device to obtain second transaction authentication information of the electronic device, symmetrically encrypts the second transaction authentication information by using a second secret key authenticated by the electronic device to obtain fourth information, and sends the fourth information to the stylus.
And after receiving the fourth message, the stylus combines 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 control pen symmetrically decrypts the fourth information by using the first secret key to obtain second transaction authentication information of the electronic equipment, inputs the first secret key, the first authentication information and the second authentication information into a hash operation function according to the hash operation function related to the secret key to generate a first message digest of the touch control pen, symmetrically encrypts the first message digest, the first transaction authentication information and the second transaction authentication information by using the first secret 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, the second key is used for symmetrically decrypting the fifth information to obtain the first transaction authentication information, the second transaction authentication information and the first message digest.
And 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, inputting the second 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 the second message digest of the electronic equipment.
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 this embodiment of the application, when a user selects to enter a stylus security mode on an electronic device, and after a stylus receives a secure communication signal sent by the electronic device, the stylus may automatically generate a first parameter, which includes a random number RN of the stylus, a current first timestamp of the stylus, and obtain an identification number ID of the stylus, calculate the random number RN of the stylus and the identification number ID of the stylus, and correspondingly generate a random number hash value HRN of the stylus and an identification number hash value HID of the stylus. And carrying out asymmetric encryption on the identity identification number Hash value HID of the touch pen, the random number Hash value HRN of the touch pen and the first time stamp of the touch pen 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 application embodiment, at least one second parameter is obtained by electronic equipment, exemplarily, the second parameter of electronic equipment is the second timestamp of electronic equipment, and the second timestamp hash value is obtained by performing hash operation on the second timestamp of electronic equipment, and 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 performing encryption processing on part of the at least two first parameters.
In this application embodiment, the stylus acquires behind the second information, use the RSA private key to carry out asymmetric decryption to the second information, obtain second time stamp hash value, later the stylus obtains the first time stamp hash value of stylus according to hash operation, hash value the first time stamp hash value of the random number hash value HRN XOR stylus of ID number hash value HID XOR stylus with the stylus is worth obtaining interim private key, use the RSA private key to carry out asymmetric encryption to interim private key, obtain the third information, send the third information for electronic equipment.
Step 204: and acquiring identity authentication information sent by the electronic equipment, wherein the identity authentication information is obtained by the electronic equipment according to a first secret key and a second secret key, the first secret key is generated according to the third information and the second information, and the second secret key is generated according to the first information and the second information.
In this embodiment of the application, the electronic device decrypts the third information to obtain the temporary private key, and the id hash value HID of the stylus, the random hash value HRN of the stylus, and the first timestamp hash value of the stylus, obtain the first key of the stylus with the temporary private key xor of the second timestamp hash value in the second information, obtain the second key of the electronic device with the id hash value HID of the stylus, the random hash value HRN of the stylus, or the second timestamp hash value HRN of the electronic device, and perform the authentication on the identity of the stylus by using the first key and the second key.
Step 205: and after the identity authentication information indicates that the identity authentication is successful, interacting the target information with the electronic equipment.
In this embodiment of the application, when the electronic device determines that the first secret key and the second secret key are equal, it determines that the identity authentication of the stylus pen is successful, and sends identity authentication information to the stylus pen, at this time, the electronic device is in a stylus pen security mode, and the control right of the subsequent electronic device is handed to the authenticated stylus pen, that is, only the authenticated stylus pen can have the right to control the electronic device, and performs interaction of the target information with the electronic device. The unauthorized stylus or other operation modes, such as the finger operation mode, cannot perform the interaction of the target information because the electronic device intercepts the unauthorized stylus or finger operation, so that the electronic device does not respond to the unauthorized stylus or finger operation, cannot perform the interaction of the target information, and can only respond to the authenticated stylus to perform the interaction of the target information. For example, the video playing interface of the electronic device includes a video playing control, and 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, but the video playing control is not authenticated by the electronic device, or the video playing control is not controlled by the second stylus that is not authenticated, 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 a secure transaction state signal sent by the electronic equipment is received, carrying out interaction of payment transaction information with the electronic equipment, wherein the secure transaction state signal is obtained according to the first secret key and the second secret key.
In the embodiment of the application, the electronic device obtains a first message digest according to a first secret key, first authentication information and second authentication information, obtains a second message digest according to a second secret key, the first authentication information and the second authentication information, and when the first message digest is the same as 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, a user clicks a payment transaction key on the electronic device by using the stylus to perform interaction of payment transaction information, the electronic device verifies the security of a transaction environment according to the first secret key and the second secret key, and can perform payment transaction processing after determining the security of the transaction environment, so that the security of the transaction can be improved.
The following describes the identity authentication process between the stylus and the electronic device with reference to fig. 3:
a user selects a stylus safety mode on the electronic device, the electronic device sends a safety communication signal to the stylus, and the stylus automatically generates a random number RN of the stylus and obtains a current first time stamp TS0 of the stylus and an identity identification number ID of the stylus; performing hash operation on the random number RN of the stylus and the identity identification number ID of the stylus to generate a corresponding hash value HRN of the random number of the stylus and a corresponding hash value HID of the identity identification number of the stylus, wherein the corresponding formulas are as follows: HID ═ hash (id), HRN ═ hash (rn); the identity identification number hash value HID of the touch pen, the random number hash value HRN of the touch pen and the first time stamp TS0 are asymmetrically encrypted by using the RSA public key PK to generate a first ciphertext Eka, and the corresponding formula is as follows: RSA-enc (PK, HID + HRN + TS0), where the symbol "+" indicates a connection, and the first message, i.e., the first cipher text Eka and the authentication request message, is wirelessly transmitted to the electronic device.
The electronic equipment uses an RSA private key UK to asymmetrically decrypt the first ciphertext Eka to obtain an identity identification number hash value HID of the stylus, a random number hash value HRN of the stylus 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 again, and determines whether a time difference between the second timestamp TS1 and the first timestamp TS0 is smaller than a preset threshold Δ T, that is, whether (TS1-TS0) < Δ T is satisfied, if so, the hash operation is performed on the second timestamp TS1 to obtain a second timestamp hash value HTS1, where the corresponding formula is: HTS1 is Hash (TS1), and the second timestamp Hash HTS1 is asymmetrically encrypted using RSA public key PK to obtain second information EHTS1, which corresponds to the formula: EHTS1 is RSA-enc (PK, HTS1), otherwise, the authentication process is ended.
Under the condition that (TS1-TS0) < Δ T is satisfied, the electronic device sends the second information EHTS1 to the stylus, the stylus uses the RSA private key UK to asymmetrically decrypt the second information EHTS1, and a second timestamp hash value HTS1 is obtained, where a corresponding formula is: HTS1 is RSA-dec (UK, EHTS1), and hash operation is performed on the first timestamp TS0 to obtain a first timestamp hash value HTS0, and the corresponding formula is: HTS0 is Hash (TS0), and then Hash HID of the identity number of the stylus or Hash HRN of the random number of the stylus or Hash HTS0 of the first timestamp is xored to obtain HKEY0 of the temporary private key of the stylus, where the corresponding formula is: HKEY0 ≧ HID ≦ HRN ≦ HTS0, where symbol ≦ indicates an exclusive-or operation, and asymmetric encryption is performed on HKEY0 using RSA public key PK to obtain third information EHKEY0, which corresponds to the following formula: EHKEY0 is RSA-enc (PK, HKEY0), and transmits the third information EHKEY0 to the electronic device.
The electronic device uses the private key UK to asymmetrically decrypt the third information EHKEY0 to obtain a temporary private key HKEY0, where the corresponding formula is: the HKEY0 is RSA-dec (UK, EHKEY0), the HKEY0 is xor with the hash value HTS1 to obtain the HKEYa of the first key of the stylus to be verified, and the corresponding formula is: HKEYa ═ HKEY0 ≧ HTS1, the second key HKEYb of the electronic device is obtained by xoring the hash value HID of the stylus with the hash value HRN of the random number of the stylus with the hash value HTS1 of the second timestamp or with the hash value HTS0 of the first timestamp, and the corresponding formula is: HKEYb ≧ HID ≦ HRN ≦ HTS1 ≦ HTS 0.
And judging whether the first key HKEYA is equal to the second key HKEYb, if so, determining that the identity authentication of the stylus pen is successful, namely, authenticating the legality of the stylus pen, and otherwise, finishing the identity authentication process.
After the identity authentication of the stylus is successful, the electronic device sends identity authentication information to the stylus to complete the identity authentication process of the stylus, and the stylus obtains a first key HKEYA of the stylus through an identity number hash value HID XOR of a random number hash value HRN of the stylus or a first timestamp hash value HTS0 XOR of a second timestamp hash value HTS 1.
It should be noted that, the secret keys of the stylus and the electronic device are generated after each identity authentication, so the secret keys are changed, and the secret keys of the stylus and the electronic device are generated by themselves without being wirelessly transmitted, which greatly enhances the security of the interaction between the electronic device and the stylus.
The process of determining the transaction context between 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 obtains second transaction authentication information Mb including: the transaction time, the transaction account number and the transaction amount of the electronic device are obtained by symmetrically encrypting the second transaction authentication information Mb by using a second key HKEYb of the electronic device generated after the electronic device authenticates the stylus, so as to obtain fourth information EMb, wherein the corresponding formula is as follows: EMb AES-enc (HKEYb, Mb) and then sent to the stylus.
The stylus obtains first transaction authentication information Ma, including: and (3) symmetrically decrypting the fourth information EMb by using the first key HKEYa of the touch pen to obtain second transaction authentication information Mb at the transaction time of the touch pen, wherein the corresponding formula is as follows: mb is AES-dec (HKEYa, EMB); then, according to a key-related hash operation function HMAC (key, message), inputting the first key HKEYa of the stylus, the first transaction authentication information Ma, and the second transaction authentication information Mb into the key-related hash operation function, and calculating a first message digest HKaMab of the stylus, where the corresponding formula is: HKaMab ═ HMAC (HKEYa, Ma + Mb); then, the stylus uses the first key HKEYa 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, which is sent to the electronic device wirelessly.
The electronic device uses the second key HKEYb to symmetrically decrypt the fifth information Aka to Ma, Mb, and HKaMab, and then inputs the second key HKEYb of the electronic device, the first transaction authentication information Ma, and the second transaction authentication information Mb into the key-dependent hash operation function according to the key-dependent hash operation function HMAC (key, message), to calculate a second message digest HKbMab of the electronic device, where the corresponding formula is: HKbMab ═ HMAC (HKEYb, Ma + Mb); and finally, the electronic equipment judges whether the first message digest HKaMab is equal to the second message digest HKbMab or not, if so, the transaction environment is determined to be safe, a safe transaction state signal is sent to the touch pen, the payment transaction can be carried out, and if not, the transaction is ended.
When the stylus receives the safe transaction state signal, the transaction key can be clicked by the stylus, and then the payment transaction can be carried out.
It should be noted that, after the identity authentication of the stylus is successful, if the authentication is in a non-transaction scenario, it is not necessary to verify whether the transaction environment is safe, but only the stylus that is currently authenticated can be responded. The security of the transaction environment needs to be verified in the transaction scene, the security of payment transaction processing can be ensured, and the payment transaction can be carried out only when the transaction environment is secure.
It should be noted that, in the information interaction method provided in the embodiment of the present application, the execution main body may be an information interaction device, or a control module used for executing the information interaction method in the information interaction device. The information interaction device provided by the embodiment of the present application is described by taking an example of an information interaction method executed by an information interaction device.
FIG. 5 is a block diagram of an information interaction device according to an embodiment of the present application. The information interaction apparatus 500 shown in fig. 5, applied to an electronic device, includes a first obtaining module 501, a first sending module 502, a second obtaining module 503, an authenticating module 504, and a first interaction module 505.
A first obtaining module 501, configured to obtain first information sent by a 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 pen when a target first parameter of the at least two first parameters meets a preset condition, where the second information is obtained by encrypting 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 on a part of the at least two first parameters;
an authentication module 504, configured to perform identity authentication on 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 perform interaction of target information with the stylus after the identity authentication of the stylus is successful.
The information interaction device 500 provided in this embodiment of the application obtains the first secret key of the stylus and the second secret key of the electronic device respectively according to the first information, the second information, and the third information interacted with the stylus during the information interaction between the stylus and the electronic device, performs the identity authentication on the stylus according to the first secret key and the second secret key, and only after the stylus passes the identity authentication, can perform the interaction of the target information with the electronic device, so that the security of the interaction information can be ensured to a certain extent.
Optionally, the first interaction module 505 comprises:
and the first sub-interaction module is used for interacting with the touch pen payment transaction information under the condition that the touch pen payment transaction information is determined to be in a safe transaction state according to the first secret key and the second secret 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;
the second sub-generation module is used for obtaining a second message digest according to the second secret key, the first transaction authentication information and the second transaction authentication information;
a determining submodule, configured to determine that the first message digest is in a secure transaction state if the first message digest matches the second message digest;
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 stylus, and the second transaction authentication information is transaction information confirmed by the electronic device.
Optionally, the first sending module 502 includes:
and the first sending unit is used for sending second information to the touch 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 stylus is successful when the first secret key is matched with the second secret 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 generating 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 obtaining unit is used for obtaining fifth information obtained by the stylus according to the fourth information, the first secret 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.
The information interaction device 500 provided in this application embodiment obtains the first secret key of the stylus and the second secret key of the electronic device respectively according to the first information, the second information, and the third information interacted with the stylus during the information interaction between the stylus and the electronic device, performs identity authentication on the stylus according to the first secret key and the second secret key, and the stylus can operate the electronic device after passing the identity authentication, so that the security of the interaction information can be ensured to a certain extent.
The information interaction device in the embodiment of the present application may be a device, or may also be a component, an integrated circuit, or a chip in a terminal. The device can be mobile electronic equipment or non-mobile electronic equipment. By way of example, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and the non-mobile electronic device may be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine or a self-service machine, and the like, and the embodiments of the present application are not particularly limited.
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 (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.
The information apparatus provided in the embodiment of the present application can implement each process implemented in the method embodiment of fig. 1, and is not described here again to avoid repetition.
According to the device, in the information interaction process between the touch pen and the electronic equipment, the first secret key of the touch pen and the second secret key of the electronic equipment are respectively obtained according to the first information, the second information and the third information which are interacted with the touch pen, the touch pen is subjected to identity authentication according to the first secret key and the second secret key, the electronic equipment can be operated only after the touch pen passes the identity authentication, and the safety of the interaction information can be guaranteed to a certain extent.
It should be noted that the information interaction apparatus provided in the embodiment of the present application is an apparatus capable of executing the information interaction method applied to the electronic device, and all embodiments of the information interaction method applied to the electronic device are applicable to the apparatus and can achieve the same or similar beneficial effects.
Fig. 6 is a second block diagram of an information interaction apparatus according to an embodiment of the present application. The information interaction apparatus 600 shown in fig. 6, applied to a stylus, includes 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 encrypting 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 on a part of 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 secret key and a second secret key, where the first secret key is generated according to the third information and the second information, and the second secret key is generated according to the first information and the second information;
a second interaction module 605, 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 a secure transaction state signal sent by the electronic equipment is received, wherein the secure transaction state signal is obtained according to the first secret key and the second secret key.
The information interaction device 600 provided in this application embodiment obtains the first secret key of the stylus and the second secret key of the electronic device respectively according to the first information, the second information, and the third information interacted with the stylus during the information interaction between the stylus and the electronic device, performs identity authentication on the stylus according to the first secret key and the second secret key, and the stylus can operate the electronic device after passing through the identity authentication, so that the security of the interaction information can be ensured to a certain extent.
It should be noted that the information interaction device provided in the embodiments of the present application is a device capable of executing the information interaction method applied to the stylus, and all the embodiments of the information interaction method applied to the stylus are applicable to the device and can achieve the same or similar beneficial effects.
Optionally, as shown in fig. 7, an electronic device 700 is further provided in an embodiment of the present application, and includes a processor 701, a memory 702, and a program or an instruction stored in the memory 702 and executable on the processor 701, where the program or the instruction is executed by the processor 701 to implement the above embodiment of the information interaction method applied to the electronic device, or to implement each process of the above embodiment of the information interaction method applied to the stylus, and the same technical effect can be achieved, and details are not repeated here to avoid repetition.
It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and the non-mobile electronic devices 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 information interaction method applied to the electronic device or the information interaction method applied to the stylus pen, and all embodiments of the information interaction method applied to the electronic device or the information interaction method applied to the stylus pen are applicable to the electronic device and can achieve the same or similar beneficial effects.
Fig. 8 is a schematic hardware structure diagram of an electronic device implementing various embodiments of the present application.
The electronic device 800 includes, but is not limited to: a radio frequency unit 801, a network module 802, an audio output unit 803, an input unit 804, a sensor 805, a display unit 806, a user input unit 807, an interface unit 808, a memory 809, and a processor 810.
Those skilled in the art will appreciate that the electronic device 800 may further comprise a power source (e.g., a battery) for supplying power to the various components, and the power source may be logically connected to the processor 810 via a power management system, so as to manage charging, discharging, and power consumption management functions via 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 those shown, or combine some components, or arrange different components, and thus, the description is omitted here.
The processor 810 is configured to obtain first information sent by a 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; sending second information to the stylus 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 stylus according to the second information, wherein the third information is obtained by encrypting part of the at least two first parameters; and performing identity authentication on the stylus according to a first secret key and a second secret key, wherein the first secret key is generated according to the third information and the second information, and the second secret key is generated according to the first information and the second information; and after the identity authentication of the touch pen is successful, performing target information interaction with the touch pen.
As can be seen, 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 secret key of the stylus and the second secret key of the electronic device are respectively obtained, the stylus is authenticated according to the first secret key and the second secret key, and the stylus can interact with the electronic device only after passing the authentication, so that the security of the interaction information can be ensured to a certain extent.
Optionally, the processor 810 is further configured to: and under the condition that the touch pen payment transaction information is determined to be in a safe transaction state according to the first secret key and the second secret key, performing interaction with the touch pen 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; 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 stylus, and the second transaction authentication information is transaction information confirmed by the electronic device.
Optionally, the processor 810 is further configured to: and sending second information to the touch pen under the condition that the difference value of 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 secret key is matched with the second secret key, determining that the identity authentication of the stylus pen is successful.
Optionally, the processor 810 is further configured to: after transaction request information sent by the touch pen is received, acquiring second transaction authentication information; encrypting the second transaction authentication information by using the second key to obtain fourth information; and sending the fourth information to the stylus; acquiring fifth information obtained by the stylus according to the fourth information, the first secret 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 application, 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 secret key of the stylus and the second secret key of the electronic device are respectively obtained, identity authentication is performed on the stylus according to the first secret key and the second secret key, only after the stylus passes the identity authentication can the target information interaction be performed with the electronic device, and the security of the interaction information can be guaranteed to a certain extent.
It should be understood that in the embodiment of the present application, the input Unit 804 may include a Graphics Processing Unit (GPU) 8041 and a microphone 8042, and the Graphics Processing Unit 8041 processes image data of a still picture or a video obtained by an image capturing device (such as 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. A touch panel 8071, also referred to as a touch screen. The touch panel 8071 may include two portions of 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, and a joystick, 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 operating systems. The processor 810 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 810.
An 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 embodiment of the information interaction method applied to the electronic device or the processes of the embodiment of the information interaction method applied to the stylus pen are implemented, and the same technical effects can be achieved, and in order to avoid repetition, details are not repeated here.
The processor is the 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 (RAM), a magnetic disk or an optical disk.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to execute a program or an instruction to implement the above embodiment of the information interaction method applied to the electronic device, or to implement each process of the above embodiment of the information interaction method applied to the stylus, and the same technical effects can be achieved, and in order to avoid repetition, the details are not repeated here.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, 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 an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (22)

1. An information interaction method is applied to an electronic device, and the method comprises the following steps:
acquiring first information sent by a stylus, 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 stylus 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 stylus according to the second information, wherein the third information is obtained by encrypting part of the at least two first parameters;
performing identity authentication on the stylus according to a first secret key and a second secret key, wherein the first secret key is generated according to the third information and the second information, and the second secret key is generated according to the first information and the second information;
and after the identity authentication of the touch pen is successful, performing target information interaction with the touch pen.
2. The information interaction method of claim 1, wherein the interacting the target information with the stylus comprises:
and under the condition that the touch pen payment transaction information is determined to be in a safe transaction state according to the first secret key and the second secret key, performing interaction with the touch pen payment transaction information.
3. The information interaction method of claim 2, wherein determining that the information interaction method is in a secure transaction state according to 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 secret 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;
sending a secure transaction status signal to the stylus;
the first transaction authentication information is transaction information confirmed by the stylus, and the second transaction authentication information is transaction information confirmed by the electronic device.
4. The information interaction method according to claim 1, wherein in a case that a target first parameter of the at least two first parameters satisfies a preset condition, sending second information to the stylus pen includes:
and sending second information to the touch pen under the condition that the difference value of 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 information interaction method according to claim 1, wherein the authenticating the stylus according to the first key and the second key comprises:
and when the first secret key is matched with the second secret key, determining that the identity authentication of the stylus pen is successful.
8. The information interaction method of claim 3, wherein obtaining the first message digest according to the first key, the second key, the first transaction authentication information, and the second transaction authentication information comprises:
after transaction request information sent by the touch pen is received, acquiring second transaction authentication information;
encrypting the second transaction authentication information by using the second key to obtain fourth information;
sending the fourth information to the stylus;
acquiring fifth information obtained by the stylus according to the fourth information, the first secret key and the first transaction authentication information;
and decrypting the fifth information to obtain the first message digest.
9. An information interaction method is applied to a touch pen, and comprises the following steps:
sending first information to 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;
acquiring second information sent by the electronic equipment, wherein the second information is obtained by encrypting at least one second parameter;
sending third information to the electronic equipment, wherein the third information is obtained by performing encryption processing on part of 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 secret key and a second secret key, the first secret key is generated according to the third information and the second information, and the second secret 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, interacting the target information with the electronic equipment.
10. The information interaction method according to claim 9, wherein the interaction of the target information with the electronic device comprises:
and under the condition that a secure transaction state signal sent by the electronic equipment is received, carrying out interaction of payment transaction information with the electronic equipment, wherein the secure transaction state signal is obtained according to the first secret key and the second secret key.
11. An information interaction device, applied to an electronic device, the device comprising:
the first obtaining module is used for obtaining first information sent by the stylus, 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 stylus 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;
a second obtaining module, configured to obtain third information sent by the stylus according to the second information, where the third information is obtained by performing encryption processing on a part of the at least two first parameters;
the authentication module is used for performing identity authentication on the stylus according to a first secret key and a second secret key, wherein the first secret key is generated according to the third information and the second information, and the second secret key is generated according to the first information and the second information;
and the first interaction module is used for interacting the 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 touch pen payment transaction information under the condition that the touch pen payment transaction information is determined to be in a safe transaction state according to the first secret key and the second secret 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;
the second sub-generation module is used for obtaining a second message digest according to the second secret key, the first transaction authentication information and the second transaction authentication information;
a determining submodule, configured to determine that the first message digest is in a secure transaction state if the first message digest matches the second message digest;
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 stylus, and the second transaction authentication information is transaction information confirmed by the electronic device.
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 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 apparatus according to claim 15, wherein the second information is obtained by performing asymmetric encryption processing 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 stylus is successful when the first secret key is matched with the second secret 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 generating 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 obtaining unit is used for obtaining fifth information obtained by the stylus according to the fourth information, the first secret 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, applied to a touch pen, 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;
a third sending module, configured to send third information to the electronic device, where the third information is obtained by performing encryption processing on a part of 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 secret key and a second secret key, where the first secret key is generated according to the third information and the second information, and the second secret key is generated according to the first information and the second information;
and the second interaction module is used for interacting the 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 a secure transaction state signal sent by the electronic equipment is received, wherein the secure transaction state signal is obtained according to the first secret key and the second secret key.
21. An electronic device comprising a processor, a memory, and a program or instructions stored on the memory and executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the information interaction method as claimed in any one of claims 1 to 8, or implementing the steps of the information interaction method as claimed in 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 implement 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 true CN112765628A (en) 2021-05-07
CN112765628B 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
王冠;李天亮;: "一种基于安全芯片的可信移动存储设备的双向认证机制", 计算机与应用化学, no. 05 *

Also Published As

Publication number Publication date
CN112765628B (en) 2023-12-22

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
US10567428B2 (en) Secure wireless ranging
EP3324572B1 (en) Information transmission method and mobile device
CN111028397B (en) Authentication method and device, and vehicle control method and device
US8792636B2 (en) Protocol for protecting content protection data
CN106611310B (en) Data processing method, wearable electronic device and system
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
WO2024139616A1 (en) Signature authentication method and apparatus
CN114419765A (en) Method and device for realizing vehicle safety control by NFC card and readable storage medium
CN106411520B (en) Method, device and system for processing virtual resource data
CN112003697A (en) Encryption and decryption method and device for cryptographic module, electronic equipment and computer storage medium
CN116244750A (en) Secret-related information maintenance method, device, equipment and storage medium
CN114221764A (en) Public key updating method, device and equipment based on block chain
CN114302367A (en) Certificate application method and device, electronic equipment and storage medium
US20240106633A1 (en) Account opening methods, systems, and apparatuses
JPH1139082A (en) Keyboard device having security function and method therefor
CN111818466B (en) Information sending and receiving method and device, electronic equipment and readable storage medium
CN113032753A (en) Identity verification method and device
JP2003037587A (en) Method for generating session key
CN113904830B (en) SPA authentication method, SPA authentication device, electronic equipment and readable storage medium
CN112765628B (en) Information interaction method and electronic equipment
CN112637169B (en) Passive NFC cloud lock encryption method
CN113193956A (en) Account information processing method and device

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