CN108964901B - Information verification method, system and device - Google Patents

Information verification method, system and device Download PDF

Info

Publication number
CN108964901B
CN108964901B CN201810737301.0A CN201810737301A CN108964901B CN 108964901 B CN108964901 B CN 108964901B CN 201810737301 A CN201810737301 A CN 201810737301A CN 108964901 B CN108964901 B CN 108964901B
Authority
CN
China
Prior art keywords
server
information
equipment
calculation result
calculation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810737301.0A
Other languages
Chinese (zh)
Other versions
CN108964901A (en
Inventor
周志刚
张文明
陈少杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201810737301.0A priority Critical patent/CN108964901B/en
Publication of CN108964901A publication Critical patent/CN108964901A/en
Application granted granted Critical
Publication of CN108964901B publication Critical patent/CN108964901B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/085Secret sharing or secret splitting, e.g. threshold schemes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/083Network architectures or network communication protocols for network security for authentication of entities using passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic 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/3297Cryptographic 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 time stamps, e.g. generation of time stamps
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • H04N21/4312Generation of visual interfaces for content selection or interaction; Content or additional data rendering involving specific graphical features, e.g. screen layout, special fonts or colors, blinking icons, highlights or animations
    • H04N21/4314Generation of visual interfaces for content selection or interaction; Content or additional data rendering involving specific graphical features, e.g. screen layout, special fonts or colors, blinking icons, highlights or animations for fitting data in a restricted space on the screen, e.g. EPG data in a rectangular grid
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/478Supplemental services, e.g. displaying phone caller identification, shopping application
    • H04N21/4788Supplemental services, e.g. displaying phone caller identification, shopping application communicating with other users, e.g. chatting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/488Data services, e.g. news ticker
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/488Data services, e.g. news ticker
    • H04N21/4882Data services, e.g. news ticker for displaying messages, e.g. warnings, reminders

Abstract

The invention discloses an information verification method, a system and a device, which relate to the field of information verification, and the method comprises the following steps: acquiring the computing capacity level L of the equipment; the method comprises the steps that M batches of the equipment are notified at different moments, and notification information corresponding to each equipment comprises a corresponding computing capacity level L, a check field and a batch ordering D of the notification information relative to the earliest first batch; the device and the server establish communication and generate a shared key; the equipment receives the corresponding notification information, inputs the check field into a preset algorithm to obtain a calculation result, and enters the next step when the number N of preset values in the calculation result meets the requirement that N is L + M-D; and encrypting the calculation result by using a shared key and sending the calculation result to the server, verifying whether the calculation result is matched with a prestored result by the server, and if so, passing the verification. The invention also provides a corresponding system and a corresponding device.

Description

Information verification method, system and device
Technical Field
The invention relates to a method, a system and a storage medium for verifying client equipment and a server in network communication when the client equipment and the server carry out communication in specific occasions, belonging to the field of communication.
Background
At present, with the direct broadcasting being more and more popular, the direct broadcasting platform also continuously promotes various playing methods to improve the interactive participation degree of audiences and the anchor. There is a barrage interactive mode in current live platform: the audience interactively communicates with the anchor by sending comments or text messages to be displayed on the real-time playing video while watching.
In view of the psychology of the public: all audiences like lottery drawing, so the live broadcast platform has promoted the anchor and has sent "lottery drawing" information, and the audience carries out the lottery drawing through sending barrage information. When certain live broadcast room spectator is more, if the anchor has opened the lottery draw activity and has sent the lottery draw information, then in the same time, all spectators can all receive this lottery draw information to send the barrage in short centralized time and participate in the lottery draw, then live broadcast platform server will receive a large amount of barrages in the same time this moment, and this pressure that can make the short time processing information of server becomes very big, appears delaying easily or other troubles.
In addition, in actual conditions, some hackers or 'robot users' (illegal users) exist in the same live broadcast room, and the disguised illegal users are automatically switched to different rooms continuously by compiling scripts and send a large number of barracks in a short time to participate in lottery drawing. On one hand, because the customers use different client-side equipment, the calculation reaction speeds are different, the chances of drawing prizes are also different, and the customers are unfair; on the other hand, hackers or "robotic users" often use better computers or workstations or even computing centers to do the above, and thus they may gain advantages in the lottery activity and more win, which obviously deviates from the original intention of relying on the fairness of the barrage lottery to enhance the live interaction. Moreover, the act of sending a large number of barrages will burden the server even more, making it easier for the system to malfunction.
However, for the above defects that the server increases pressure in a short time and is easily drilled with a leak by an illegal user in the barrage lottery, there is no method for verifying the lottery information sent by the user in a targeted manner in the prior art.
Disclosure of Invention
The present invention is made to solve the above-mentioned problems that the server is under a short-time pressure increase in the barrage lottery and is liable to be pierced by an illegal user, and an object of the present invention is to provide a method, a system, and an apparatus for performing information verification on barrage information transmitted from a client when the server issues lottery drawing information.
The invention conception of the invention is as follows:
in the design of the invention, after the anchor sends lottery drawing information at the anchor end and sends the lottery drawing information to the server, the server sends a notification message to all the clients (obviously, the clients are all in the anchor room of the anchor and are in corresponding relation with the anchor) in communication connection with the server to inform the anchor of the room to start the barrage lottery drawing.
In order to prevent the server pressure brought by the lottery drawing messages sent to all the clients in the same time and prevent all the lottery-participating audiences from simultaneously sending barrages for lottery drawing through the clients, the server of the invention sends the lottery drawing messages to the client of the audiences at random time: for example, in 1 second, the lottery-drawing starting message is randomly issued, some clients will receive the notification message of the barrage lottery first in this 1 second, some client devices will receive the notification message of the barrage lottery later, and the server divides the instant lottery-drawing barrage message into a 1 second time period for issuing, so that when the audience operates the client devices to draw the barrage lottery, the barrage reported by the audience also can be distributed due to the time difference, thereby avoiding the instant pressure of the server caused by the server receiving a large number of concurrent lottery-drawing barrages at the same time.
Meanwhile, in order to prevent a hacker from brushing a lottery draw barrage by writing scripts, a check field is added in a notification message of the lottery draw barrage, the check field consumes CPU resources of a client through corresponding calculation times, and in order to more fairly draw a lottery and eliminate the difference of the calculation capacity of the client of the user, the check field controls the calculation times of the client according to the equipment type of the client and the time of issuing the lottery draw notification information by a server, namely, the time of issuing the lottery draw notification information is early, the calculation times of the check field of the client with strong calculation capacity are more, so that the difference of the calculation capacity of the client equipment is counteracted, the chance that the hacker generates a 'robot user' to brush the lottery draw lottery through a written protocol is fundamentally avoided (because the equipment of good equipment but the calculation times of the hacker, long time, so that a large amount of lottery drawing information cannot be transmitted), the present invention also improves the fairness of lottery drawing.
The above is the inventive concept of the present invention, and the following technical solutions are obtained by expanding the basic inventive concept of the present invention:
an information verification method for verifying information when a device sends the information to a server, comprising the steps of:
acquiring the computing capacity level L of the equipment;
the method comprises the steps that M batches of the equipment are notified at different moments, and notification information corresponding to each equipment comprises a corresponding computing capacity level L, a check field and a batch ordering D of the notification information relative to the earliest first batch;
the device and the server establish communication and generate a shared key;
the equipment receives the corresponding notification information, inputs the check field into a preset algorithm to obtain a calculation result, and enters the next step when the number N of preset values in the calculation result meets the requirement that N is L + M-D;
and encrypting the calculation result by using a shared key and sending the calculation result to the server, verifying whether the calculation result is matched with a prestored result by the server, and if so, passing the verification.
The information verification method provided by the present invention may further have a feature that the process of obtaining the calculation capability level L is: and acquiring equipment information of the equipment, and determining the computing capability level L of the equipment according to the acquired equipment information by contrasting pre-stored equipment and computing capability level corresponding information.
The information verification method provided by the present invention may further have a feature that the specific steps of the batch notification include:
dividing the selected time T into M parts on average;
equally dividing all the devices corresponding to the server into M parts;
and in the first T/M time, the notification information is sent to the first equipment of the first batch, and then sent to other equipment according to the batch sequence until the sending is finished.
The information verification method provided by the present invention may further have a feature in that the process of establishing communication and generating a shared key includes the substeps of:
when the equipment logs in the server, the server generates a pair of public key and private key according to the user information of the equipment;
when the device logs in to the server, the device generates a pair of a public key and a private key according to the verification field and the time stamp of the login time;
the server and each device exchange public keys with each other to realize key sharing and establish communication.
The information verification method provided by the present invention may also have such a feature that the server is a live platform server, the device is a device of a live platform for use by audience users,
the notification information is notification information of a barrage lottery, and the check field is random data.
The information verification method provided by the invention can also have the characteristic that the preset algorithm is used for calculating the hash value of the check field, and the number of the corresponding preset values is the number of the hash value with the beginning of 0 obtained by calculation.
The information verification method according to the present invention may further include a feature that, when the number N of predetermined values obtained by performing the specific calculation does not satisfy N + L-M-D, the device adds one multi-bit data before the check field and then performs the calculation again until the condition is satisfied.
The information verification method provided by the present invention may further have a feature that the process of verifying whether the calculation result matches by the server includes the following substeps:
decrypting the notification information received from the device using the public key;
checking whether a check field and a calculation result exist in the data obtained by decryption, if not, judging that the data is invalid and cannot pass the verification, and if so, entering the next step;
and further judging whether the check field and the calculation result are matched with the check field and the calculation result which are correspondingly sent to the equipment by the server, if so, the verification is passed, otherwise, the verification cannot be passed.
The present invention also provides an information verification system for verifying information when a device sends information to a server, the system comprising:
the computing power obtaining module is used for obtaining the computing power level L of the equipment;
the batch notification module is used for notifying the equipment in M batches at different moments, and the notification information corresponding to each equipment comprises a corresponding computing capacity level L, a check field and a batch ordering D of the notification information relative to the earliest first batch;
the shared key generation module is used for establishing communication between the equipment and the server and generating a shared key;
the preset value calculation and judgment module is used for carrying out preset calculation on the check field to obtain a calculation result and further judging whether the number N of preset values in the calculation result meets the requirement that N is equal to L + M-D;
and the matching judgment module is used for encrypting the calculation result of the preset calculation by using the shared key and sending the result to the server, verifying whether the calculation result is matched with the prestored result or not, and if so, verifying the result to be passed.
The invention also provides an information verification device, which comprises a memory and a processor, wherein the memory is stored with a computer program running on the processor, and the information verification device is characterized in that: the processor, when executing the computer program, implements the method described above.
The invention has the following functions and effects: according to the method for verifying information of the present invention, the method comprises the following steps: acquiring and determining the computing capacity level L of the client equipment; the client devices are notified in batches by dividing M batches at different moments, and the notification information corresponding to each client comprises a corresponding computing capacity level L, random data and a batch ordering D of the notification information relative to the earliest first batch; the client device and the server establish communication and generate a shared key; the client device receives the corresponding notification information, performs specific calculation on the random data to obtain a preset value, and enters the next step when the number N of the preset values obtained by the specific calculation meets the condition that N is L + M-D; encrypting the calculation result of specific calculation by using shared secret key and transmitting it to server, verifying whether the calculation result is matched by server, if matched, verifying so that it is passed
The client devices are notified in batches by M at different moments, so that some client devices can receive notification information of the barrage lottery firstly, some client devices can receive notification information of the barrage lottery later, and the server divides instant lottery barrage information into a plurality of time periods to be issued, so that when the audience operates the client devices to conduct barrage lottery, barrages reported by the audience are distributed due to time differences, and instantaneous pressure of the server caused by the fact that the server receives a large number of concurrent lottery barrages at the same time is avoided;
the calculation capacity difference of the client of the user is eliminated by adopting whether the number N of the preset values obtained by specific calculation meets N-L + M-D to adjust the calculation times (calculation time): the random data used as the check field controls the calculation times of the client according to the equipment type of the client and the time of issuing the barrage lottery drawing notification information by the server, namely, the time of issuing the barrage lottery drawing notification information is early, the calculation times of the check field of the client with strong calculation capability are more, so that the difference of the calculation capability of the client equipment is offset, and the chance that a hacker generates a robot user to draw a lottery through a written protocol is fundamentally stopped (because the hacker has good equipment but has more calculation times and long time, a large amount of lottery drawing information cannot be sent), so the lottery drawing fairness is also improved.
Drawings
Fig. 1 is a schematic step diagram of an information verification method according to an embodiment of the present invention.
FIG. 2 is a detailed process diagram for establishing communications and generating a shared secret in accordance with an embodiment of the present invention;
FIG. 3 is a diagram illustrating the detailed procedure of the information verification step in the embodiment of the present invention; and fig. 4 is a schematic structural diagram of an information verification system in an embodiment of the present invention.
Detailed Description
In order to make the technical means, the creation features, the achievement objectives and the efficacy of the present invention easy to understand, the following embodiments specifically describe the composition, the structure, the connection relationship, the specific work flow, the working principle, the action and the effect of the information verification method, the system and the storage medium of the present invention with reference to the accompanying drawings.
The following description will be made in detail of the fact that the anchor in the background art issues lottery drawing information via the server, and the corresponding device connected to the server receives and verifies the lottery drawing information.
Fig. 1 is a schematic step diagram of an information verification method according to an embodiment of the present invention.
As shown in FIG. 1, the information verification method of the present embodiment has steps S1-S
Step S1, obtaining a computing power level L of the device, which is formed by the following two processes:
and step S1-1, collecting the equipment information of the client. Firstly, the device information of the client needs to be collected, which is mainly to check what device the current client belongs to, for example, for mobile devices, what the model of a mobile phone is, and the computing capability of the device can be known through the model, so that preparation is made for the subsequent server to issue the computing times of the verification field. The more capable the device is computed, the faster the more capable the device is computed for the same number of computations for the authentication field. And after the client logs in the live broadcast platform server, recording the device information deviceinfo. In this embodiment, the acquisition of the IOS device information of apple is taken as an example for explanation, and the details are as follows:
struct utsname systemInfo;
first, a structure variable of the systemlnfo is defined for storing the acquired device information.
And then acquiring the equipment information of the IOS by calling an interface function unit provided by the system, wherein the interface unit is defined as follows:
uname(struct utsname*name)
wherein the parameter utname is introduced to obtain information of the device.
The concrete implementation is as follows:
Uname(&systemInfo);
the present embodiment stores the acquired information by calling the Uname and passing in the previously defined variable systemInfo. The machine stores the information of the device by acquiring the corresponding character string systemlnfo.
NSString*deviceString=[NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
The NSString interface stringWithCString converts the NSString interface stringWithCString into type data deviceString of a character string, and the type data deviceString is finally stored in the deviceString.
For example, if it acquires an Iphone6 device, deviceString gets an Iphone6,1, and if the device is Iphone7, the acquired device information is stored in deviceString, which gets an Iphone7, 1.
By this step, the model information of the client device is completed.
Step S1-2, the live platform ranks the computing power of the device. The live platform collects most device information, and ranks each device information according to its computing performance, so that a device with higher computing performance is defined as a high rank, and a device with lower computing performance is defined as a low rank, for example, the computing performance of the device may be classified according to 5 ranks, for example, for an ios device, iphonex is the device with the best computing performance at present, and is defined as 5 ranks, for iphone8, the device has a poor performance, and is defined as 4 ranks, for iphone7, the device has 2 ranks, for iphone6, and the device has 1 rank for iphone5 and below. The same classification can be performed for android devices as well. And finally, a grading table of ios and android devices is stored in the server, and any device can obtain the computing capacity grade L corresponding to the device through the corresponding relation of the table.
This step completes the server ranking of the devices and results in a table of device signals versus computing power level L.
Step S2, notifying a plurality of said devices in M batches at different times, the notification information corresponding to each device comprising a corresponding computing power level L, a check field and a batch ordering D of the notification information with respect to the earliest first batch.
When the anchor starts drawing a lottery, the server needs to send a lottery drawing message to the devices held by all users in the live broadcast room, and in order to prevent all the users from receiving the barrage lottery and sending the lottery drawing message at the same time, the server notifies all the users in batches within a time period instead of notifying the users at the same time.
The specific steps of batch notification include:
dividing the selected time T into M parts on average;
equally dividing all the devices corresponding to the server into M parts;
and in the first T/M time, the notification information is sent to the first equipment of the first batch, and then sent to other equipment according to the batch sequence until the sending is finished.
Specifically, in this embodiment, all users are notified within 1 second of the total time:
first, the server divides the room users equally, every 200 ms is an interval, so 1 second is 1000 ms, the users are divided into 5 equal parts, if 1-4 equal parts are the same number, and the 5 th is insufficient, the users are still divided into 5 parts.
The first 200 ms user is not delayed, and when the user receives the server lottery notification message, the delay field in the message field is 0, if the user is notified in the second 200 ms, the delay field is 1, and similarly if the user is notified in the 5 th 200 ms, the delay field is 4. Eventually within 1 second the server will notify all clients that the room anchor has sent a lottery message. And the message field will carry its batch ordering D of the notification information with respect to the earliest first batch.
Specifically, in this embodiment, the information notifying the drawing of the prize is:
type@=lotterystart/rid@=345/timedelay@=2/
for example, type @ ═ lotterystart/identifier in the text message is a message to start a lottery.
The message field rid @ 345 then identifies the room number.
The message field timedelay @ ═ 2 identifies the batch ordering D of the lottery message relative to the earliest first batch, i.e. the information is notified at the 3 rd 200 ms, with a batch ordering of 2 relative to the earliest first batch.
In order to avoid hackers from swiping a bullet screen for drawing a lottery by designing a code robot or relying on equipment with excellent performance, the server also issues some data, so that the safety and randomness of the algorithm are improved, and the data issued by the server can be different for each user and can be changed at each moment.
In addition, the present embodiment uses the workload proving algorithm in the blockchain: in the block chain, each new block is generated with a certain workload to calculate a correct result, and who calculates the correct result first generates a new block, so that a prize is obtained. The client is verified by using a workload algorithm, so that each lottery bullet screen needs workload certification, the condition that the fairness of lottery users is influenced by lots of concurrent lotteries of hackers is avoided, and the workload certification of the notification information can be adjusted according to time delay. The concrete implementation is as follows:
A. random data is added to the lottery drawing message.
In order to ensure the security of the workload certification algorithm of each client and prevent the workload certification algorithm from acquiring a correct value through enumeration, in this embodiment, a random data is added to each piece of issued lottery drawing message by the server, the data is a 32-bit length character string, each user is different random data, and each time is also different random data, so that the client cannot obtain a rule of data generation, and cannot obtain a result directly by bypassing calculation.
The concrete implementation is as follows:
ServerRandData[32]=rand();
herein, a system function rand () is called to generate random number data.
The lottery drawing message for starting drawing is as follows:
type@=lotterystart/rid@=345/timedelay@=2/
then the random data is added to become:
type@=lotterystart/rid@=345/timedelay@=2/ServerRandData=ac2536bcac84523697412acdeabdabc123
thus adding the random data field: ServerRandData ═ ac2536 bcc 84523697412 aceababbbc 123.
B. Device rating data is added to the lottery message.
When the client logs in the live broadcast platform server, the current equipment information is reported, and the server inquires the grade of the equipment according to the reported equipment information, so that the calculation capacity grade L is issued to the client. This level of information then corresponds to the computational performance of the device. The calculation capability grade of the equipment is considered to give consideration to fairness, and the better equipment is calculated faster, so that the server issues different calculation difficulties according to the equipment grade.
type@=lotterystart/rid@=345/timedelay@=2/ServerRandData=ac2536bcac84523697412acdeabdabc123/level@=2/
Thereby increasing the computing power level L of the device: level @ 2.
By this step, the server client end completes the notification client end for time division in the lottery drawing message, and adds the time-delay interval field in the message, namely the notification information relative to the batch ordering D of the earliest first batch, the check field and the computing power level L of the equipment.
In step S3, the device and the server establish communication and generate a shared key.
Fig. 2 is a detailed process diagram for establishing communication and generating a shared key according to an embodiment of the present invention.
The process of establishing communication and generating a shared key comprises the sub-steps of:
s3-1, when the device logs in to the server, the server generates a pair of public key and private key according to the user information of the device.
When the client logs in the live platform, the server of the live platform generates a pair of keys according to the user information. Meanwhile, in order to ensure that the secret key information of each user is inconsistent and improve the threshold of cracking, the account number and the random data of the user are used as the private key information, so that the inconsistency of the private key of each user is ensured. The present embodiment employs an asymmetric RSA encryption algorithm to generate a pair of public and private keys. Specifically, the private key may be generated by using a random number, the public key may generate a corresponding public key by calling an interface function of an RSA encryption algorithm, the private key and the public key are in a unique pairing relationship, and the actual operation process includes:
a generating random data
Randdata=rand();
And generating a random data Randdata by calling a system function rand.
b generating Md5 value as private key according to room number and random number
ClientPrivatekey=Md5.Create(UserId+TimeStamp+randdata)
Private key data is obtained by computing the Md5 value of the user ID and random data together with current timestamp information and random number by calling the interface Md5.create of the Md5 function.
c calculating the public key
ClientPublickey=RSA.CreatePair(ClientPrivatekey);
The public key is generated by calling the generation pairing key interface RSA.
So that the final server then generates a pair of public and private key information.
By the steps, the generation of a pair of private key and public key information for each logged-in user by the live broadcast platform server is completed.
S3-2, when the device logs in to the server, the device generates a pair of public key and private key according to the check field and the time stamp of the login time.
When a client logs in a live broadcast platform server, the server generates a pair of public key and private key information for the client, the client also generates a set of public key and private key information, and the client generates a private key by using random data and a timestamp, so that different clients are guaranteed to be different private keys and public keys as far as possible. The actual operation process comprises the following steps:
a generating random data
Randdata=rand();
And generating a random data Randdata by calling a system function rand.
b time stamp and random number generating Md5 value as private key
The server private key is Md5.Create (Randdata + timestamp) calculates the Md5 value of random data and current timestamp information by calling the Md5.Create interface of the Md5 function to splice together, so as to obtain private key data.
c calculating the public key
ServerPublickey=RSA.CreatePair(ServerPrivatekey);
The public key is generated by calling the generation pairing key interface RSA.
So that the final client generates a pair of public and private key information.
And at the moment, after receiving the public key information issued by the live broadcast platform server, sending the own public key information to the live broadcast platform server.
Therefore, the client generates a pair of public key and private key information through the step.
And S3-3, the server and each device exchange public keys with each other to realize key sharing and establish communication.
The direct broadcast platform server and the client exchange respective public key information to generate a shared key, and the shared key generated by the client and the server has the same value. The actual operation process comprises the following steps:
a exchange public key
And the live broadcast platform server sends the public key ServerPublinkey of the server to the client. And the client sends the own public key ClientPublinkey to the live broadcast platform server.
b live broadcast platform generating shared secret key
Implemented using ShareKey ═ rsa. createsharekey (ClientPublickey, ServerPrivatekey) code;
c the client generates a shared key.
Implemented using ShareKey ═ rsa. createsharekey (ServerPublickey) code;
so that the values of the shared key generated by the live platform and the shared key 2 ShareKey generated by the client are consistent.
Through the three substeps of S3-1 to S3-3, the device and the server establish communication and generate a shared key.
And step S4, the device receives the corresponding notification information, inputs the check field into a preset algorithm, and calculates to obtain a calculation result, and when the number N of predetermined values in the calculation result satisfies N ═ L + M-D, the device proceeds to the next step.
The client receives the notification information of the corresponding lottery drawing information and calculates the verification field.
After the client receives the lottery drawing starting message issued by the server, the verification field needs to be calculated first, and the lottery drawing message can be sent only after the verification field is obtained through a certain algorithm. This document uses a workload proven algorithm.
In this embodiment, after the client receives the random data, the HASH value needs to be calculated for the random data, and at the same time, when the HASH value is calculated, the client generates 32-bit data to be spliced together for calculation, and it needs to be ensured that in the HASH result of calculation, the number N of the first 0 must meet the requirement of the server, and then the more the number of 0, the more the time that needs to be calculated.
If the requirements are not met, the client will again alter the generated 32-bit data until the requirements are met. In the lottery starting message issued by the server, the higher the equipment grade is, the better the calculation performance is, the more the number N of the clients needing the corresponding calculation with the beginning of 0 is, and meanwhile, the longer the delay time is when the lottery starting message is issued, the fewer the calculation number with the beginning of 0 is.
The calculation formula for calculating the number N of the client (the device connected to the server) that needs to calculate the HASH result to be 0 is as follows:
N=L+M-D;
wherein L is the computing power level of the equipment, and the higher the level is, the more the number of hash values which need to be computed is 0.
Where M is the number of copies into which the total time T of the selected batch transmission is divided on average.
D is the batch sorting of the notification information relative to the earliest first batch, which shows that the delay of the issued lottery drawing information is divided into M grades, and the more the delay is, the less the number of 0 s needs to be calculated.
The method of the predetermined hash calculation operates as follows:
Clientdata=00000000000000000000000000000001
Hashresult=Md5.Create(Clientdata+ServerRandData);
and after the calculation result is obtained, judging whether the head of the hashresult has the number N which meets the HASH result of 0, if not, converting the Clientdata, and increasing the conversion algorithm.
Clientdata=00000000000000000000000000000002
Hashresult=Md5.Create(Clientdata+ServerRandData);
And judging whether the N-channel-type data meets the N-channel-type data, and repeating the steps until the calculated result meets the N number.
FIG. 3 is a detailed process diagram of the information verification step in the embodiment of the present invention.
And step S5, encrypting the calculation result by using the shared key and sending the calculation result to the server, verifying whether the calculation result is matched with the prestored result by the server, and if the calculation result is matched with the prestored result, passing the verification. The method specifically comprises the following substeps:
in step S5-1, the client device generates a lottery drawing message from the calculation result.
The Clientdata and the calculated HashResult result are required to be added to the lottery drawing message field of the client, and the server can verify whether the calculation of the client is correct or not.
The lottery drawing information is sent as follows:
type @/rid @/Clientdata @ 00000000000000000000000000000002/ashrescult @/00 ac23d6a5c14e2a3acbe 32125478993/wherein ashrescult @/00 ac23d6a5c14e2a3acbe 32125478993/is the calculated result.
And step S5-2, the client encrypts the lottery drawing information and reports the encrypted lottery drawing information to the server.
After the client generates lottery drawing information, the client encrypts the data by using a sharey and reports the encrypted data to the server, and a safer encryption algorithm is used in the client, and in the three steps of the steps S3-1 to S3-3, the device and the server establish communication and generate the sharey of the shared key.
The client encrypts the lottery drawing message and reports the lottery drawing message to the server, and the reporting process is realized by the following codes:
EncryptData=Aes.Ecnrypt(“type@=lottery/rid@=345/Clientdata@=00000000000000000000000000000002/Hashresult@=/00ac23d6a5c14e2a3acbe32125478993/”,sharekey);
the encrypted data is a lottery drawing message reported by the client, and the encrypted key is a shared share key using negotiation.
Thus, the encryption result reported by the client is completed through the step.
In step S5-3, the server verifies the client computation.
And after receiving the calculation result reported by the client, the server decrypts and verifies the result, verifies whether the calculation result of the client is correct, and can participate in lottery drawing if the calculation result is correct, otherwise, the server considers that the calculation result is an illegal request to draw lottery. The specific verification process is as follows:
step S5-3-1 decrypts the notification information received from the device using the public key. The server decrypts the data, and completes the decryption by using the following codes:
Data=Aes.decrypt(EncryptData,sharekey)。
and step S5-3-2, checking whether a check field and a calculation result exist in the decrypted data, if not, judging that the data is invalid and cannot pass the verification, and if so, entering the next step. Specifically, the server looks up whether there are Clientdata and Hashreust from the decrypted data, if not, the server considers the data to be illegal, and the verification is not passed.
And step S5-3-3, further judging whether the check field and the calculation result are matched with the check field and the calculation result which are correspondingly sent to the equipment by the server, if so, the verification is passed, otherwise, the verification cannot be passed.
The server records random data issued to each client, and simultaneously records delay of notification information issued by the client, namely lottery drawing information, namely batch sorting D of the notification information relative to the earliest first batch, so that the server can calculate the number N of 0 in the hash result of the client according to N-L + M-D, judge whether the number N of 0 in the hash result meets the requirement, if not, the hash result is considered to be illegal, and if so, further calculate whether the calculation result of the client is correct.
serverhashresult=md5.create(Clientdata+ServerRandData);
And judging whether the result server hashresult prestored by the server is consistent with the hashresult reported by the client through the codes, and if not, indicating that the result server hashresult is illegal.
It can be seen from the algorithm that the server only needs to perform calculation once, and the client needs to continuously transform the Clientdata and calculate hashresult for many times in order to calculate the number of 0 s meeting the requirement.
By this step, the right process of the server for carrying out validity verification and judgment on the lottery drawing request information containing the calculation result according to the lottery drawing information by the client is completed.
In the above embodiment, the preset algorithm is to calculate a hash value of the random data, the predetermined value in the calculation result is 0, and the calculation time of the device is adjusted by setting the number of 0 predetermined values, so as to eliminate the difference in calculation capability between various devices, and as an alternative, the preset algorithm may also be adjusted by calculating the number of other values, such as 1, 2, and 3, of the hash value of some random data.
In the above embodiment, the check field is random data, but may be other longer characters.
Fig. 4 is a schematic structural diagram of an information verification system in an embodiment of the present invention.
The information verification system 100 for verifying information when a device sends information to a server is described in detail below with reference to fig. 4, and comprises:
a computing power obtaining module 101, configured to obtain a computing power level L of the device;
the batch notification module 102 is configured to notify the multiple devices in M batches at different times, where the notification information corresponding to each device includes a corresponding computing power level L, a check field, and a batch ranking D of the notification information relative to the earliest first batch;
a shared key generation module 103, configured to establish communication between the device and the server and generate a shared key;
a predetermined value calculation and judgment module 104, configured to perform predetermined calculation on the check field to obtain a calculation result, and further judge whether the number N of predetermined values in the calculation result satisfies N + L-M-D;
and the matching judgment module 105 is used for encrypting the calculation result of the preset calculation by using the shared key and sending the calculation result to the server, verifying whether the calculation result is matched with the prestored result or not, and if the calculation result is matched with the prestored result, passing the verification.
Further described below is an information verification apparatus comprising a memory and a processor, the memory having stored thereon a computer program for execution on the processor, wherein: the processor, when executing the computer program, implements the method of:
s1, acquiring the computing power level L of the equipment;
s2, M batches of the equipment are notified at different times, and the notification information corresponding to each equipment comprises a corresponding computing power level L, a check field and a batch ordering D of the notification information relative to the earliest first batch;
s3, the device and the server establish communication and generate a shared key;
s4, the device receives the corresponding notification information, inputs the check field into a preset algorithm to obtain a calculation result, and enters the next step when the number N of preset values in the calculation result meets the requirement that N is L + M-D;
and S5, encrypting the calculation result by using the shared key and sending the calculation result to the server, verifying whether the calculation result is matched with the prestored result by the server, and if so, passing the verification.
The embodiment has the following functions and effects: according to the method for verifying information of the present invention, the method comprises the following steps: acquiring and determining the computing capacity level L of the client equipment; the client devices are notified in batches by dividing M batches at different moments, and the notification information corresponding to each client comprises a corresponding computing capacity level L, random data and a batch ordering D of the notification information relative to the earliest first batch; the client device and the server establish communication and generate a shared key; the client device receives the corresponding notification information, performs specific calculation on the random data to obtain a preset value, and enters the next step when the number N of the preset values obtained by the specific calculation meets the condition that N is L + M-D; encrypting the calculation result of specific calculation by using shared secret key and transmitting it to server, verifying whether the calculation result is matched by server, if matched, verifying so that it is passed
The client devices are notified in batches by M at different moments, so that some client devices can receive notification information of the barrage lottery firstly, some client devices can receive notification information of the barrage lottery later, and the server divides instant lottery barrage information into a plurality of time periods to be issued, so that when the audience operates the client devices to conduct barrage lottery, barrages reported by the audience are distributed due to time differences, and instantaneous pressure of the server caused by the fact that the server receives a large number of concurrent lottery barrages at the same time is avoided;
the calculation capacity difference of the client of the user is eliminated by adopting whether the number N of the preset values obtained by specific calculation meets N-L + M-D to adjust the calculation times (calculation time): the random data used as the check field controls the calculation times of the client according to the equipment type of the client and the time of issuing the barrage lottery drawing notification information by the server, namely, the time of issuing the barrage lottery drawing notification information is early, the calculation times of the check field of the client with strong calculation capability are more, so that the difference of the calculation capability of the client equipment is offset, and the chance that a hacker generates a robot user to draw a lottery through a written protocol is fundamentally stopped (because the hacker has good equipment but has more calculation times and long time, a large amount of lottery drawing information cannot be sent), so the lottery drawing fairness is also improved.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, 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, 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, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (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 apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, 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 apparatus 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 apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
The present invention is not limited to the above-described embodiments, and it will be apparent to those skilled in the art that various modifications and improvements can be made without departing from the principle of the present invention, and such modifications and improvements are also considered to be within the scope of the present invention. Those not described in detail in this specification are within the skill of the art.

Claims (8)

1. An information verification method for verifying information when a device sends the information to a server, comprising the steps of:
acquiring the computing capacity level L of the equipment;
the method comprises the steps that M batches of the equipment are notified at different moments, and notification information corresponding to each equipment comprises a corresponding computing capacity level L, a check field and a batch ordering D of the notification information relative to the earliest first batch;
the device and the server establish communication and generate a shared key;
the equipment receives the corresponding notification information, inputs the check field into a preset algorithm to obtain a calculation result, and enters the next step when the number N of preset values in the calculation result meets the requirement that N is L + M-D;
encrypting the calculation result by using a shared secret key and sending the calculation result to a server, verifying whether the calculation result is matched with a prestored result by the server, and if the calculation result is matched with the prestored result, verifying the calculation result to pass;
the method comprises the following specific steps of batch notification:
dividing the selected time T into M parts on average;
equally dividing all the devices corresponding to the server into M parts;
in the first T/M time, the notification information is sent to the first batch of equipment, and then sent to other equipment according to the batch sequence until the sending is finished;
the preset algorithm is hash value calculation of the check field, and the number of the corresponding preset values is the number of 0 at the beginning of the hash value calculation.
2. The information verification method according to claim 1, characterized in that: the process of obtaining the computing power level L comprises the following steps:
and acquiring equipment information of the equipment, and determining the computing capability level L of the equipment according to the acquired equipment information by contrasting pre-stored equipment and computing capability level corresponding information.
3. The information verification method according to claim 1, characterized in that:
wherein the process of establishing communication and generating a shared key comprises the sub-steps of:
when the equipment logs in the server, the server generates a pair of public key and private key according to the user information of the equipment;
when the device logs in to the server, the device generates a pair of a public key and a private key according to the verification field and the time stamp of the login time;
the server and each device exchange public keys with each other to realize key sharing and establish communication.
4. The information verification method according to claim 1, characterized in that:
wherein the server is a live platform server, the device is a device of a live platform for audience users to use,
the notification information is notification information of a barrage lottery, and the check field is random data.
5. The information verification method according to claim 1, characterized in that:
when the number N of the predetermined values obtained by performing the specific calculation does not satisfy N-L + M-D, the device adds a multi-bit data before the check field and performs the calculation again until the condition is satisfied.
6. The information verification method according to claim 1, characterized in that:
the process that the server verifies whether the calculation results are matched comprises the following substeps:
decrypting the notification information received from the device using the public key;
checking whether a check field and a calculation result exist in the data obtained by decryption, if not, judging that the data is invalid and cannot pass the verification, and if so, entering the next step;
and further judging whether the check field and the calculation result are matched with the check field and the calculation result which are correspondingly sent to the equipment by the server, if so, the verification is passed, otherwise, the verification cannot be passed.
7. An information authentication system for performing authentication of information when a device transmits the information to a server, comprising:
the computing power obtaining module is used for obtaining the computing power level L of the equipment;
the batch notification module is used for notifying the equipment in M batches at different moments, and the notification information corresponding to each equipment comprises a corresponding computing capacity level L, a check field and a batch ordering D of the notification information relative to the earliest first batch;
the shared key generation module is used for establishing communication between the equipment and the server and generating a shared key;
the preset value calculation and judgment module is used for inputting the check field into a preset algorithm to obtain a calculation result through calculation, and further judging whether the number N of preset values in the calculation result meets the requirement that N is L + M-D;
the matching judgment module is used for encrypting the calculation result by using the shared key and sending the calculation result to the server, verifying whether the calculation result is matched with the prestored result or not, and if the calculation result is matched with the prestored result, the verification is passed;
the method comprises the following specific steps of batch notification:
dividing the selected time T into M parts on average;
equally dividing all the devices corresponding to the server into M parts;
in the first T/M time, the notification information is sent to the first batch of equipment, and then sent to other equipment according to the batch sequence until the sending is finished;
the preset algorithm is hash value calculation of the check field, and the number of the corresponding preset values is the number of 0 at the beginning of the hash value calculation.
8. An information authentication apparatus comprising a memory and a processor, the memory having stored thereon a computer program that runs on the processor, characterized in that: the processor, when executing the computer program, implements the method of any of claims 1 to 7.
CN201810737301.0A 2018-07-06 2018-07-06 Information verification method, system and device Active CN108964901B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810737301.0A CN108964901B (en) 2018-07-06 2018-07-06 Information verification method, system and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810737301.0A CN108964901B (en) 2018-07-06 2018-07-06 Information verification method, system and device

Publications (2)

Publication Number Publication Date
CN108964901A CN108964901A (en) 2018-12-07
CN108964901B true CN108964901B (en) 2021-05-28

Family

ID=64482480

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810737301.0A Active CN108964901B (en) 2018-07-06 2018-07-06 Information verification method, system and device

Country Status (1)

Country Link
CN (1) CN108964901B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109905395B (en) * 2019-03-07 2021-09-07 武汉斗鱼鱼乐网络科技有限公司 Method and related device for verifying credibility of client
CN110147658A (en) * 2019-04-16 2019-08-20 平安科技(深圳)有限公司 User information encipher-decipher method, system and computer equipment
CN110415031A (en) * 2019-07-22 2019-11-05 广州虎牙科技有限公司 Interact lottery drawing method, device, electronic equipment and computer readable storage medium
CN111245600B (en) * 2019-12-03 2022-12-16 江苏艾佳家居用品有限公司 Authentication method and system based on block chain technology
CN112312152B (en) * 2020-10-27 2022-11-04 浙江集享电子商务有限公司 Data processing system in network live broadcast

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101674318A (en) * 2008-09-11 2010-03-17 北大方正集团有限公司 Method for pushing data to mobile equipment at regular time
CN106060057A (en) * 2016-06-17 2016-10-26 武汉斗鱼网络科技有限公司 System and method for video live broadcast website to generate white list based on user barrage behavior
CN107529078A (en) * 2017-09-08 2017-12-29 武汉斗鱼网络科技有限公司 Prevent the verification method and device brushed
CN108230047A (en) * 2018-02-05 2018-06-29 武汉斗鱼网络科技有限公司 Data processing method of drawing a lottery and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8758111B2 (en) * 2008-08-20 2014-06-24 Cfph, Llc Game of chance systems and methods
US8751807B2 (en) * 2011-06-23 2014-06-10 Azuki Systems Inc. Method and system for secure over-the-top live video delivery

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101674318A (en) * 2008-09-11 2010-03-17 北大方正集团有限公司 Method for pushing data to mobile equipment at regular time
CN106060057A (en) * 2016-06-17 2016-10-26 武汉斗鱼网络科技有限公司 System and method for video live broadcast website to generate white list based on user barrage behavior
CN107529078A (en) * 2017-09-08 2017-12-29 武汉斗鱼网络科技有限公司 Prevent the verification method and device brushed
CN108230047A (en) * 2018-02-05 2018-06-29 武汉斗鱼网络科技有限公司 Data processing method of drawing a lottery and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
从斗鱼TV,Twitch TV看网络直播平台的传播模式;杜星宇;《中国优秀硕士学位论文全文数据库.信息科技辑》;20170115(第1期);全文 *

Also Published As

Publication number Publication date
CN108964901A (en) 2018-12-07

Similar Documents

Publication Publication Date Title
CN108964901B (en) Information verification method, system and device
CN105959728B (en) The system and method for the statistics live streaming online number of platform
CN109962784B (en) Data encryption, decryption and recovery method based on multiple digital envelope certificates
CN107251035B (en) Account recovery protocol
US9043598B2 (en) Systems and methods for providing secure multicast intra-cluster communication
WO2017097041A1 (en) Data transmission method and device
CN105391734B (en) A kind of Security Login System and method, login service device and certificate server
US20180219688A1 (en) Information Transmission Method and Mobile Device
CN110198295A (en) Safety certifying method and device and storage medium
CN110166242A (en) Message transmitting method and device
WO2019047375A1 (en) Authentication method, device, server and storage medium for preventing automated gift farming
CN101286849A (en) Authentication system and method of a third party based on engagement arithmetic
CN108881966B (en) Information processing method and related equipment
WO2019047511A1 (en) Method, device, and live broadcast system for preventing automated farming
WO2023160420A1 (en) Group message encryption method and apparatus, device and storage medium
CN106453391A (en) Long repeating data encryption and transmission method and system
WO2019061597A1 (en) Data processing method and server
CN110839240B (en) Method and device for establishing connection
CN110941809A (en) File encryption and decryption method and device, fingerprint password device and readable storage medium
WO2014106149A1 (en) Techniques for validating cryptographic applications
CN117240625B (en) Tamper-resistant data processing method and device and electronic equipment
CN108924108B (en) Communication method for client and electronic equipment
CN106452754B (en) Multi-user online dynamic encryption method and device
CN115085983B (en) Data processing method, data processing device, computer readable storage medium and electronic equipment
CN112118569A (en) Group authentication method and system in asynchronous group communication of LTE network machine type communication 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
GR01 Patent grant
GR01 Patent grant