CN114244532A - Charging method and charging device of terminal - Google Patents
Charging method and charging device of terminal Download PDFInfo
- Publication number
- CN114244532A CN114244532A CN202111560928.1A CN202111560928A CN114244532A CN 114244532 A CN114244532 A CN 114244532A CN 202111560928 A CN202111560928 A CN 202111560928A CN 114244532 A CN114244532 A CN 114244532A
- Authority
- CN
- China
- Prior art keywords
- signature
- data
- terminal
- transformation
- information
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 142
- 230000009466 transformation Effects 0.000 claims abstract description 217
- 230000008569 process Effects 0.000 claims abstract description 70
- 238000006243 chemical reaction Methods 0.000 claims abstract description 34
- 238000012795 verification Methods 0.000 claims abstract description 25
- 230000002457 bidirectional effect Effects 0.000 claims abstract description 20
- 230000004044 response Effects 0.000 claims description 21
- 238000004590 computer program Methods 0.000 claims description 17
- 238000003860 storage Methods 0.000 claims description 12
- 230000001131 transforming effect Effects 0.000 claims description 10
- 230000002452 interceptive effect Effects 0.000 claims description 4
- 238000012163 sequencing technique Methods 0.000 claims description 3
- 238000007726 management method Methods 0.000 description 92
- 230000006870 function Effects 0.000 description 25
- 238000010586 diagram Methods 0.000 description 17
- 238000004422 calculation algorithm Methods 0.000 description 16
- 230000005540 biological transmission Effects 0.000 description 15
- 230000006855 networking Effects 0.000 description 11
- 238000012545 processing Methods 0.000 description 9
- 238000004364 calculation method Methods 0.000 description 6
- 230000006854 communication Effects 0.000 description 5
- 238000012544 monitoring process Methods 0.000 description 5
- 238000004891 communication Methods 0.000 description 4
- 230000003993 interaction Effects 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000004458 analytical method Methods 0.000 description 2
- 238000013501 data transformation Methods 0.000 description 2
- 238000009826 distribution Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000011218 segmentation Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 210000004556 brain Anatomy 0.000 description 1
- 238000013496 data integrity verification Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 230000009977 dual effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000001502 supplementing effect Effects 0.000 description 1
- 238000012549 training Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
- H04L9/3247—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/02—Details
- H04L12/14—Charging, metering or billing arrangements for data wireline or wireless communications
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention provides a charging method and a charging device of a terminal. Wherein, the method comprises the following steps: acquiring the cost information of the terminal; encrypting the expense information by using the symmetric key determined in the bidirectional authentication process with the terminal to obtain an expense ciphertext; generating signature data according to a private key of the management server; converting the signature data according to a signature conversion strategy to obtain signature conversion data; sending a notification message to the terminal; the notification message carries the expense ciphertext and the signature transformation data to indicate the terminal to decrypt the expense ciphertext, the signature transformation data is reversely transformed to obtain signature data, and the public key of the management server is applied to verify the signature data; and receiving the verification legal message fed back by the terminal, and charging the terminal according to the charge information. The invention realizes the safe and reasonable charging of the terminal and improves the network performance.
Description
Technical Field
The present invention relates to the field of network communication technologies, and in particular, to a charging method and a charging apparatus for a terminal.
Background
In an existing mobile network or internet, various services can be provided for a terminal user, for example, a real-time transmission service of a high-definition video, specifically, tens of services such as a high-definition video conference, video monitoring, remote training, intelligent monitoring and analysis, emergency command, video telephony, live broadcast, television mail, information distribution, and the like, such as a video, a voice, a picture, a text, a communication, a data, and the like.
The service provider needs to invest a large amount of labor and material cost to support the operation of the service, so that the safe and reasonable charging of the terminal is particularly important, in the charging process, the reasonability of the charging is ensured, the safety of related data in the charging process is also considered, and an effective solution is not provided at present aiming at the safe and reasonable charging of the terminal.
Disclosure of Invention
In view of this, an object of the present application is to provide a charging method and a charging apparatus for a terminal, so as to implement safe and reasonable charging of the terminal and improve network service performance.
In a first aspect, an embodiment of the present application provides a charging method for a terminal, which is applied to a management server, and includes: acquiring the cost information of the terminal; encrypting the expense information by using the symmetric key determined in the bidirectional authentication process with the terminal to obtain an expense ciphertext; generating signature data according to a private key of the management server; converting the signature data according to a signature conversion strategy to obtain signature conversion data; sending a notification message to the terminal; the notification message carries the expense ciphertext and the signature transformation data to indicate the terminal to decrypt the expense ciphertext, the signature transformation data is reversely transformed to obtain signature data, and the public key of the management server is applied to verify the signature data; and receiving the verification legal message fed back by the terminal, and charging the terminal according to the charge information.
With reference to the first aspect, an embodiment of the present application provides a first possible implementation manner of the first aspect, where the signature transformation policy includes a signature transformation equation; the method for transforming the signature data according to the signature transformation strategy to obtain the signature transformation data comprises the following steps: and calculating the signature data by applying a signature transformation equation to obtain the signature transformation data.
With reference to the first aspect, an embodiment of the present application provides a second possible implementation manner of the first aspect, where the signature transformation policy further includes a grouping manner; the step of calculating the signature data by applying a signature transformation equation to obtain the signature transformation data comprises the following steps: segmenting the signature data into a plurality of packet data; calculating each grouped data by applying a signature transformation equation to obtain transformation data respectively corresponding to each grouped data; and sequencing the transformation data respectively corresponding to each grouped data by applying a preset arrangement rule to obtain signature transformation data.
With reference to the first aspect, an embodiment of the present application provides a third possible implementation manner of the first aspect, where the signature transformation equation corresponds to packet data one to one; and calculating the grouped data by applying a signature transformation equation corresponding to each grouped data to obtain transformation data respectively corresponding to each grouped data.
With reference to the first aspect, an embodiment of the present application provides a fourth possible implementation manner of the first aspect, where the signature transformation policy further includes a preset constant value; the step of segmenting the signature data into a plurality of packet data, comprising: determining the number of groups corresponding to the signature data according to the length and the constant value of the signature data; segmenting the signature data into a plurality of packet data; wherein the number of packet data is equal to the number of groups.
With reference to the first aspect, an embodiment of the present application provides a fifth possible implementation manner of the first aspect, where the signature transformation policy is a policy determined this time; the notification message also carries a signature transformation strategy, so that the terminal transforms the signature transformation data according to the signature transformation strategy to obtain the signature data.
With reference to the first aspect, an embodiment of the present application provides a sixth possible implementation manner of the first aspect, where the terminal is configured with a security chip, and the security chip stores a public key, a symmetric key, and a signature transformation policy of the management server.
With reference to the first aspect, an embodiment of the present application provides a seventh possible implementation manner of the first aspect, where the method further includes: receiving network access authentication information sent by a terminal; the public key and the network access authentication information of the application terminal verify whether the terminal is legal or not; if the authentication response message is legal, sending the authentication response message to the terminal; the authentication response message carries signature certificate data of a ciphertext containing the symmetric key, so that the terminal verifies the identity of the management server based on the signature certificate data and obtains the symmetric key; the signature certificate data further includes: the second digital certificate and a certificate conversion signature of a certificate signature corresponding to the second digital certificate; the certificate transformation signature is obtained by transforming the certificate signature by applying a certificate transformation strategy, and the symmetric key is used for encrypting/decrypting the expense information in the interactive process.
With reference to the first aspect, an embodiment of the present application provides an eighth possible implementation manner of the first aspect, where the terminal is a video networking terminal, and the management server is a video networking server.
In a second aspect, an embodiment of the present application further provides a charging method for a terminal, where the method is applied to the terminal, and the method includes: receiving a notification message sent by a management server, wherein the notification message carries an expense ciphertext and signature transformation data; the cost ciphertext is obtained by encrypting the cost information of the terminal by using the symmetric key determined in the bidirectional authentication process, the signature transformation data is obtained by transforming the signature data by using a signature transformation strategy, and the signature data is generated according to the private key of the management server; decrypting the expense ciphertext by using the symmetric key, determining signature data by using a signature transformation strategy and the signature transformation data, and verifying the signature data by using a public key of the management server; and after the legality is verified, feeding back a verification legal message to the management server to indicate the management server to charge the terminal according to the charge information.
In a third aspect, an embodiment of the present application further provides a charging apparatus for a terminal, including: one or more processors; and one or more computer-readable storage media having instructions stored thereon, which, when executed by one or more processors, cause an apparatus to perform a charging method for a terminal as in the first aspect described above and/or a charging method for a terminal as in the second aspect described above.
In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the charging method for the terminal in the first aspect and/or the charging method for the terminal in the second aspect.
The embodiment of the application brings the following beneficial effects:
the charging method and the charging device of the terminal provided by the embodiment of the application apply the symmetric key determined in the bidirectional authentication process to encrypt the charge information, ensure the safety of the charge information transmission process, generate the signature data according to the private key of the management server, convert the signature data according to the signature conversion strategy to obtain the signature conversion data, send the notification message containing the charge ciphertext and the signature conversion data to the terminal, enable the terminal to decrypt the charge ciphertext based on the notification message and reversely convert to obtain the signature data, further verify the legality of the signature data, ensure the validity of the data, enhance the safety of information transmission, effectively relieve the problem of malicious information tampering, timely and effectively transmit the charge information of the terminal to the terminal on the basis, perform charging after the terminal verifies the legality of the information, and enhance the fair rationality of the charging, is suitable for practical application and effectively improves the performance of network service.
Additional features and advantages of the disclosure will be set forth in the description which follows, or in part may be learned by the practice of the above-described techniques of the disclosure, or may be learned by practice of the disclosure.
In order to make the aforementioned objects, features and advantages of the present disclosure more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application;
fig. 2 is a flowchart of a charging method for a terminal according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a mutual authentication process according to an embodiment of the present application;
fig. 4 is a flowchart of another charging method for a terminal according to an embodiment of the present application;
fig. 5 is a schematic diagram of a charging system of a terminal according to an embodiment of the present application;
fig. 6 is a flowchart illustrating a charging method for a terminal according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a charging apparatus of a terminal according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of another charging apparatus for a terminal according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of another charging apparatus for a terminal according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some, but not all embodiments of the present invention. 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 invention.
The charging method and the charging device for the terminal can realize safe and reasonable charging of the terminal in a mobile network, an internet network and a video network.
Fig. 1 is a schematic diagram of an implementation environment according to an embodiment of the present application. In fig. 1, a server may be communicatively connected to a plurality of terminals (including: terminal 1 to terminal N), and each terminal may use various services provided by a network through the server, such as: high definition Video conferencing, Video monitoring, intelligent monitoring analysis, emergency command, digital broadcast television, time delay television, network teaching, live broadcasting, VOD (Video On Demand service), television mail, Personal Video Recorder (PVR), intranet (self-made) channel, intelligent Video broadcast control, information distribution, and the like. The server may be a management server in the video network, such as a network management server, a conference management server, an autonomous server, a core switching server, and the like. Taking the terminal as a video network terminal in the video network as an example, the video network terminal may be a device at the user side, such as various conference set-top boxes, video phone set-top boxes, surgical trial set-top boxes, streaming media gateways, storage gateways, media synthesizers, and so on.
Fig. 2 is a flowchart of a charging method for a terminal according to an embodiment of the present application, where the method is applied to a management server, and referring to fig. 2, the method includes steps S201 to S205:
step S201, acquiring the fee information of the terminal.
In this step, the management server may obtain the cost information of the terminal from various channels, taking the cost information as the recharging related information as an example, the management server may obtain the recharging information from the network server, and may also obtain the recharging information of the user from a third party server with a payment function, where the third party server may be a bank server, a payment bank, a WeChat, or other server.
The fee information may include charging information, billing information, balance information, and the like.
And S202, encrypting the expense information by using the symmetric key determined in the bidirectional authentication process with the terminal to obtain an expense ciphertext.
In order to enhance the security, in the network access process, the terminal performs bidirectional authentication with the management server, and in the bidirectional authentication process, besides mutually verifying whether the identity of the opposite terminal is legal, a symmetric key used in the subsequent communication process is also determined. The symmetric key specifically refers to a key used when a symmetric encryption/decryption algorithm encrypts or decrypts data, and the symmetric key in this embodiment is mainly used for encrypting the cost information.
The algorithm used for encryption of the fee information may be any symmetric encryption algorithm, such as the SM4 algorithm or the SM7 algorithm.
In step S203, signature data is generated from the private key of the management server.
In order to ensure the integrity of the information, the embodiment adopts a private key signature mode, and generates signature data according to the private key of the management server. As a possible embodiment, the specific generation manner of the signature data may include: the management server generates a random number, the random number and the identification information of the terminal form plaintext information, the plaintext information is encrypted by a private key of the management server to obtain a hash value, and the hash value is signature data. Of course, there may be other ways to generate the signature data, which is not limited in this embodiment of the present application.
Step S204: converting the signature data according to a signature conversion strategy to obtain signature conversion data;
the signature data is plaintext data, and in order to avoid data tampering in the data transmission process and information loss in the signature data, the signature data needs to be transformed according to a certain transformation strategy before being transmitted, so that effective transmission and safety of the information are guaranteed. In the embodiment of the application, the signature data is transformed according to a signature transformation policy, wherein the signature transformation policy is a data transformation mode, and for example, the signature transformation policy may be a signature transformation equation, a data grouping mode of the signature data, or a data transformation model.
In a specific application process, the same signature transformation policy may be used for the same management server and the same terminal all the time, for example, a signature transformation policy may be predetermined and set in a software program or a security chip in the management server and the terminal.
In other examples, in order to further improve the security of data transmission, a signature transformation policy may be determined again for each charging process, and the management server sends the signature transformation policy before or while sending the signature data to the terminal, so that after the terminal obtains the signature transformation data, the terminal may restore the transformed signature transformation data to the signature data according to the current signature transformation policy, thereby obtaining the relevant information in the signature data.
Step S205, a notification message is sent to the terminal.
The notification message carries the expense ciphertext and the signature transformation data to indicate the terminal to decrypt the expense ciphertext, the signature data is obtained through reverse transformation of the signature transformation data, and the public key of the management server is applied to verify the signature data.
And after the terminal obtains the notification message, the terminal starts to verify the validity of the signature data, wherein the verification process is a reverse transformation process, the signature data is obtained by using the reverse transformation of the signature transformation strategy, and the signature data is further verified. Therefore, the notification message includes the fee ciphertext and the signature transformation data, and in order to perform inverse transformation on the signature transformation data to obtain the signature data, the terminal needs to first acquire the signature transformation policy, and then follows several acquisition manners of the signature transformation policy in step S204.
Further, the process of verifying the signature data may specifically include: decrypting the signature data through a public key of the management server, if the information obtained by decryption is consistent with the plaintext information, indicating that the notification message is sent by the management server and is not tampered in the transmission process, verifying the validity, and feeding back a verified valid message; and if the information obtained by decryption is inconsistent with the plaintext information or the decryption fails, the authentication is illegal, and an authentication failure message is fed back to the management server.
The plaintext information may be the plaintext information in the signature data generated in step S203, and it continues to use the random number and the identification information of the terminal to form the plaintext information as an example, at this time, the random number may be carried in the notification message, so that the terminal forms the plaintext information by using the random number and the identification information of the terminal, and the verification process is implemented. Alternatively, the plaintext information may not include the random number, and the terminal side may obtain the plaintext information as the identification information of the management server and/or the identification information of the terminal.
After the terminal verifies that the signature data is legal, the terminal can update the own expense information according to the decrypted expense information.
Step S206, receiving the verification legal message fed back by the terminal, and charging the terminal according to the fee information.
In the charging process, the charging mode can be determined according to the specific type of the charge information. For example: and if the charge information is the recharging information, increasing the total charge information of the terminal, and charging based on the new total charge information and the service used by the terminal. If the fee information is fee deduction information according to the service used by the terminal, the fee is deducted directly on the basis of the current balance of the terminal.
In the charging method, the charge information is encrypted by using the symmetric key determined in the bidirectional authentication process, the safety of the charge information transmission process is ensured, the signature data is generated according to the private key of the management server, the signature data is converted according to the signature conversion strategy to obtain the signature conversion data, the notification message containing the charge ciphertext and the signature conversion data is sent to the terminal, the terminal can decrypt the charge ciphertext based on the notification message and reversely convert to obtain the signature data, the legality of the signature data is verified, the validity of the data is ensured, the safety of information transmission is enhanced, the problem of malicious information tampering is effectively solved, the charge information of the terminal can be timely and effectively transmitted to the terminal based on the notification message, the charging is carried out after the terminal verifies the legality of the information, the rationality and fairness of the charging are enhanced, and the charging method is suitable for practical application, the performance of the network service is effectively improved.
The following is a detailed description of the process of transforming signature data into signature transformation data according to a signature transformation policy:
in some examples, the signature transformation policy includes a signature transformation equation, and based on this, the step of transforming the signature data according to the signature transformation policy to obtain the signature transformation data specifically includes: and calculating the signature data by applying a signature transformation equation to obtain the signature transformation data. The signature transformation equation may be a linear equation or a nonlinear equation in which the signature data is an argument and the signature transformation data is a dependent variable, and may be in the form of y ═ f (x), where y is the signature transformation data and x is the signature data, and the specific form of the signature transformation equation is not limited in this embodiment.
As a possible implementation manner, the signature transformation policy may further include a grouping manner, and the process of obtaining the signature transformation data by calculating the signature data by applying the signature transformation equation may be implemented according to the following method:
(1) segmenting the signature data into a plurality of packet data;
the specific segmentation mode may be to divide the data equally according to the size of the signature data, or to group the data according to a preset segmentation rule. In some possible embodiments, the signature transformation policy further includes a preset constant value; the step of segmenting the signature data into a plurality of packet data specifically includes: determining the number of groups corresponding to the signature data according to the length and the constant value of the signature data; segmenting the signature data into a plurality of packet data; wherein the number of the grouped data is equal to the number of the groups.
As an alternative implementation, the constant value may be selected to be an even number smaller than the length of the signature data, for example, 2, 4, 6, etc., the unit of the constant value may be a byte, and the signature data may be data represented by binary or 16-ary, etc. If the length of the signature data cannot be divided by the constant value, the remainder is discarded. Taking the example that the signature data 010303F 232326474040507 FF 03 in 16 bytes is 4 bytes and the constant value predetermined by the correlation server and the terminal is 4 bytes, since one byte is 2 characters in 16 bytes, 4 bytes correspond to 8 characters in 16 bytes, while the signature data has a length of 26 characters, 26% 8 being 3 and 2, the last two characters are discarded, and the signature data is divided into first packet data 010303F2, second packet data 32326474, and third packet data 040507FF by the constant value of 4 bytes.
(2) Calculating each grouped data by applying a signature transformation equation to obtain transformation data respectively corresponding to each grouped data;
dividing the signature data into a plurality of grouped data according to a constant value predetermined by the terminal, and calculating each grouped data by applying the signature transformation equation of this time to obtain transformation data corresponding to each grouped data respectively;
for improving the security, the above signature transformation equation may be transformed once every time or every set number of times, that is, the signature transformation equation used for each message interaction may not be the same. The signature transformation equation may be a linear equation, for example, x +40 ═ y, where x is a 10-ary value corresponding to the packet data, and y is a signature transformation value corresponding to the packet data. The embodiment of the invention does not limit the specific form of the signature transformation equation, and can be flexibly selected according to the requirement in practical application.
In some possible embodiments, the signature transformation equations correspond to the packet data one to one, and for each packet data, the signature transformation equation corresponding to each packet data is applied to calculate the packet data, so as to obtain transformation data corresponding to each packet data.
For example, the signature data is grouped into 3 groups of data, which are a first group, a second group and a third group, and then the packet data is calculated by using the signature transformation equation corresponding to the packet data for each group of data to obtain transformed data, where the signature transformation equations corresponding to the respective groups of data may be the same or different, for example, the first group and the second group may share one first signature transformation equation, the third group uses a second signature transformation equation, or the first group uses a first signature transformation equation, the second group uses a second signature transformation equation, and the third group uses a third signature transformation equation.
(3) And sequencing the transformation data respectively corresponding to each grouped data by applying a preset arrangement rule to obtain signature transformation data.
For example, the conversion data corresponding to each packet data may be sequentially connected based on the precedence order among the packet data. Continuing with the previous example, assuming the signature transformation equation is x-45 ═ y, then: firstly, 010303F2 in 16-ary format is converted into 10-ary format, the original value of the first packet data is 16974834, and the signature conversion value of the first packet data is 16974834-45-16974789 by applying x-45-y conversion, and in the same way, the signature conversion value of the second packet data is 842163316-45-842463271, and the signature conversion value of the third packet data is 67438591-45-67438546. And converting the 10-system signature conversion value into a 16-system format, if the 16-system is less than 4 bytes, supplementing 0, first packet data 16974789 → 010303C5, second packet data 842463271 → 3236F827 and third packet data 67438546 → 040507D2, and sequentially connecting the obtained packet data conversion data and the discarded last two characters 03 to obtain 010303C53236F827040507D203, namely the signature conversion data carried in the notification message.
In the embodiment of the application, the signature data is divided into a plurality of grouped data according to a constant value predetermined by the network terminal, and each grouped data is calculated by applying the signature transformation equation of this time to obtain transformation data corresponding to each grouped data; the conversion data corresponding to each packet data is sequenced by applying a preset arrangement rule to obtain signature conversion data, the packet data can be inversely calculated by the terminal based on the signature conversion data and the current signature conversion equation, the signature data is further obtained, the validity of the signature data is verified, and the integrity of information is further ensured.
In order to improve the security and reasonableness of charging, the terminal in the embodiment of the present application may be configured with a security chip, the security chip is issued to a user by a network service provider, and the security chip stores a public key of a management server, the symmetric key, and the signature transformation policy. Meanwhile, a preset encryption/decryption algorithm and related key information can be stored in the security chip, the security chip can participate in information interaction between the network terminal and the server to enhance the security of the information interaction, based on the information, the fee ciphertext can be decrypted by the security chip of the terminal and the signature data can be verified based on a predetermined constant value, so that the use security of the equipment can be further enhanced, and the problem of malicious tampering of the equipment information can be effectively solved.
In some possible embodiments, the signature transformation policy is determined at this time, that is, the signature transformation policy may be updated as needed each time a message is sent, and based on this, the notification message further carries the signature transformation policy, so that the terminal transforms the signature transformation data according to the signature transformation policy to obtain the signature data.
The determined strategy is a signature transformation strategy determined for the terminal charging process, the signature transformation strategy is sent to the terminal through the notification message, network resource waste caused by multiple data transmission can be avoided, the signature transformation strategies used in the terminal charging process are different every time, information security risks caused by malicious acquisition and decryption of the previous signature transformation strategies are avoided, and the security of data transmission is further improved.
In other examples, the notification message may be: the fee ciphertext, the signature data, the packet data, the signature transformation data, and the signature transformation equation are carried. The terminal is provided with a security chip, the security chip stores the constant value, the public key of the management server and the symmetric key so as to indicate the terminal to decrypt the cost ciphertext through the security chip, and the public key of the management server is applied to verify the signature data after the validity of the grouped data is determined through the reverse calculation of the signature transformation data and the signature transformation equation.
The notification message may carry plaintext information corresponding to the signature data, in addition to the fee ciphertext, the signature data, the packet data, the signature transformation data, and the signature transformation equation. The plaintext information may include identification information of the terminal, such as a Media Access Control (MAC) address of the terminal or a network number of a user corresponding to the terminal. The plaintext information may further include a random number, and different messages may be distinguished by introducing the random number, so that plaintext information of different messages is different.
The terminal decrypts the cost ciphertext through the security chip, divides the signature transformation data through a constant value in the security chip to obtain a plurality of grouped data of the signature transformation data, reversely calculates a calculated value corresponding to each grouped data by using a signature transformation equation, converts the calculated value into a data form of the same type as the signature data, compares the data obtained after conversion of each calculated value with the grouped data carried in the notification message, if the calculated values are the same, the grouped data carried in the notification message is valid, and the notification message is complete, otherwise, the grouped data carried in the notification message is invalid, and the notification message is possibly tampered. Meanwhile, the constant value is stored in the security chip of the legal terminal, so that the illegal terminal is further prevented from decoding the notification message.
To further clarify the above inverse calculation process of the terminal application constant value and the signature transformation equation, continuing with the previous example, assume: the notification message includes data (010303F 232326474040507 FF) composed of the first packet data, the second packet data, and the third packet data: the equation x-45 ═ y, signs the transformed data (i.e., 010303C53236F827040507D 203). The terminal groups the signature transformation data by applying a constant value, and first packet data 010303C5(16 system) → 16974789(10 system), second packet data 3236F827(16 system) → 842463271(10 system), and third packet data 040507D2(16 system) → 67438546(10 system) are obtained. The terminal deduces x-y +45 by using a transformation equation x-45-y, reversely deduces the original value of each group number by using the formula to obtain a first group 16974834, a second group 842163316 and a third group 67438591, and the original value is expressed as 010303F 232326474040507 FF by using a 16-system, and the last byte 03 is directly spliced behind the 010303F 232326474040507 FF to obtain original data 010303F 232326474040507 FF 03 because the number of the groups participating in the operation is three.
As a possible implementation manner, the notification message may carry packet data and signature data, and if the number of groups of the original data obtained by the terminal inverse operation is consistent with the number of groups of the packet data carried in the notification message and the original data is consistent with the signature data in the notification message, it is indicated that the notification message is complete, and the subsequent processing is continued.
The process of verifying the signature data may include: decrypting the signature data through a public key of the management server, if the information obtained by decryption is consistent with the plaintext information, indicating that the notification message is sent by the management server and is not tampered in the transmission process, verifying the validity, and feeding back a verified valid message; and if the information obtained by decryption is inconsistent with the plaintext information or the decryption fails, the authentication is illegal, and an authentication failure message is fed back to the management server.
In order to improve the value added service of the network, the charging mode in the network can adopt various forms, for example: the charging can be according to the flowrate, can be monthly or pack year charging, can charge according to the interval, etc.. Based on this, the acquisition mode of the fee information may include at least one of the following: (1) generating cost information of the terminal according to the recharging information corresponding to the terminal; (2) generating cost information of the terminal according to the used flow corresponding to the terminal; (3) and generating the expense information of the terminal according to the used time length corresponding to the terminal. By the method for acquiring the charge information, different application scenes can be met, and the usability of the charging method is improved.
Taking a traffic charging method as an example, the step of generating the charge information of the terminal according to the used traffic corresponding to the terminal may include: acquiring the used flow of a terminal; and multiplying the unit flow price by the used flow to obtain the cost information of the terminal. The specific formula can be expressed as: the remaining amount is the total amount-unit flow rate unit price x used data flow rate. For example, the traffic that the terminal has used in a specified time period is 500M. And the price of unit flow in the network is 0.1 yuan/M, if the total amount of the terminal is 100 yuan, then currently, the charge information of the terminal (i.e. the remaining amount of the terminal) is: 100-0.1 × 500 ═ 50 yuan.
The user can be pre-charged in the flow charging mode, the pre-charge is used as the total amount of the terminal, the residual amount is updated according to the flow used by the terminal, and if the residual amount is smaller than the set threshold value, the notification message can be sent to remind the terminal to recharge.
For the charging and consumption cost information, the step of charging the terminal according to the cost information may include the following steps:
(1) updating the balance of the terminal by applying the expense information; wherein, the expense information is the recharging amount or the consumed amount.
For example, if the user adds 100 yuan to the terminal, the fee information is the added 100 yuan, the management server searches the record corresponding to the terminal in the database, adds 100 yuan to the balance, for example, if the current balance is 30 yuan, then the updated balance is 130 yuan.
(2) And encrypting the balance by using the symmetric key to obtain a balance ciphertext.
(3) And sending a prompt message containing the balance ciphertext to the terminal to instruct the terminal to decrypt the balance ciphertext by using the symmetric key and display the balance. By the charging mode, the balance of the terminal can be updated in time, and the updated balance can be sent to the terminal in a ciphertext mode, so that a user can know the latest balance information in time, and the charging rationality is improved.
In order to enhance the security of the network, the embodiment of the present application further provides a mutual authentication policy based on the above method, see a flow diagram of a mutual authentication process shown in fig. 3, where the mutual authentication process is described as an example from the management server side, and specifically includes the following steps S301 to S304:
step S301, receiving the network access authentication information sent by the terminal.
The network access authentication information may include: a certificate serial number and a first random number ciphertext of a first digital certificate (namely, a digital certificate of a terminal); the generation process of the first random number ciphertext comprises the following steps: and the security chip of the terminal generates a first random number, and then encrypts the first random number by using a private key of the terminal to obtain a first random number ciphertext.
Step S302, the public key of the terminal and the network access authentication information are applied to verify whether the terminal is legal; if yes, go to step S303; if not, step S304 is performed.
As a possible implementation, the step of verifying whether the terminal is legal may include the steps of:
(1) and acquiring the first digital certificate of the terminal according to the certificate serial number of the first digital certificate.
Generally, a database on the management server side of the network stores digital certificates of each terminal, and the digital certificates are queried in the database by using the certificate serial numbers to obtain corresponding digital certificates. If the digital certificate corresponding to the certificate serial number is not checked, a certificate acquisition request message can be sent to the terminal, and the terminal provides the digital certificate according to the request message.
(2) Decrypting the first random number ciphertext by using the public key in the first digital certificate; and if the decryption is successful, determining that the terminal is legal. And if the decryption fails, determining that the terminal is illegal.
Step S303, sending an authentication response message to the terminal; the authentication response message carries signature certificate data of a ciphertext containing the symmetric key, so that the terminal verifies the identity of the management server based on the signature certificate data and obtains the symmetric key; the signature certificate data further includes: the second digital certificate and the certificate conversion signature of the certificate signature corresponding to the second digital certificate are obtained by converting the certificate signature by applying a certificate conversion strategy, and the symmetric key is used for encrypting/decrypting the cost information in the interactive process.
The transmitting of the authentication response message to the terminal may include: (1) acquiring a second digital certificate (namely the digital certificate of the management server) and a certificate signature of the second digital certificate from the certificate server; the certificate server calculates the information digest of the second digital certificate by using a preset hash function, and encrypts the information digest by using a private key of the certificate server to obtain a certificate signature; (2) encrypting the second random number by using a private key of the management server to obtain a second random number ciphertext; encrypting the symmetric key by using a private key of the management server to obtain a ciphertext of the symmetric key; (3) dividing the certificate signature into a plurality of signature transformation group numbers according to the constant value, and calculating each signature transformation group number by applying a preset signature transformation equation to obtain a signature transformation value corresponding to each signature transformation group number; determining a certificate transformation signature according to data obtained by connecting signature transformation values respectively corresponding to each grouped data; (4) sending an authentication response message to the terminal, wherein the authentication response message carries signature certificate data, and the signature certificate data comprises: the system comprises a second digital certificate, a certificate signature, a second random number ciphertext, a symmetric key ciphertext, a signature transformation group number, a certificate transformation signature and a signature transformation equation.
Step S304, sending authentication failure information to the terminal.
Through the bidirectional authentication process, the symmetric key can be sent to the terminal in a ciphertext mode on the basis of verifying the identities of the two parties, so that the sending safety of the symmetric key is ensured, and a safety basis is provided for message interaction in the subsequent charging process.
Fig. 4 is a flowchart of another charging method for a terminal, which is applied to the terminal and includes steps S401 to S403:
step S401, receiving a notification message sent by the management server.
The notification message carries a cost ciphertext and signature transformation data, the cost ciphertext is obtained by applying the cost information of the symmetric key encryption terminal determined in the bidirectional authentication process, the signature transformation data is obtained by applying a signature transformation strategy to transform the signature data, and the signature data is generated according to a private key of the management server.
In some examples, the notification message further carries packet data corresponding to the signature data, signature transformation data, and a signature transformation equation; the charge ciphertext is obtained by encrypting the charge information of the network terminal by using a symmetric key determined in the bidirectional authentication process, the signature data is generated according to a private key of the management server, and the signature transformation data is obtained by calculating packet data corresponding to the signature data by using a signature transformation equation.
Step S402: and decrypting the expense ciphertext by using the symmetric key, determining signature data by using a signature transformation strategy and the signature transformation data, and verifying the signature data by using a public key of the management server.
As a possible implementation manner, the terminal in this embodiment may be configured with a security chip, where the security chip is issued to the user by a network service provider, and the security chip stores a public key of the management server, the symmetric key, and the signature transformation policy. Meanwhile, the security chip can also store a preset encryption/decryption algorithm and related key information. The security chip can be integrated in the network terminal and used for performing operations such as authentication, encryption and decryption. In some embodiments, the security chip may be an ESAM (Embedded Secure Access Module), or may be another chip having an information security processing function, which is not limited herein in this embodiment of the present application.
Step S403, after the validity is verified, feeding back a verification validity message to the management server to instruct the management server to charge the terminal according to the charge information.
In the charging method, the charge ciphertext included in the notification message is obtained by encrypting the plaintext of the charge information by using the symmetric key determined in the bidirectional authentication process, and the signature data is generated according to the private key of the management server. The method comprises the steps of decrypting the charge ciphertext through the symmetric key of the terminal, determining the signature data by applying the signature transformation strategy and the signature transformation data, and finally verifying the signature data by applying the public key of the management server, so that the use safety of the equipment is enhanced, the problem of malicious tampering of the equipment information is effectively solved, the fair and reasonable charging of the network terminal is improved, the method is suitable for practical application, and the performance of network service is effectively improved.
In some embodiments, the process of verifying the signature data by the public key of the application management server includes:
(1) and calculating the notification message by applying a preset hash function to obtain a first information digest.
In this embodiment, the notification message includes a fee ciphertext and signature data, where the signature data may include a second digital certificate of the management server and a certificate signature, and the certificate signature may be calculated by the management server through a preset hash function on plaintext information of the second digital certificate to obtain digest information, and the digest information is encrypted by using a private key of the management server to obtain the certificate signature.
Corresponding to the process of generating the certificate signature, the terminal performs the hash function calculation process which is the same as that of the certificate server on the plaintext information of the second digital certificate in the notification message to obtain a first information digest.
Of course, the notification message may also include message plaintext information, which may be a random number and an identifier of the terminal, and may also include an identifier of the management server. The signature data may be obtained by signing a message plaintext by using a private key of the application management server, and the signing process may include the hash function calculation process and the private key encryption digest information process, which are not described herein again. Correspondingly, the terminal can apply the hash function calculation process to calculate the message plaintext in the notification message to obtain the first information digest. The method does not need to send the notification message every time, and the second digital certificate is carried, so that the realization is more flexible.
(2) And decrypting the signature data by using the public key of the management server to obtain a second information abstract.
Since the signature data in the notification message is obtained by encrypting the signature data by using the private key of the management server, the terminal decrypts the signature data by using the public key of the management server to obtain the second information digest.
(3) And comparing whether the first information abstract and the second information abstract are consistent.
(4) And if the signature data are consistent, verifying that the signature data are legal.
If the message sending end is a legal management server, the first information abstract and the second information abstract obtained in the same way are the same, so in the step, whether the first information abstract and the second information abstract are consistent or not is compared, if so, the received signature data is legal, otherwise, the signature data is illegal, the management server is not a legal server, and in this case, the terminal can discard the notification message or feed back a message of failed verification to the management server.
After the terminal verifies that the signature data is legal, the log of the verification process can be recorded in the security chip, and the cost in the security chip is updated according to the decrypted cost information.
As a possible implementation manner, the terminal may also monitor the traffic usage of itself, update the cost in the security chip according to the monitoring result, or report the monitored traffic usage or the updated cost to the management server, and during the reporting process, the symmetric key may be used to encrypt the key information (e.g., the cost information).
Fig. 5 is a schematic diagram of a charging system of a terminal according to an embodiment of the present application, where the system may be used to implement a charging method and an apparatus of a terminal according to the embodiment of the present invention, and the system only uses the terminal as a network terminal, and the management server is a network server in a network as an example, to describe an example of implementing the charging method and the apparatus of the terminal.
The charging system shown in fig. 5 includes an Operation and Maintenance Center (OMC), one or more video network terminals (e.g., video network terminal 1 to video network terminal N in the figure), the OMC is connected to a certificate server and a key management server, the OMC is connected to a PCI (Peripheral Component Interconnect Express) cryptographic firmware through an intermediary (e.g., API), and the intermediary may be a hardware device such as a slot. It should be noted that the components and structure of the billing system shown in fig. 5 are exemplary only, and not limiting, and that the electronic system may have other components and structures as desired.
(1) The certificate server is used for issuing digital certificates to the OMC and each video network terminal, and the digital certificates contain public keys of receivers and information related to issuers, validity periods of the certificates and the like.
(2) After obtaining the digital certificate, the OMC stores the digital certificate in the PCI password firmware for reading and using the information in the digital certificate at any time.
The PCI password firmware in the embodiment of the application applies a high-speed serial point-to-point double-channel high-bandwidth transmission technology, supports SM1, SM2, SM3, SM4 and SM7 cryptographic algorithms and a hardware password card generated by hardware true random numbers, has a data encryption/decryption processing function, provides functions of identity authentication, digital signature, data integrity verification and the like, has a safe and effective key management function and an equipment management function, and can provide safe and effective key protection measures.
The embodiment of the application applies the PCI password firmware to the OMC, provides services such as key management, encryption and decryption, signature verification and the like for various services with safety requirements, such as OMC safe login, encrypted storage and the like, and improves the safety of the OMC.
The OMC in this embodiment is a core device of the video network, can implement operations such as the opening of a video network service, terminal registration, and the like, and is a "brain" of the video network. The OMC can obtain a public key and a private key of the OMC from a key server when the OMC initializes the equipment, the public key and the private key are paired asymmetric keys, a ciphertext obtained by encrypting the public key can only be decrypted by using the corresponding private key, and similarly, the ciphertext obtained by encrypting the private key can only be decrypted by using the corresponding public key. The public key of the OMC may be issued to each of the video networking terminals in advance, while the private key of the OMC is stored in the PCI password firmware.
(3) The key management server is used for storing asymmetric keys and symmetric keys used for encryption/decryption. For example: when the OMC is started, the private key of the OMC is backed up to prevent the private key from being lost, and meanwhile, the OMC can also obtain related data for protecting the key from the key management server.
(4) The terminal of the video network is connected with the security chip through middleware (such as an API (Application Programming Interface)), and the charging system in this embodiment includes a terminal 1 of the video network, terminals 2 and … … of the video network, and a terminal N of the video network; the security chip may be an ESAM chip. The ESAM chip is an embedded security control module, and specifically may be a DIP (Dual In-line Package) or SOP (Small Outline Package or integrated circuit Package) chip, and may store a recharge amount, a consumption amount, and other important parameters or log information, and meanwhile, the chip also has an identity recognition function, and may perform bidirectional identity authentication with an external device.
The information of each video network terminal can be stored in a database, for example, the serial number of the certificate corresponding to the video network terminal, the identification information of the video network terminal, the balance information of the video network terminal, and the like. The video network terminal completes the registration and the mutual authentication process through the security chip, and then the service in the video network can be applied.
For example, the devices in the charging system may be integrally arranged or dispersedly arranged according to needs.
Taking the charging system shown in fig. 5 as an example, before performing the charging of the video network terminal, the video network terminal needs to access the network, and the network access process includes the following steps:
first, OMC initializes PCI password firmware.
The OMC performs the following operations on the PCIE password firmware through the middleware: (1) open the card (i.e., establish a connection with the PCI password firmware through middleware); (2) logging in PCI password firmware; (3) inputting a PIN code of the PCI password firmware (the PIN code is typically an initial password); (4) a key (e.g., a session key) distributed to the PCI cryptographic firmware is applied from the key management server and stored in the PCI cryptographic firmware. (5) And the OMC certificate-removing server applies for a second digital certificate of itself, wherein the certificate contains the public key and the certificate signature of the OMC.
The second digital certificate is a digital certificate issued by a Certificate Authority (CA). The content comprises the following steps: information of the certificate server, the OMC's public key, the certificate signature and the validity period. The certificate signature of the second digital certificate is: and calculating the plaintext information of the second digital certificate by using a hash function to obtain an information abstract, and encrypting the information abstract by using a private key of the certificate server, wherein the encrypted ciphertext is the certificate signature.
This initialization corresponds to the application software calling the hardware level information of the PCI cryptographic firmware.
And secondly, initializing an ESAM chip by the video networking terminal.
The initialization process may include the video networking terminal establishing a connection with the ESAM chip through middleware and logging in to the ESAM chip. The ESAM chip prestores a public key of a certificate server, a private key of a video network terminal and a digital certificate, namely a first digital certificate.
Thirdly, the video network terminal reads the local digital certificate, calls the middleware of the ESAM chip to acquire information such as a first random number, and encrypts the first random number by using an SM2 encryption algorithm and a private key of the video network terminal to obtain a first random number ciphertext. And sending network access authentication information to the OMC through the video network communication channel, wherein the information can comprise a first random number ciphertext and an OMC ID, a video network terminal ID (such as a MAC address), a certificate serial number of a digital certificate of the video network terminal, a first random number and the like.
Fourthly, after receiving the network access authentication information of the video network terminal, the OMC can send the network access authentication information to the PCI password firmware, and the PCI password firmware judges whether to send a certificate acquisition request message to the video network terminal based on the certificate serial number; the specific judgment process may include: and checking whether the locally stored digital certificate has the serial number of the video network terminal by using the video network terminal ID, if so, checking whether the serial number of the digital certificate is consistent with the certificate serial number in the network access authentication information, if so, directly taking out the public key of the video network terminal from the digital certificate without requiring the digital certificate to the video network terminal. In the embodiment of the present application, the digital certificate is in plaintext, and the serial number is also in plaintext.
And if the PCI password firmware judges that the digital certificate needs to be acquired from the video networking terminal, sending a request message to the video networking terminal. After receiving the digital certificate of the video network terminal, whether the digital certificate is legal or not can be verified according to the certificate signature, and if the digital certificate is legal, the public key data is taken out from the digital certificate of the video network terminal.
And fifthly, the OMC decrypts the first random number ciphertext by using the public key of the video networking terminal and an SM2 decryption algorithm, and determines that the video networking terminal is legal after the first random number is obtained through decryption. The OMC generates a second random number through PCI password firmware, and encrypts the second random number by using a private key of the OMC and an SM2 encryption algorithm to obtain a second random number ciphertext; encrypting a symmetric key (a key corresponding to an SM7 algorithm) by using a private key of the OMC and an SM3 encryption algorithm to obtain a first ciphertext, dividing a certificate signature of a second digital certificate (a digital certificate of the OMC) into a plurality of signature transformation group numbers according to a constant value predetermined by the video network terminal, and calculating each signature transformation group number by using a preset signature transformation equation to obtain a signature transformation value corresponding to each signature transformation group number; sequentially connecting the signature transformation values corresponding to the signature transformation group numbers respectively to obtain certificate transformation signatures; sending an authentication response message carrying signature certificate data to a video network terminal, wherein the signature certificate data comprises an OMC ID, a second digital certificate (OMC digital certificate), a certificate signature, a first ciphertext, a second random number ciphertext, the signature transformation group number, the certificate transformation signature and a signature transformation equation;
the information in the authentication response message is shown in table 1:
TABLE 1
And sixthly, after receiving the authentication response message, the video network terminal transmits the signature certificate data to a security chip, the security chip firstly verifies the integrity of the authentication response message of the OMC, the original value of each group of numbers is reversely deduced by the constant value (in the security chip), the signature transformation value and the signature transformation equation in the verification process, then the original value of the 10 system is converted into the 16 system to obtain the 16 system value of each group of numbers, if the original value is consistent with the value carried by the authentication response message, the authentication response message is complete, the plaintext information of the second digital certificate is read, and the same hash function is adopted to calculate to obtain an information digest (hash is used for verifying and preventing the content from being modified). Then, decrypting the certificate signature by using the public key of the certificate server (because the signature is encrypted by using the private key of the certificate server), comparing whether the information digest obtained by calculation is consistent with the information digest obtained by decryption, if so, proving that the second digital certificate is authentic, taking out the OMC public key from the second digital certificate, and decrypting the first ciphertext by using the OMC public key and an SM3 decryption algorithm to obtain a symmetric key; and the security chip decrypts the second random number ciphertext by using the OMC public key and the SM2 decryption algorithm to obtain a second random number, and confirms that the OMC is legal.
Through the process from the first step to the sixth step, the video network terminal and the OMC complete the bidirectional authentication, the video network terminal completes the network access operation, the service in the video network can be applied, and the charging of the video network terminal is related to the process of applying the service. Taking the charging system shown in fig. 5 as an example, the embodiment of the present application further provides a flowchart of the charging method for the video network terminal shown in fig. 6, where the method mainly describes a process of charging the video network terminal in a charging scenario, and the method includes the following steps:
step S601, OMC generates the charge information of the video network terminal according to the charge information corresponding to the video network terminal.
In this embodiment, it is described that a user of a video network terminal charges through a bank as an example, the user may perform a charging operation through a bank app on an intelligent terminal such as a mobile phone, the operation may provide a video network terminal identifier (e.g., a video network number) to indicate which terminal charges, and a bank server may generate charging information according to the operation, where the charging information includes the video network terminal identifier and a charging amount. The recharge information is transmitted from the bank server to the server of the video network, i.e. the OMC of the embodiment. After receiving the recharging information, the OMC generates charge information of the video network terminal according to the video network terminal identification and the recharging amount in the recharging information, wherein the charge information is the recharging amount.
Step S602, OMC uses the symmetric key determined in the process of bidirectional authentication with the terminal of the video network to encrypt the fee information to obtain a fee ciphertext.
Step S603, the OMC generates signature data according to its own private key.
The generation process of the signature data may include: and the OMC calls the PCI password firmware, the PCI password firmware generates a random number, a preset hash function is applied to calculate the random number and the OMC ID to obtain an information abstract, and the information abstract is encrypted by using a private key of the OMC to obtain signature data. Of course, the object calculated by applying the preset hash function (e.g., SM3 algorithm) is not limited to the random number and the OMC ID, and may include the above-mentioned fee information or the terminal ID of the video network, etc.
Step S604, the OMC sends a notification message to the terminal of the video network, where the notification message carries the fee ciphertext, the signature data, and the packet data, the signature transformation data, and the signature transformation equation corresponding to the signature data.
The determination process of the packet data, the signature transformation data, and the signature transformation equation corresponding to the signature data in this embodiment is the same as that described in the above embodiment, and is not described herein again.
The notification message also carries plaintext information of the random number and the OMC ID, and other related parameters. Taking the information contained in the notification message shown in table 2 as an example, the following description is given:
TABLE 2
Step S605, after the video network terminal receives the notification message, the security chip applies the symmetric key to decrypt the cost ciphertext, and the signature transformation data and the signature transformation equation are used for reversely calculating to determine the validity of the packet data, and then the public key of the OMC is used for verifying the signature data.
The process of verifying the signature data may include: calculating plaintext information in the notification message by applying the preset hash function to obtain a first information abstract; decrypting the signature data by using a public key of the video network server to obtain a second information abstract; comparing whether the first information abstract and the second information abstract are consistent; and if the signature data are consistent, verifying that the signature data are legal. If not, the signature data is verified as being illegal.
Step S606, after the terminal of the video network verifies the legitimacy, the terminal feeds back a message of the verification legitimacy to the OMC.
After the terminal of the video network verifies the legitimacy, the cost in the security chip can be updated according to the cost information, if the verification signature data is illegal, an error prompt message that the verification fails and the recharging cannot be carried out is returned to the OMC.
The verification legal message can not carry expense information, so that the video network terminal does not need to perform processing such as related encryption or signature. In one possible embodiment, the authentication validity message may also include cost information, and the cost information may be encrypted by the symmetric key to obtain a cost cryptograph for security. If the video network terminal also carries out recharge updating locally, a status code can be added in the verification message for feeding back the recharge status according to whether the recharge updating operation is successful or not. The verification message fed back to the OMC by the terminal of the video network can be seen from table 3:
TABLE 3
Transaction identification | Function(s) |
Video networking terminal ID | Unique identification of video networking terminal |
Fee ciphertext | Ciphertext corresponding to recharging amount |
Status code | Feedback recharge state |
Step S607, after receiving the above verification legal message, the OMC charges the terminal of the video network according to the above charge information.
The specific charging may include: updating the balance of the video network terminal by applying the expense information; encrypting the balance by using the symmetric key to obtain a balance ciphertext; and sending a prompt message containing the balance ciphertext to the video network terminal to instruct the video network terminal to decrypt the balance ciphertext by using the symmetric key and display the balance. This process is similar to the process of processing the cost information and will not be described herein. Based on the foregoing method embodiment, an embodiment of the present application further provides a charging apparatus for a terminal, where the apparatus is applied to a management server, and as shown in fig. 7, the apparatus includes:
a fee information acquiring module 71, configured to acquire fee information of the terminal;
the expense encryption module 72 is used for encrypting expense information by using a symmetric key determined in the process of bidirectional authentication with the terminal to obtain an expense ciphertext;
a signature module 73 for generating signature data according to a private key of the management server;
the signature transformation module 74 is configured to transform the signature data according to a signature transformation policy to obtain signature transformation data; for the specific transformation process of the signature transformation data, reference may be made to the above method embodiment, which is not described herein again.
A message sending module 75, configured to send a notification message to the terminal; the notification message carries the expense ciphertext and the signature transformation data to instruct the terminal to decrypt the expense ciphertext, the signature data is obtained through reverse transformation of the signature transformation data, and the public key of the management server is applied to verify the signature data;
and the charging module 76 is used for receiving the verification legal message fed back by the terminal and charging the terminal according to the charge information.
The charging device encrypts the charge information by using the symmetric key determined in the bidirectional authentication process, ensures the safety of the charge information transmission process, generates the signature data according to the private key of the management server, converts the signature data according to the signature conversion strategy to obtain the signature conversion data, sends the notification message containing the charge ciphertext and the signature conversion data to the terminal, can enable the terminal to decrypt the charge ciphertext based on the notification message and reversely convert to obtain the signature data, further verifies the legality of the signature data, ensures the validity of the data, enhances the safety of information transmission, effectively relieves the problem of malicious information tampering, can timely and effectively transmit the charge information of the terminal to the terminal based on the notification message, charges after the terminal verifies the information is legal, enhances the rationality and the fairness of charging, and is suitable for practical application, the performance of the network service is effectively improved.
The fee information acquisition module 71 acquires the fee information by at least one of the following methods: (1) generating cost information of the terminal according to the recharging information corresponding to the terminal; (2) generating cost information of the terminal according to the used flow corresponding to the terminal; for example: acquiring the used flow of a terminal; and multiplying the unit flow price by the used flow to obtain the cost information of the terminal. (3) And generating the expense information of the terminal according to the used time length corresponding to the terminal.
Referring to fig. 8, a schematic structural diagram of another charging apparatus for a terminal is shown, where the apparatus further includes, based on the above apparatus: an authentication module 80, configured to receive network access authentication information sent by a terminal; the public key and the network access authentication information of the application terminal verify whether the terminal is legal or not; if the authentication response message is legal, sending the authentication response message to the terminal; the authentication response message carries signature certificate data of a ciphertext containing the symmetric key, so that the terminal verifies the identity of the management server based on the signature certificate data and obtains the symmetric key; the signature certificate data further includes: the second digital certificate and a certificate conversion signature of a certificate signature corresponding to the second digital certificate; the certificate transformation signature is obtained by transforming the certificate signature by applying a certificate transformation strategy, and the symmetric key is used for encrypting/decrypting the expense information in the interactive process.
The network access authentication information includes: a certificate serial number and a first random number ciphertext of the first digital certificate; the first random number ciphertext is generated by encrypting a first random number by a private key of the security chip application terminal; correspondingly, the process of verifying whether the terminal is legal or not by applying the public key of the terminal and the network access authentication information comprises the following steps: acquiring a first digital certificate of the terminal according to the certificate serial number of the first digital certificate; decrypting the first random number ciphertext by using the public key in the first digital certificate; and if the decryption is successful, determining that the terminal is legal.
The authentication module 80 is further configured to: obtaining the second digital certificate and the certificate signature of the second digital certificate from a certificate server; the certificate server calculates the information digest of the second digital certificate by using a preset hash function, and encrypts the information digest by using a private key of the certificate server to obtain a certificate signature; encrypting the second random number by using a private key of the management server to obtain a second random number ciphertext; encrypting the symmetric key by using a private key of the management server to obtain a ciphertext of the symmetric key; dividing the certificate signature into a plurality of signature transformation group numbers according to the constant value, and calculating each signature transformation group number by applying a preset signature transformation equation to obtain a signature transformation value corresponding to each signature transformation group number; determining a certificate transformation signature according to data obtained by connecting signature transformation values respectively corresponding to the signature transformation group numbers; sending an authentication response message to the terminal, wherein the authentication response message carries the signature certificate data, and the signature certificate data comprises: the system comprises a second digital certificate, a certificate signature, a second random number ciphertext, a symmetric key ciphertext, a signature transformation group number, the certificate transformation signature and a signature transformation equation.
The charging module 76 is further configured to update the balance of the terminal by applying the charge information; wherein, the expense information is the recharging amount or the consumed amount; encrypting the balance by using the symmetric key to obtain a balance ciphertext; and sending a prompt message containing the balance ciphertext to the terminal to instruct the terminal to decrypt the balance ciphertext by using the symmetric key and display the balance.
The embodiment of the application also provides another charging device of the terminal, which is applied to the terminal, and the terminal is provided with a security chip; referring to fig. 9, the apparatus includes:
a message receiving module 91, configured to receive a notification message sent by the management server; wherein, the notification message carries the expense cryptograph and the signature transformation data; the cost ciphertext is obtained by encrypting the cost information of the terminal by using the symmetric key determined in the bidirectional authentication process, the signature transformation data is obtained by transforming the signature data by using a signature transformation strategy, and the signature data is generated according to the private key of the management server;
and the decryption and signature verification module 92 is used for decrypting the expense ciphertext by applying the symmetric key, determining signature data by applying the signature transformation strategy and the signature transformation data, and verifying the signature data by applying a public key of the management server.
And the feedback module 93 is configured to feed back a verification legal message to the management server after the verification is legal, so as to instruct the management server to charge the terminal according to the charge information.
The terminal can be provided with a security chip, such as an ESAM chip, and the ESAM chip is integrated in the terminal.
The decryption and signature verification module 92 is further configured to calculate a notification message by applying a preset hash function to obtain a first information digest; decrypting the signature data by using the public key of the management server to obtain a second information abstract; comparing whether the first information abstract and the second information abstract are consistent; and if the signature data are consistent, verifying that the signature data are legal.
The embodiment of the application also provides another charging device of the network terminal, which comprises one or more processors; and one or more computer-readable storage media having instructions stored thereon, which, when executed by one or more processors, cause an apparatus to perform the charging method of the terminal described above.
The embodiment of the application also provides a management server, which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes the charging method of the terminal corresponding to the management server side when executing the computer program.
The embodiment of the application also provides a terminal, which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes the charging method of the terminal corresponding to the terminal side when executing the computer program.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the charging method for the terminal corresponding to the management server side or the terminal side.
The charging device, the management server and the terminal of the terminal provided in the embodiment of the present application have the same implementation principle and the same technical effect as those of the foregoing method embodiment, and for the sake of brief description, for parts that are not mentioned in the related embodiments, reference may be made to corresponding contents in the foregoing method embodiment.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal 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 terminal. 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 terminal that comprises the element.
The method, the apparatus, the device and the medium for secure video communication based on the control plane protocol provided by the present invention are introduced in detail, and a specific example is applied in the text to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
Claims (10)
1. A charging method of a terminal is characterized in that the method is applied to a management server and comprises the following steps:
acquiring the cost information of the terminal;
encrypting the expense information by using a symmetric key determined in the bidirectional authentication process with the terminal to obtain an expense ciphertext;
generating signature data according to a private key of the management server;
converting the signature data according to a signature conversion strategy to obtain signature conversion data;
sending a notification message to the terminal; the notification message carries the expense ciphertext and the signature transformation data to indicate the terminal to decrypt the expense ciphertext, the signature data is obtained through reverse transformation of the signature transformation data, and the public key of the management server is used for verifying the signature data;
and receiving a verification legal message fed back by the terminal, and charging the terminal according to the charge information.
2. The method of claim 1, wherein the signature transformation policy comprises a signature transformation equation;
the step of transforming the signature data according to the signature transformation strategy to obtain signature transformation data comprises the following steps:
and calculating the signature data by applying the signature transformation equation to obtain the signature transformation data.
3. The method of claim 2, wherein the signature transformation policy further comprises a grouping mode;
the step of calculating the signature data by applying the signature transformation equation to obtain the signature transformation data comprises the following steps:
segmenting the signature data into a plurality of packet data;
calculating each grouped data by applying the signature transformation equation to obtain transformation data respectively corresponding to each grouped data;
and sequencing the transformation data respectively corresponding to each grouped data by applying a preset arrangement rule to obtain signature transformation data.
4. The method of claim 3, wherein the signature transformation equations correspond one-to-one to the packet data;
and calculating the grouped data by applying the signature transformation equation corresponding to each grouped data to obtain transformation data respectively corresponding to each grouped data.
5. The method of claim 3, wherein the signature transformation policy further comprises a preset constant value;
the step of segmenting the signature data into a plurality of packet data, comprising:
determining the number of groups corresponding to the signature data according to the length of the signature data and the constant value;
segmenting the signature data into a plurality of packet data; wherein the number of packet data is equal to the number of groups.
6. The method of claim 1, wherein the signature transformation policy is a currently determined policy; the notification message also carries the signature transformation strategy, so that the terminal transforms the signature transformation data according to the signature transformation strategy to obtain the signature data.
7. The method according to any one of claims 1 to 6, further comprising:
receiving network access authentication information sent by the terminal;
applying the public key of the terminal and the network access authentication information to verify whether the terminal is legal or not;
if the terminal is legal, sending an authentication response message to the terminal; the authentication response message carries signature certificate data of a ciphertext containing the symmetric key, so that the terminal verifies the identity of the management server based on the signature certificate data and obtains the symmetric key; the signature certificate data further includes: a second digital certificate, a certificate transformation signature of a certificate signature corresponding to the second digital certificate; the certificate transformation signature is obtained by transforming the certificate signature by applying a certificate transformation strategy, and the symmetric key is used for encrypting/decrypting the cost information in the interactive process.
8. A charging method of a terminal is characterized in that the method is applied to the terminal and comprises the following steps:
receiving a notification message sent by a management server, wherein the notification message carries a cost ciphertext and signature transformation data; the cost ciphertext is obtained by encrypting the cost information of the terminal by using a symmetric key determined in the bidirectional authentication process, the signature transformation data is obtained by transforming the signature data by using a signature transformation strategy, and the signature data is generated according to a private key of the management server;
decrypting the expense ciphertext by applying the symmetric key, determining the signature data by applying the signature transformation strategy and the signature transformation data, and verifying the signature data by applying a public key of the management server;
and after the legality is verified, feeding back a verification legal message to the management server to indicate the management server to charge the terminal according to the charge information.
9. A charging apparatus of a terminal, comprising: one or more processors; and one or more computer-readable storage media having instructions stored thereon, which, when executed by the one or more processors, cause the apparatus to perform the charging method for the terminal according to any one of claims 1 to 7 or the charging method for the terminal according to claim 8.
10. A computer-readable storage medium, characterized in that a computer program is stored thereon, which, when being executed by a processor, implements the charging method of a terminal of any one of claims 1 to 7 or the charging method of a terminal of claim 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111560928.1A CN114244532A (en) | 2021-12-14 | 2021-12-14 | Charging method and charging device of terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111560928.1A CN114244532A (en) | 2021-12-14 | 2021-12-14 | Charging method and charging device of terminal |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114244532A true CN114244532A (en) | 2022-03-25 |
Family
ID=80759043
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111560928.1A Pending CN114244532A (en) | 2021-12-14 | 2021-12-14 | Charging method and charging device of terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114244532A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116629864A (en) * | 2023-04-27 | 2023-08-22 | 北京熠智科技有限公司 | API service charging method, platform and storage medium under privacy computing scene |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1628449A (en) * | 2002-06-20 | 2005-06-15 | 诺基亚公司 | Method system and device for transferring accounting information |
CN103716762A (en) * | 2012-09-29 | 2014-04-09 | 卓望数码技术(深圳)有限公司 | Internet billing system and safety billing realizing method thereof |
CN107800534A (en) * | 2017-10-16 | 2018-03-13 | 北京连山时代科技有限公司 | A kind of data ciphering method and decryption method based on multi-chain circuit transmission |
CN108492383A (en) * | 2018-02-11 | 2018-09-04 | 深圳市图灵奇点智能科技有限公司 | By the method, apparatus and vehicle of the auxiliary settlement of parking fee that onboard system is realized |
CN110661783A (en) * | 2019-08-28 | 2020-01-07 | 视联动力信息技术股份有限公司 | Terminal registration method, device and storage medium |
CN111192047A (en) * | 2019-12-26 | 2020-05-22 | 天地融科技股份有限公司 | Vehicle-mounted unit charging method based on asymmetric algorithm |
CN111724494A (en) * | 2020-06-27 | 2020-09-29 | 北京百度网讯科技有限公司 | Traffic information processing method and device, electronic equipment and storage medium |
US20200322126A1 (en) * | 2019-04-05 | 2020-10-08 | Honeywell International Inc. | Using error detection bits for cryptographic integrity and authentication |
CN112637131A (en) * | 2020-12-01 | 2021-04-09 | 百果园技术(新加坡)有限公司 | User identity authentication method, device, equipment and storage medium |
-
2021
- 2021-12-14 CN CN202111560928.1A patent/CN114244532A/en active Pending
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1628449A (en) * | 2002-06-20 | 2005-06-15 | 诺基亚公司 | Method system and device for transferring accounting information |
CN103716762A (en) * | 2012-09-29 | 2014-04-09 | 卓望数码技术(深圳)有限公司 | Internet billing system and safety billing realizing method thereof |
CN107800534A (en) * | 2017-10-16 | 2018-03-13 | 北京连山时代科技有限公司 | A kind of data ciphering method and decryption method based on multi-chain circuit transmission |
CN108492383A (en) * | 2018-02-11 | 2018-09-04 | 深圳市图灵奇点智能科技有限公司 | By the method, apparatus and vehicle of the auxiliary settlement of parking fee that onboard system is realized |
US20200322126A1 (en) * | 2019-04-05 | 2020-10-08 | Honeywell International Inc. | Using error detection bits for cryptographic integrity and authentication |
CN110661783A (en) * | 2019-08-28 | 2020-01-07 | 视联动力信息技术股份有限公司 | Terminal registration method, device and storage medium |
CN111192047A (en) * | 2019-12-26 | 2020-05-22 | 天地融科技股份有限公司 | Vehicle-mounted unit charging method based on asymmetric algorithm |
CN111724494A (en) * | 2020-06-27 | 2020-09-29 | 北京百度网讯科技有限公司 | Traffic information processing method and device, electronic equipment and storage medium |
CN112637131A (en) * | 2020-12-01 | 2021-04-09 | 百果园技术(新加坡)有限公司 | User identity authentication method, device, equipment and storage medium |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116629864A (en) * | 2023-04-27 | 2023-08-22 | 北京熠智科技有限公司 | API service charging method, platform and storage medium under privacy computing scene |
CN116629864B (en) * | 2023-04-27 | 2024-04-16 | 北京熠智科技有限公司 | API service charging method, platform and storage medium under privacy computing scene |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111030814B (en) | Secret key negotiation method and device | |
TW453089B (en) | Protecting information in a system | |
CN103067333B (en) | The method of proof machine top box access identity and certificate server | |
US20200320178A1 (en) | Digital rights management authorization token pairing | |
CN106357396A (en) | Digital signature method, digital signature system and quantum key card | |
CN104506503B (en) | A kind of security certification system based on broadcasting and TV one-way transport network | |
CN109151508B (en) | Video encryption method | |
CN110662091B (en) | Third-party live video access method, storage medium, electronic device and system | |
CN110958209A (en) | Bidirectional authentication method, system and terminal based on shared secret key | |
CN114697040B (en) | Electronic signature method and system based on symmetric key | |
CN107613316A (en) | A kind of network direct broadcasting plug-flow verification method and system | |
CN105119891B (en) | A kind of data interactive method, set-top box and server | |
CN112165596A (en) | Monitoring video data transmission method and device, terminal equipment and storage medium | |
CN104735484A (en) | Method and device for playing video | |
CN101789863B (en) | Safe data information transmission method | |
CN114500064B (en) | Communication security verification method and device, storage medium and electronic equipment | |
CN103297230A (en) | Information encryption and decryption method, device and system | |
CN114726536A (en) | Timestamp generation method and device, electronic equipment and storage medium | |
CN108924108B (en) | Communication method for client and electronic equipment | |
CN114244532A (en) | Charging method and charging device of terminal | |
CN102917252A (en) | IPTV (internet protocol television) program stream content protection system and method | |
CN117675177A (en) | Internet of things terminal secure access method and system based on identification key | |
CN112947966A (en) | Firmware updating method, device and system for Internet of things equipment and storage medium | |
WO2012100352A1 (en) | Controlled security domains | |
CN108769748B (en) | Information processing method and related equipment |
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 |